From f1c25eadded9927a2ff0d20f73f761ab39c17ace Mon Sep 17 00:00:00 2001 From: AsabuHere Date: Tue, 17 Oct 2023 17:04:23 +0530 Subject: [PATCH] Modified generated files --- rest/accounts/v1/auth_tokens_promote.go | 1 + rest/accounts/v1/auth_tokens_secondary.go | 2 + rest/accounts/v1/credentials_aws.go | 154 ++- rest/accounts/v1/credentials_public_keys.go | 35 +- rest/api/v2010/accounts.go | 40 +- rest/api/v2010/accounts_addresses.go | 143 +- ...ounts_addresses_dependent_phone_numbers.go | 7 +- rest/api/v2010/accounts_applications.go | 209 +-- .../v2010/accounts_authorized_connect_apps.go | 8 +- .../v2010/accounts_available_phone_numbers.go | 8 +- .../accounts_available_phone_numbers_local.go | 115 +- ...ilable_phone_numbers_machine_to_machine.go | 115 +- ...accounts_available_phone_numbers_mobile.go | 115 +- ...counts_available_phone_numbers_national.go | 115 +- ...nts_available_phone_numbers_shared_cost.go | 115 +- ...ounts_available_phone_numbers_toll_free.go | 115 +- .../accounts_available_phone_numbers_voip.go | 115 +- rest/api/v2010/accounts_balance.go | 1 + rest/api/v2010/accounts_calls.go | 315 ++--- rest/api/v2010/accounts_calls_events.go | 7 +- rest/api/v2010/accounts_calls_feedback.go | 16 +- .../v2010/accounts_calls_feedback_summary.go | 33 +- .../api/v2010/accounts_calls_notifications.go | 32 +- rest/api/v2010/accounts_calls_payments.go | 128 +- rest/api/v2010/accounts_calls_recordings.go | 79 +- rest/api/v2010/accounts_calls_siprec.go | 1226 +++++++++-------- rest/api/v2010/accounts_calls_streams.go | 1226 +++++++++-------- ...alls_user_defined_message_subscriptions.go | 20 +- .../accounts_calls_user_defined_messages.go | 13 +- rest/api/v2010/accounts_conferences.go | 51 +- .../accounts_conferences_participants.go | 391 +++--- .../v2010/accounts_conferences_recordings.go | 40 +- rest/api/v2010/accounts_connect_apps.go | 60 +- .../v2010/accounts_incoming_phone_numbers.go | 317 ++--- ...incoming_phone_numbers_assigned_add_ons.go | 16 +- ...one_numbers_assigned_add_ons_extensions.go | 8 +- .../accounts_incoming_phone_numbers_local.go | 170 +-- .../accounts_incoming_phone_numbers_mobile.go | 170 +-- ...counts_incoming_phone_numbers_toll_free.go | 170 +-- rest/api/v2010/accounts_keys.go | 23 +- rest/api/v2010/accounts_messages.go | 183 +-- rest/api/v2010/accounts_messages_feedback.go | 7 +- rest/api/v2010/accounts_messages_media.go | 27 +- rest/api/v2010/accounts_notifications.go | 32 +- .../api/v2010/accounts_outgoing_caller_ids.go | 65 +- rest/api/v2010/accounts_queues.go | 35 +- rest/api/v2010/accounts_queues_members.go | 21 +- rest/api/v2010/accounts_recordings.go | 51 +- .../accounts_recordings_add_on_results.go | 9 +- ...unts_recordings_add_on_results_payloads.go | 9 +- .../accounts_recordings_transcriptions.go | 9 +- rest/api/v2010/accounts_signing_keys.go | 23 +- .../v2010/accounts_sip_credential_lists.go | 23 +- ...counts_sip_credential_lists_credentials.go | 29 +- rest/api/v2010/accounts_sip_domains.go | 167 +-- ...ins_auth_calls_credential_list_mappings.go | 16 +- ...h_calls_ip_access_control_list_mappings.go | 16 +- ..._registrations_credential_list_mappings.go | 16 +- ...ts_sip_domains_credential_list_mappings.go | 16 +- ...domains_ip_access_control_list_mappings.go | 16 +- .../accounts_sipip_access_control_lists.go | 23 +- ...sipip_access_control_lists_ip_addresses.go | 47 +- rest/api/v2010/accounts_sms_short_codes.go | 57 +- rest/api/v2010/accounts_tokens.go | 7 +- rest/api/v2010/accounts_transcriptions.go | 9 +- rest/api/v2010/accounts_usage_records.go | 31 +- .../v2010/accounts_usage_records_all_time.go | 31 +- .../api/v2010/accounts_usage_records_daily.go | 31 +- .../accounts_usage_records_last_month.go | 31 +- .../v2010/accounts_usage_records_monthly.go | 31 +- .../accounts_usage_records_this_month.go | 31 +- .../api/v2010/accounts_usage_records_today.go | 31 +- .../v2010/accounts_usage_records_yearly.go | 31 +- .../v2010/accounts_usage_records_yesterday.go | 31 +- rest/api/v2010/accounts_usage_triggers.go | 89 +- rest/api/v2010/safe_list_numbers.go | 21 +- rest/autopilot/v1/assistants.go | 125 +- rest/autopilot/v1/assistants_defaults.go | 16 +- rest/autopilot/v1/assistants_dialogues.go | 1 + rest/autopilot/v1/assistants_field_types.go | 35 +- .../v1/assistants_field_types_field_values.go | 34 +- rest/autopilot/v1/assistants_model_builds.go | 29 +- rest/autopilot/v1/assistants_queries.go | 71 +- rest/autopilot/v1/assistants_restore.go | 7 +- rest/autopilot/v1/assistants_style_sheet.go | 16 +- rest/autopilot/v1/assistants_tasks.go | 71 +- rest/autopilot/v1/assistants_tasks_actions.go | 16 +- rest/autopilot/v1/assistants_tasks_fields.go | 22 +- rest/autopilot/v1/assistants_tasks_samples.go | 53 +- .../v1/assistants_tasks_statistics.go | 1 + rest/autopilot/v1/assistants_webhooks.go | 59 +- rest/bulkexports/v1/exports.go | 1 + rest/bulkexports/v1/exports_configuration.go | 20 +- rest/bulkexports/v1/exports_days.go | 8 +- rest/bulkexports/v1/exports_jobs.go | 46 +- rest/chat/v1/credentials.go | 89 +- rest/chat/v1/services.go | 343 ++--- rest/chat/v1/services_channels.go | 61 +- rest/chat/v1/services_channels_invites.go | 30 +- rest/chat/v1/services_channels_members.go | 43 +- rest/chat/v1/services_channels_messages.go | 47 +- rest/chat/v1/services_roles.go | 39 +- rest/chat/v1/services_users.go | 53 +- rest/chat/v1/services_users_channels.go | 7 +- rest/chat/v2/credentials.go | 89 +- rest/chat/v2/services.go | 205 +-- rest/chat/v2/services_bindings.go | 25 +- rest/chat/v2/services_channels.go | 97 +- rest/chat/v2/services_channels_invites.go | 30 +- rest/chat/v2/services_channels_members.go | 97 +- rest/chat/v2/services_channels_messages.go | 95 +- rest/chat/v2/services_channels_webhooks.go | 97 +- rest/chat/v2/services_roles.go | 39 +- rest/chat/v2/services_users.go | 53 +- rest/chat/v2/services_users_bindings.go | 17 +- rest/chat/v2/services_users_channels.go | 28 +- rest/chat/v3/services_channels.go | 13 +- rest/content/v1/content.go | 9 +- rest/content/v1/content_and_approvals.go | 7 +- rest/content/v1/content_approval_requests.go | 1 + rest/content/v1/legacy_content.go | 7 +- rest/conversations/v1/configuration.go | 26 +- .../v1/configuration_addresses.go | 147 +- .../v1/configuration_webhooks.go | 34 +- rest/conversations/v1/conversations.go | 161 +-- .../v1/conversations_messages.go | 107 +- .../v1/conversations_messages_receipts.go | 8 +- .../v1/conversations_participants.go | 113 +- .../v1/conversations_webhooks.go | 91 +- rest/conversations/v1/credentials.go | 95 +- .../v1/participant_conversations.go | 19 +- rest/conversations/v1/roles.go | 39 +- rest/conversations/v1/services.go | 16 +- rest/conversations/v1/services_bindings.go | 25 +- .../v1/services_configuration.go | 26 +- .../services_configuration_notifications.go | 80 +- .../v1/services_configuration_webhooks.go | 28 +- .../v1/services_conversations.go | 161 +-- .../v1/services_conversations_messages.go | 107 +- ...ervices_conversations_messages_receipts.go | 8 +- .../v1/services_conversations_participants.go | 113 +- .../v1/services_conversations_webhooks.go | 91 +- .../v1/services_participant_conversations.go | 19 +- rest/conversations/v1/services_roles.go | 39 +- rest/conversations/v1/services_users.go | 53 +- .../v1/services_users_conversations.go | 28 +- rest/conversations/v1/users.go | 53 +- rest/conversations/v1/users_conversations.go | 28 +- rest/events/v1/schemas.go | 1 + rest/events/v1/schemas_versions.go | 8 +- rest/events/v1/sinks.go | 53 +- rest/events/v1/sinks_test_.go | 1 + rest/events/v1/sinks_validate.go | 7 +- rest/events/v1/subscriptions.go | 57 +- .../v1/subscriptions_subscribed_events.go | 29 +- rest/events/v1/types.go | 14 +- rest/flex/v1/channels.go | 70 +- rest/flex/v1/configuration.go | 8 +- rest/flex/v1/flex_flows.go | 221 +-- rest/flex/v1/insights_conversations.go | 13 +- ...insights_quality_management_assessments.go | 93 +- ...quality_management_assessments_comments.go | 56 +- .../insights_quality_management_categories.go | 22 +- ...ights_quality_management_questionnaires.go | 69 +- .../insights_quality_management_questions.go | 78 +- ...quality_management_settings_answer_sets.go | 1 + ...uality_management_settings_comment_tags.go | 1 + rest/flex/v1/insights_segments.go | 21 +- rest/flex/v1/insights_session.go | 1 + rest/flex/v1/insights_user_roles.go | 1 + rest/flex/v1/interactions.go | 34 +- rest/flex/v1/interactions_channels.go | 27 +- rest/flex/v1/interactions_channels_invites.go | 22 +- .../v1/interactions_channels_participants.go | 33 +- rest/flex/v1/web_channels.go | 59 +- rest/flex/v2/web_chats.go | 25 +- rest/frontline/v1/users.go | 26 +- rest/insights/v1/conferences.go | 68 +- rest/insights/v1/conferences_participants.go | 38 +- rest/insights/v1/video_rooms.go | 42 +- rest/insights/v1/video_rooms_participants.go | 8 +- rest/insights/v1/voice.go | 1 + rest/insights/v1/voice_annotation.go | 44 +- rest/insights/v1/voice_events.go | 13 +- rest/insights/v1/voice_metrics.go | 19 +- rest/insights/v1/voice_settings.go | 26 +- rest/insights/v1/voice_summaries.go | 151 +- rest/insights/v1/voice_summary.go | 7 +- rest/intelligence/v2/services.go | 119 +- rest/intelligence/v2/transcripts.go | 94 +- rest/intelligence/v2/transcripts_media.go | 7 +- .../v2/transcripts_operator_results.go | 20 +- rest/intelligence/v2/transcripts_sentences.go | 13 +- rest/ip_messaging/v1/credentials.go | 89 +- rest/ip_messaging/v1/services.go | 343 ++--- rest/ip_messaging/v1/services_channels.go | 61 +- .../v1/services_channels_invites.go | 30 +- .../v1/services_channels_members.go | 43 +- .../v1/services_channels_messages.go | 47 +- rest/ip_messaging/v1/services_roles.go | 39 +- rest/ip_messaging/v1/services_users.go | 53 +- .../v1/services_users_channels.go | 7 +- rest/ip_messaging/v2/credentials.go | 89 +- rest/ip_messaging/v2/services.go | 205 +-- rest/ip_messaging/v2/services_bindings.go | 25 +- rest/ip_messaging/v2/services_channels.go | 97 +- .../v2/services_channels_invites.go | 30 +- .../v2/services_channels_members.go | 97 +- .../v2/services_channels_messages.go | 95 +- .../v2/services_channels_webhooks.go | 97 +- rest/ip_messaging/v2/services_roles.go | 39 +- rest/ip_messaging/v2/services_users.go | 53 +- .../v2/services_users_bindings.go | 17 +- .../v2/services_users_channels.go | 28 +- rest/lookups/v1/phone_numbers.go | 37 +- rest/lookups/v2/phone_numbers.go | 79 +- rest/media/v1/media_processors.go | 70 +- rest/media/v1/media_recordings.go | 33 +- rest/media/v1/player_streamers.go | 52 +- .../v1/player_streamers_playback_grant.go | 14 +- rest/messaging/v1/a2p_brand_registrations.go | 40 +- .../v1/a2p_brand_registrations_sms_otp.go | 1 + .../v1/a2p_brand_registrations_vettings.go | 27 +- rest/messaging/v1/deactivations.go | 7 +- .../v1/link_shortening_domains_certificate.go | 9 +- .../v1/link_shortening_domains_config.go | 26 +- ...k_shortening_domains_messaging_services.go | 2 + ...rtening_messaging_service_domain_config.go | 1 + ...nk_shortening_messaging_services_domain.go | 1 + rest/messaging/v1/services.go | 203 +-- rest/messaging/v1/services_alpha_senders.go | 16 +- rest/messaging/v1/services_channel_senders.go | 8 +- .../messaging/v1/services_compliance_usa2p.go | 96 +- .../v1/services_compliance_usa2p_usecases.go | 7 +- rest/messaging/v1/services_phone_numbers.go | 16 +- .../v1/services_preregistered_usa2p.go | 13 +- rest/messaging/v1/services_short_codes.go | 16 +- rest/messaging/v1/services_usecases.go | 1 + rest/messaging/v1/tollfree_verifications.go | 288 ++-- rest/microvisor/v1/apps.go | 9 +- rest/microvisor/v1/apps_manifest.go | 1 + rest/microvisor/v1/configs.go | 29 +- rest/microvisor/v1/devices.go | 33 +- rest/microvisor/v1/devices_configs.go | 29 +- rest/microvisor/v1/devices_secrets.go | 29 +- rest/microvisor/v1/secrets.go | 29 +- rest/monitor/v1/alerts.go | 26 +- rest/monitor/v1/events.go | 44 +- rest/notify/v1/credentials.go | 89 +- rest/notify/v1/services.go | 185 +-- rest/notify/v1/services_bindings.go | 82 +- rest/notify/v1/services_notifications.go | 161 +-- .../v1/hosted_number_eligibility_bulk.go | 2 + rest/numbers/v1/porting_portability.go | 10 +- .../v1/porting_portability_phone_number.go | 7 +- .../hosted_number_authorization_documents.go | 62 +- ...ocuments_dependent_hosted_number_orders.go | 31 +- rest/numbers/v2/hosted_number_orders.go | 138 +- rest/numbers/v2/hosted_number_orders_bulk.go | 8 +- .../v2/regulatory_compliance_bundles.go | 131 +- .../regulatory_compliance_bundles_copies.go | 14 +- ...gulatory_compliance_bundles_evaluations.go | 9 +- ...ory_compliance_bundles_item_assignments.go | 16 +- ...latory_compliance_bundles_replace_items.go | 7 +- .../regulatory_compliance_end_user_types.go | 8 +- .../v2/regulatory_compliance_end_users.go | 53 +- .../v2/regulatory_compliance_regulations.go | 26 +- ...ry_compliance_supporting_document_types.go | 8 +- ...ulatory_compliance_supporting_documents.go | 53 +- rest/oauth/v1/certs.go | 1 + rest/oauth/v1/device_code.go | 23 +- rest/oauth/v1/token.go | 49 +- rest/oauth/v1/userinfo.go | 1 + .../v1/well_known_openid_configuration.go | 1 + rest/pricing/v1/messaging_countries.go | 8 +- rest/pricing/v1/phone_numbers_countries.go | 8 +- rest/pricing/v1/voice_countries.go | 8 +- rest/pricing/v1/voice_numbers.go | 1 + rest/pricing/v2/trunking_countries.go | 8 +- rest/pricing/v2/trunking_numbers.go | 7 +- rest/pricing/v2/voice_countries.go | 8 +- rest/pricing/v2/voice_numbers.go | 7 +- rest/proxy/v1/services.go | 107 +- rest/proxy/v1/services_phone_numbers.go | 35 +- rest/proxy/v1/services_sessions.go | 75 +- .../v1/services_sessions_interactions.go | 9 +- .../v1/services_sessions_participants.go | 34 +- ...sions_participants_message_interactions.go | 23 +- rest/proxy/v1/services_short_codes.go | 23 +- rest/routes/v2/phone_numbers.go | 14 +- rest/routes/v2/sip_domains.go | 14 +- rest/routes/v2/trunks.go | 14 +- rest/serverless/v1/services.go | 53 +- rest/serverless/v1/services_assets.go | 23 +- .../serverless/v1/services_assets_versions.go | 8 +- rest/serverless/v1/services_builds.go | 38 +- rest/serverless/v1/services_builds_status.go | 1 + rest/serverless/v1/services_environments.go | 22 +- .../v1/services_environments_deployments.go | 15 +- .../v1/services_environments_logs.go | 26 +- .../v1/services_environments_variables.go | 35 +- rest/serverless/v1/services_functions.go | 23 +- .../v1/services_functions_versions.go | 8 +- .../v1/services_functions_versions_content.go | 1 + rest/studio/v1/flows.go | 9 +- rest/studio/v1/flows_engagements.go | 34 +- rest/studio/v1/flows_engagements_context.go | 1 + rest/studio/v1/flows_engagements_steps.go | 8 +- .../v1/flows_engagements_steps_context.go | 1 + rest/studio/v1/flows_executions.go | 53 +- rest/studio/v1/flows_executions_context.go | 1 + rest/studio/v1/flows_executions_steps.go | 8 +- .../v1/flows_executions_steps_context.go | 1 + rest/studio/v2/flows.go | 71 +- rest/studio/v2/flows_executions.go | 53 +- rest/studio/v2/flows_executions_context.go | 1 + rest/studio/v2/flows_executions_steps.go | 8 +- .../v2/flows_executions_steps_context.go | 1 + rest/studio/v2/flows_revisions.go | 8 +- rest/studio/v2/flows_test_users.go | 10 +- rest/studio/v2/flows_validate.go | 31 +- rest/supersim/v1/e_sim_profiles.go | 51 +- rest/supersim/v1/fleets.go | 112 +- rest/supersim/v1/ip_commands.go | 69 +- rest/supersim/v1/network_access_profiles.go | 30 +- .../v1/network_access_profiles_networks.go | 16 +- rest/supersim/v1/networks.go | 26 +- rest/supersim/v1/settings_updates.go | 19 +- rest/supersim/v1/sims.go | 76 +- rest/supersim/v1/sims_billing_periods.go | 7 +- rest/supersim/v1/sims_ip_addresses.go | 7 +- rest/supersim/v1/sms_commands.go | 51 +- rest/supersim/v1/usage_records.go | 55 +- rest/sync/v1/services.go | 95 +- rest/sync/v1/services_documents.go | 55 +- .../sync/v1/services_documents_permissions.go | 28 +- rest/sync/v1/services_lists.go | 41 +- rest/sync/v1/services_lists_items.go | 93 +- rest/sync/v1/services_lists_permissions.go | 28 +- rest/sync/v1/services_maps.go | 41 +- rest/sync/v1/services_maps_items.go | 97 +- rest/sync/v1/services_maps_permissions.go | 28 +- rest/sync/v1/services_streams.go | 29 +- rest/sync/v1/services_streams_messages.go | 15 +- rest/taskrouter/v1/workspaces.go | 95 +- rest/taskrouter/v1/workspaces_activities.go | 41 +- .../v1/workspaces_cumulative_statistics.go | 31 +- rest/taskrouter/v1/workspaces_events.go | 74 +- .../v1/workspaces_real_time_statistics.go | 7 +- rest/taskrouter/v1/workspaces_statistics.go | 31 +- .../taskrouter/v1/workspaces_task_channels.go | 41 +- rest/taskrouter/v1/workspaces_task_queues.go | 107 +- ...paces_task_queues_cumulative_statistics.go | 31 +- ...spaces_task_queues_real_time_statistics.go | 8 +- .../v1/workspaces_task_queues_statistics.go | 74 +- rest/taskrouter/v1/workspaces_tasks.go | 127 +- .../v1/workspaces_tasks_reservations.go | 345 ++--- rest/taskrouter/v1/workspaces_workers.go | 101 +- .../v1/workspaces_workers_channels.go | 21 +- ...orkspaces_workers_cumulative_statistics.go | 25 +- ...workspaces_workers_real_time_statistics.go | 7 +- .../v1/workspaces_workers_reservations.go | 327 ++--- .../v1/workspaces_workers_statistics.go | 68 +- rest/taskrouter/v1/workspaces_workflows.go | 83 +- ...kspaces_workflows_cumulative_statistics.go | 31 +- ...rkspaces_workflows_real_time_statistics.go | 7 +- .../v1/workspaces_workflows_statistics.go | 31 +- rest/trunking/v1/trunks.go | 107 +- rest/trunking/v1/trunks_credential_lists.go | 16 +- .../v1/trunks_ip_access_control_lists.go | 16 +- rest/trunking/v1/trunks_origination_urls.go | 71 +- rest/trunking/v1/trunks_phone_numbers.go | 16 +- rest/trunking/v1/trunks_recording.go | 14 +- ...mpliance_inquiries_customers_initialize.go | 14 +- rest/trusthub/v1/customer_profiles.go | 77 +- ...r_profiles_channel_endpoint_assignments.go | 34 +- .../customer_profiles_entity_assignments.go | 16 +- .../v1/customer_profiles_evaluations.go | 15 +- rest/trusthub/v1/end_user_types.go | 8 +- rest/trusthub/v1/end_users.go | 53 +- rest/trusthub/v1/policies.go | 8 +- rest/trusthub/v1/supporting_document_types.go | 8 +- rest/trusthub/v1/supporting_documents.go | 53 +- rest/trusthub/v1/trust_products.go | 77 +- ...t_products_channel_endpoint_assignments.go | 34 +- .../v1/trust_products_entity_assignments.go | 16 +- .../trusthub/v1/trust_products_evaluations.go | 15 +- rest/verify/v2/attempts.go | 56 +- rest/verify/v2/attempts_summary.go | 37 +- rest/verify/v2/forms.go | 1 + rest/verify/v2/safe_list_numbers.go | 9 +- rest/verify/v2/services.go | 215 +-- rest/verify/v2/services_access_tokens.go | 26 +- rest/verify/v2/services_entities.go | 16 +- .../verify/v2/services_entities_challenges.go | 96 +- ...vices_entities_challenges_notifications.go | 7 +- rest/verify/v2/services_entities_factors.go | 155 ++- .../v2/services_messaging_configurations.go | 29 +- rest/verify/v2/services_rate_limits.go | 29 +- .../verify/v2/services_rate_limits_buckets.go | 35 +- rest/verify/v2/services_verification_check.go | 31 +- rest/verify/v2/services_verifications.go | 117 +- rest/verify/v2/services_webhooks.go | 75 +- rest/verify/v2/templates.go | 13 +- rest/video/v1/composition_hooks.go | 175 +-- rest/video/v1/composition_settings_default.go | 38 +- rest/video/v1/compositions.go | 98 +- rest/video/v1/recording_settings_default.go | 38 +- rest/video/v1/recordings.go | 47 +- rest/video/v1/rooms.go | 140 +- rest/video/v1/rooms_participants.go | 39 +- rest/video/v1/rooms_participants_anonymize.go | 1 + .../v1/rooms_participants_published_tracks.go | 8 +- .../v1/rooms_participants_subscribe_rules.go | 16 +- .../rooms_participants_subscribed_tracks.go | 8 +- rest/video/v1/rooms_recording_rules.go | 16 +- rest/video/v1/rooms_recordings.go | 33 +- rest/voice/v1/archives_calls.go | 1 + rest/voice/v1/byoc_trunks.go | 131 +- rest/voice/v1/connection_policies.go | 23 +- rest/voice/v1/connection_policies_targets.go | 71 +- ...ialing_permissions_bulk_country_updates.go | 7 +- .../voice/v1/dialing_permissions_countries.go | 44 +- ...ns_countries_high_risk_special_prefixes.go | 7 +- rest/voice/v1/ip_records.go | 35 +- rest/voice/v1/settings.go | 8 +- rest/voice/v1/source_ip_mappings.go | 29 +- rest/wireless/v1/commands.go | 76 +- rest/wireless/v1/rate_plans.go | 91 +- rest/wireless/v1/sims.go | 148 +- rest/wireless/v1/sims_data_sessions.go | 7 +- rest/wireless/v1/sims_usage_records.go | 25 +- rest/wireless/v1/usage_records.go | 25 +- 433 files changed, 12514 insertions(+), 11188 deletions(-) diff --git a/rest/accounts/v1/auth_tokens_promote.go b/rest/accounts/v1/auth_tokens_promote.go index 81d3ff32f..110909eb5 100644 --- a/rest/accounts/v1/auth_tokens_promote.go +++ b/rest/accounts/v1/auth_tokens_promote.go @@ -32,6 +32,7 @@ func (c *ApiService) UpdateAuthTokenPromotion() (*AccountsV1AuthTokenPromotion, + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/accounts/v1/auth_tokens_secondary.go b/rest/accounts/v1/auth_tokens_secondary.go index 7137354d9..436a39d38 100644 --- a/rest/accounts/v1/auth_tokens_secondary.go +++ b/rest/accounts/v1/auth_tokens_secondary.go @@ -32,6 +32,7 @@ func (c *ApiService) CreateSecondaryAuthToken() (*AccountsV1SecondaryAuthToken, + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -56,6 +57,7 @@ func (c *ApiService) DeleteSecondaryAuthToken() (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err diff --git a/rest/accounts/v1/credentials_aws.go b/rest/accounts/v1/credentials_aws.go index fed436ede..7705c5264 100644 --- a/rest/accounts/v1/credentials_aws.go +++ b/rest/accounts/v1/credentials_aws.go @@ -15,14 +15,14 @@ package openapi import ( - "encoding/json" - "fmt" - "net/url" - "strings" + "encoding/json" + "fmt" + "net/url" "github.com/twilio/twilio-go/client" ) + // Optional parameters for the method 'CreateCredentialAws' type CreateCredentialAwsParams struct { // A string that contains the AWS access credentials in the format `:`. For example, `AKIAIOSFODNN7EXAMPLE:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY` @@ -33,15 +33,15 @@ type CreateCredentialAwsParams struct { AccountSid *string `json:"AccountSid,omitempty"` } -func (params *CreateCredentialAwsParams) SetCredentials(Credentials string) *CreateCredentialAwsParams { +func (params *CreateCredentialAwsParams) SetCredentials(Credentials string) (*CreateCredentialAwsParams){ params.Credentials = &Credentials return params } -func (params *CreateCredentialAwsParams) SetFriendlyName(FriendlyName string) *CreateCredentialAwsParams { +func (params *CreateCredentialAwsParams) SetFriendlyName(FriendlyName string) (*CreateCredentialAwsParams){ params.FriendlyName = &FriendlyName return params } -func (params *CreateCredentialAwsParams) SetAccountSid(AccountSid string) *CreateCredentialAwsParams { +func (params *CreateCredentialAwsParams) SetAccountSid(AccountSid string) (*CreateCredentialAwsParams){ params.AccountSid = &AccountSid return params } @@ -49,9 +49,10 @@ func (params *CreateCredentialAwsParams) SetAccountSid(AccountSid string) *Creat // Create a new AWS Credential func (c *ApiService) CreateCredentialAws(params *CreateCredentialAwsParams) (*AccountsV1CredentialAws, error) { path := "/v1/Credentials/AWS" - + data := url.Values{} headers := make(map[string]interface{}) + if params != nil && params.Credentials != nil { data.Set("Credentials", *params.Credentials) } @@ -62,6 +63,8 @@ func (c *ApiService) CreateCredentialAws(params *CreateCredentialAwsParams) (*Ac data.Set("AccountSid", *params.AccountSid) } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -78,13 +81,16 @@ func (c *ApiService) CreateCredentialAws(params *CreateCredentialAwsParams) (*Ac } // Delete a Credential from your account -func (c *ApiService) DeleteCredentialAws(Sid string, ) error { +func (c *ApiService) DeleteCredentialAws(Sid string, ) (error) { path := "/v1/Credentials/AWS/{Sid}" - path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) + path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} headers := make(map[string]interface{}) + + + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -98,11 +104,14 @@ func (c *ApiService) DeleteCredentialAws(Sid string, ) error { // Fetch the AWS credentials specified by the provided Credential Sid func (c *ApiService) FetchCredentialAws(Sid string, ) (*AccountsV1CredentialAws, error) { path := "/v1/Credentials/AWS/{Sid}" - path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) + path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) data := url.Values{} headers := make(map[string]interface{}) + + + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -126,11 +135,11 @@ type ListCredentialAwsParams struct { Limit *int `json:"limit,omitempty"` } -func (params *ListCredentialAwsParams) SetPageSize(PageSize int) *ListCredentialAwsParams { +func (params *ListCredentialAwsParams) SetPageSize(PageSize int) (*ListCredentialAwsParams){ params.PageSize = &PageSize return params } -func (params *ListCredentialAwsParams) SetLimit(Limit int) *ListCredentialAwsParams { +func (params *ListCredentialAwsParams) SetLimit(Limit int) (*ListCredentialAwsParams){ params.Limit = &Limit return params } @@ -139,8 +148,10 @@ func (params *ListCredentialAwsParams) SetLimit(Limit int) *ListCredentialAwsPar func (c *ApiService) PageCredentialAws(params *ListCredentialAwsParams, pageToken, pageNumber string) (*ListCredentialAwsResponse, error) { 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)) } @@ -169,70 +180,71 @@ func (c *ApiService) PageCredentialAws(params *ListCredentialAwsParams, pageToke // Lists CredentialAws records from the API as a list. Unlike stream, this operation is eager and loads 'limit' records into memory before returning. func (c *ApiService) ListCredentialAws(params *ListCredentialAwsParams) ([]AccountsV1CredentialAws, error) { - response, errors := c.StreamCredentialAws(params) + response, errors := c.StreamCredentialAws(params) - records := make([]AccountsV1CredentialAws, 0) - for record := range response { - records = append(records, record) - } + records := make([]AccountsV1CredentialAws, 0) + for record := range response { + records = append(records, record) + } - if err := <-errors; err != nil { - return nil, err - } + if err := <-errors; err != nil { + return nil, err + } - return records, nil + return records, nil } // Streams CredentialAws records from the API as a channel stream. This operation lazily loads records as efficiently as possible until the limit is reached. func (c *ApiService) StreamCredentialAws(params *ListCredentialAwsParams) (chan AccountsV1CredentialAws, chan error) { - if params == nil { - params = &ListCredentialAwsParams{} - } - params.SetPageSize(client.ReadLimits(params.PageSize, params.Limit)) - - recordChannel := make(chan AccountsV1CredentialAws, 1) - errorChannel := make(chan error, 1) - - response, err := c.PageCredentialAws(params, "", "") - if err != nil { - errorChannel <- err - close(recordChannel) - close(errorChannel) - } else { - go c.streamCredentialAws(response, params, recordChannel, errorChannel) - } - - return recordChannel, errorChannel + if params == nil { + params = &ListCredentialAwsParams{} + } + params.SetPageSize(client.ReadLimits(params.PageSize, params.Limit)) + + recordChannel := make(chan AccountsV1CredentialAws, 1) + errorChannel := make(chan error, 1) + + response, err := c.PageCredentialAws(params, "", "") + if err != nil { + errorChannel <- err + close(recordChannel) + close(errorChannel) + } else { + go c.streamCredentialAws(response, params, recordChannel, errorChannel) + } + + return recordChannel, errorChannel } -func (c *ApiService) streamCredentialAws(response *ListCredentialAwsResponse, params *ListCredentialAwsParams, recordChannel chan AccountsV1CredentialAws, errorChannel chan error) { - curRecord := 1 - - for response != nil { - responseRecords := response.Credentials - for item := range responseRecords { - recordChannel <- responseRecords[item] - curRecord += 1 - if params.Limit != nil && *params.Limit < curRecord { - close(recordChannel) - close(errorChannel) - return - } - } - - record, err := client.GetNext(c.baseURL, response, c.getNextListCredentialAwsResponse) - if err != nil { - errorChannel <- err - break - } else if record == nil { - break - } - - response = record.(*ListCredentialAwsResponse) - } - close(recordChannel) - close(errorChannel) +func (c *ApiService) streamCredentialAws(response *ListCredentialAwsResponse, params *ListCredentialAwsParams, recordChannel chan AccountsV1CredentialAws, errorChannel chan error) { + curRecord := 1 + + for response != nil { + responseRecords := response.Credentials + for item := range responseRecords { + recordChannel <- responseRecords[item] + curRecord += 1 + if params.Limit != nil && *params.Limit < curRecord { + close(recordChannel) + close(errorChannel) + return + } + } + + record, err := client.GetNext(c.baseURL, response, c.getNextListCredentialAwsResponse) + if err != nil { + errorChannel <- err + break + } else if record == nil { + break + } + + response = record.(*ListCredentialAwsResponse) + } + + close(recordChannel) + close(errorChannel) } func (c *ApiService) getNextListCredentialAwsResponse(nextPageUrl string) (interface{}, error) { @@ -253,13 +265,14 @@ func (c *ApiService) getNextListCredentialAwsResponse(nextPageUrl string) (inter return ps, nil } + // Optional parameters for the method 'UpdateCredentialAws' type UpdateCredentialAwsParams struct { // A descriptive string that you create to describe the resource. It can be up to 64 characters long. FriendlyName *string `json:"FriendlyName,omitempty"` } -func (params *UpdateCredentialAwsParams) SetFriendlyName(FriendlyName string) *UpdateCredentialAwsParams { +func (params *UpdateCredentialAwsParams) SetFriendlyName(FriendlyName string) (*UpdateCredentialAwsParams){ params.FriendlyName = &FriendlyName return params } @@ -267,14 +280,17 @@ func (params *UpdateCredentialAwsParams) SetFriendlyName(FriendlyName string) *U // Modify the properties of a given Account func (c *ApiService) UpdateCredentialAws(Sid string, params *UpdateCredentialAwsParams) (*AccountsV1CredentialAws, error) { path := "/v1/Credentials/AWS/{Sid}" - path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1) + 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) } + + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/accounts/v1/credentials_public_keys.go b/rest/accounts/v1/credentials_public_keys.go index 3a783bb78..90907da93 100644 --- a/rest/accounts/v1/credentials_public_keys.go +++ b/rest/accounts/v1/credentials_public_keys.go @@ -52,15 +52,16 @@ func (c *ApiService) CreateCredentialPublicKey(params *CreateCredentialPublicKey data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PublicKey != nil { - data.Set("PublicKey", *params.PublicKey) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.AccountSid != nil { - data.Set("AccountSid", *params.AccountSid) -} + + if params != nil && params.PublicKey != nil { + data.Set("PublicKey", *params.PublicKey) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.AccountSid != nil { + data.Set("AccountSid", *params.AccountSid) + } @@ -89,6 +90,7 @@ func (c *ApiService) DeleteCredentialPublicKey(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -109,6 +111,7 @@ func (c *ApiService) FetchCredentialPublicKey(Sid string, ) (*AccountsV1Credenti + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -148,9 +151,10 @@ func (c *ApiService) PageCredentialPublicKey(params *ListCredentialPublicKeyPara data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -280,9 +284,10 @@ func (c *ApiService) UpdateCredentialPublicKey(Sid string, params *UpdateCredent data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } diff --git a/rest/api/v2010/accounts.go b/rest/api/v2010/accounts.go index 4ee63a603..6d6879f20 100644 --- a/rest/api/v2010/accounts.go +++ b/rest/api/v2010/accounts.go @@ -40,9 +40,10 @@ func (c *ApiService) CreateAccount(params *CreateAccountParams) (*ApiV2010Accoun data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } @@ -71,6 +72,7 @@ func (c *ApiService) FetchAccount(Sid string, ) (*ApiV2010Account, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -122,15 +124,16 @@ func (c *ApiService) PageAccount(params *ListAccountParams, pageToken, pageNumbe 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) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -266,12 +269,13 @@ func (c *ApiService) UpdateAccount(Sid string, params *UpdateAccountParams) (*Ap 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) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } diff --git a/rest/api/v2010/accounts_addresses.go b/rest/api/v2010/accounts_addresses.go index 06d6c58b1..3b72f12bf 100644 --- a/rest/api/v2010/accounts_addresses.go +++ b/rest/api/v2010/accounts_addresses.go @@ -105,36 +105,37 @@ func (c *ApiService) CreateAddress(params *CreateAddressParams) (*ApiV2010Addres data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.CustomerName != nil { - data.Set("CustomerName", *params.CustomerName) -} -if params != nil && params.Street != nil { - data.Set("Street", *params.Street) -} -if params != nil && params.City != nil { - data.Set("City", *params.City) -} -if params != nil && params.Region != nil { - data.Set("Region", *params.Region) -} -if params != nil && params.PostalCode != nil { - data.Set("PostalCode", *params.PostalCode) -} -if params != nil && params.IsoCountry != nil { - data.Set("IsoCountry", *params.IsoCountry) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.EmergencyEnabled != nil { - data.Set("EmergencyEnabled", fmt.Sprint(*params.EmergencyEnabled)) -} -if params != nil && params.AutoCorrectAddress != nil { - data.Set("AutoCorrectAddress", fmt.Sprint(*params.AutoCorrectAddress)) -} -if params != nil && params.StreetSecondary != nil { - data.Set("StreetSecondary", *params.StreetSecondary) -} + + if params != nil && params.CustomerName != nil { + data.Set("CustomerName", *params.CustomerName) + } + if params != nil && params.Street != nil { + data.Set("Street", *params.Street) + } + if params != nil && params.City != nil { + data.Set("City", *params.City) + } + if params != nil && params.Region != nil { + data.Set("Region", *params.Region) + } + if params != nil && params.PostalCode != nil { + data.Set("PostalCode", *params.PostalCode) + } + if params != nil && params.IsoCountry != nil { + data.Set("IsoCountry", *params.IsoCountry) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.EmergencyEnabled != nil { + data.Set("EmergencyEnabled", fmt.Sprint(*params.EmergencyEnabled)) + } + if params != nil && params.AutoCorrectAddress != nil { + data.Set("AutoCorrectAddress", fmt.Sprint(*params.AutoCorrectAddress)) + } + if params != nil && params.StreetSecondary != nil { + data.Set("StreetSecondary", *params.StreetSecondary) + } @@ -179,6 +180,7 @@ func (c *ApiService) DeleteAddress(Sid string, params *DeleteAddressParams) (err + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -215,6 +217,7 @@ func (c *ApiService) FetchAddress(Sid string, params *FetchAddressParams) (*ApiV + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -283,18 +286,19 @@ func (c *ApiService) PageAddress(params *ListAddressParams, pageToken, pageNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.CustomerName != nil { - data.Set("CustomerName", *params.CustomerName) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.IsoCountry != nil { - data.Set("IsoCountry", *params.IsoCountry) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.CustomerName != nil { + data.Set("CustomerName", *params.CustomerName) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.IsoCountry != nil { + data.Set("IsoCountry", *params.IsoCountry) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -483,33 +487,34 @@ func (c *ApiService) UpdateAddress(Sid string, params *UpdateAddressParams) (*Ap data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.CustomerName != nil { - data.Set("CustomerName", *params.CustomerName) -} -if params != nil && params.Street != nil { - data.Set("Street", *params.Street) -} -if params != nil && params.City != nil { - data.Set("City", *params.City) -} -if params != nil && params.Region != nil { - data.Set("Region", *params.Region) -} -if params != nil && params.PostalCode != nil { - data.Set("PostalCode", *params.PostalCode) -} -if params != nil && params.EmergencyEnabled != nil { - data.Set("EmergencyEnabled", fmt.Sprint(*params.EmergencyEnabled)) -} -if params != nil && params.AutoCorrectAddress != nil { - data.Set("AutoCorrectAddress", fmt.Sprint(*params.AutoCorrectAddress)) -} -if params != nil && params.StreetSecondary != nil { - data.Set("StreetSecondary", *params.StreetSecondary) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.CustomerName != nil { + data.Set("CustomerName", *params.CustomerName) + } + if params != nil && params.Street != nil { + data.Set("Street", *params.Street) + } + if params != nil && params.City != nil { + data.Set("City", *params.City) + } + if params != nil && params.Region != nil { + data.Set("Region", *params.Region) + } + if params != nil && params.PostalCode != nil { + data.Set("PostalCode", *params.PostalCode) + } + if params != nil && params.EmergencyEnabled != nil { + data.Set("EmergencyEnabled", fmt.Sprint(*params.EmergencyEnabled)) + } + if params != nil && params.AutoCorrectAddress != nil { + data.Set("AutoCorrectAddress", fmt.Sprint(*params.AutoCorrectAddress)) + } + if params != nil && params.StreetSecondary != nil { + data.Set("StreetSecondary", *params.StreetSecondary) + } diff --git a/rest/api/v2010/accounts_addresses_dependent_phone_numbers.go b/rest/api/v2010/accounts_addresses_dependent_phone_numbers.go index b705ba64b..8af75bbd6 100644 --- a/rest/api/v2010/accounts_addresses_dependent_phone_numbers.go +++ b/rest/api/v2010/accounts_addresses_dependent_phone_numbers.go @@ -59,9 +59,10 @@ func (c *ApiService) PageDependentPhoneNumber(AddressSid string, params *ListDep data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_applications.go b/rest/api/v2010/accounts_applications.go index 3b606237b..3c2b7d0e0 100644 --- a/rest/api/v2010/accounts_applications.go +++ b/rest/api/v2010/accounts_applications.go @@ -141,54 +141,55 @@ 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) -} -if params != nil && params.VoiceUrl != nil { - data.Set("VoiceUrl", *params.VoiceUrl) -} -if params != nil && params.VoiceMethod != nil { - data.Set("VoiceMethod", *params.VoiceMethod) -} -if params != nil && params.VoiceFallbackUrl != nil { - data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) -} -if params != nil && params.VoiceFallbackMethod != nil { - data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.VoiceCallerIdLookup != nil { - data.Set("VoiceCallerIdLookup", fmt.Sprint(*params.VoiceCallerIdLookup)) -} -if params != nil && params.SmsUrl != nil { - data.Set("SmsUrl", *params.SmsUrl) -} -if params != nil && params.SmsMethod != nil { - data.Set("SmsMethod", *params.SmsMethod) -} -if params != nil && params.SmsFallbackUrl != nil { - data.Set("SmsFallbackUrl", *params.SmsFallbackUrl) -} -if params != nil && params.SmsFallbackMethod != nil { - data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) -} -if params != nil && params.SmsStatusCallback != nil { - data.Set("SmsStatusCallback", *params.SmsStatusCallback) -} -if params != nil && params.MessageStatusCallback != nil { - data.Set("MessageStatusCallback", *params.MessageStatusCallback) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.PublicApplicationConnectEnabled != nil { - data.Set("PublicApplicationConnectEnabled", fmt.Sprint(*params.PublicApplicationConnectEnabled)) -} + + if params != nil && params.ApiVersion != nil { + data.Set("ApiVersion", *params.ApiVersion) + } + if params != nil && params.VoiceUrl != nil { + data.Set("VoiceUrl", *params.VoiceUrl) + } + if params != nil && params.VoiceMethod != nil { + data.Set("VoiceMethod", *params.VoiceMethod) + } + if params != nil && params.VoiceFallbackUrl != nil { + data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) + } + if params != nil && params.VoiceFallbackMethod != nil { + data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.VoiceCallerIdLookup != nil { + data.Set("VoiceCallerIdLookup", fmt.Sprint(*params.VoiceCallerIdLookup)) + } + if params != nil && params.SmsUrl != nil { + data.Set("SmsUrl", *params.SmsUrl) + } + if params != nil && params.SmsMethod != nil { + data.Set("SmsMethod", *params.SmsMethod) + } + if params != nil && params.SmsFallbackUrl != nil { + data.Set("SmsFallbackUrl", *params.SmsFallbackUrl) + } + if params != nil && params.SmsFallbackMethod != nil { + data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) + } + if params != nil && params.SmsStatusCallback != nil { + data.Set("SmsStatusCallback", *params.SmsStatusCallback) + } + if params != nil && params.MessageStatusCallback != nil { + data.Set("MessageStatusCallback", *params.MessageStatusCallback) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.PublicApplicationConnectEnabled != nil { + data.Set("PublicApplicationConnectEnabled", fmt.Sprint(*params.PublicApplicationConnectEnabled)) + } @@ -233,6 +234,7 @@ func (c *ApiService) DeleteApplication(Sid string, params *DeleteApplicationPara + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -269,6 +271,7 @@ func (c *ApiService) FetchApplication(Sid string, params *FetchApplicationParams + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -325,12 +328,13 @@ func (c *ApiService) PageApplication(params *ListApplicationParams, pageToken, p 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)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -561,54 +565,55 @@ func (c *ApiService) UpdateApplication(Sid string, params *UpdateApplicationPara data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.ApiVersion != nil { - data.Set("ApiVersion", *params.ApiVersion) -} -if params != nil && params.VoiceUrl != nil { - data.Set("VoiceUrl", *params.VoiceUrl) -} -if params != nil && params.VoiceMethod != nil { - data.Set("VoiceMethod", *params.VoiceMethod) -} -if params != nil && params.VoiceFallbackUrl != nil { - data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) -} -if params != nil && params.VoiceFallbackMethod != nil { - data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.VoiceCallerIdLookup != nil { - data.Set("VoiceCallerIdLookup", fmt.Sprint(*params.VoiceCallerIdLookup)) -} -if params != nil && params.SmsUrl != nil { - data.Set("SmsUrl", *params.SmsUrl) -} -if params != nil && params.SmsMethod != nil { - data.Set("SmsMethod", *params.SmsMethod) -} -if params != nil && params.SmsFallbackUrl != nil { - data.Set("SmsFallbackUrl", *params.SmsFallbackUrl) -} -if params != nil && params.SmsFallbackMethod != nil { - data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) -} -if params != nil && params.SmsStatusCallback != nil { - data.Set("SmsStatusCallback", *params.SmsStatusCallback) -} -if params != nil && params.MessageStatusCallback != nil { - data.Set("MessageStatusCallback", *params.MessageStatusCallback) -} -if params != nil && params.PublicApplicationConnectEnabled != nil { - data.Set("PublicApplicationConnectEnabled", fmt.Sprint(*params.PublicApplicationConnectEnabled)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.ApiVersion != nil { + data.Set("ApiVersion", *params.ApiVersion) + } + if params != nil && params.VoiceUrl != nil { + data.Set("VoiceUrl", *params.VoiceUrl) + } + if params != nil && params.VoiceMethod != nil { + data.Set("VoiceMethod", *params.VoiceMethod) + } + if params != nil && params.VoiceFallbackUrl != nil { + data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) + } + if params != nil && params.VoiceFallbackMethod != nil { + data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.VoiceCallerIdLookup != nil { + data.Set("VoiceCallerIdLookup", fmt.Sprint(*params.VoiceCallerIdLookup)) + } + if params != nil && params.SmsUrl != nil { + data.Set("SmsUrl", *params.SmsUrl) + } + if params != nil && params.SmsMethod != nil { + data.Set("SmsMethod", *params.SmsMethod) + } + if params != nil && params.SmsFallbackUrl != nil { + data.Set("SmsFallbackUrl", *params.SmsFallbackUrl) + } + if params != nil && params.SmsFallbackMethod != nil { + data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) + } + if params != nil && params.SmsStatusCallback != nil { + data.Set("SmsStatusCallback", *params.SmsStatusCallback) + } + if params != nil && params.MessageStatusCallback != nil { + data.Set("MessageStatusCallback", *params.MessageStatusCallback) + } + if params != nil && params.PublicApplicationConnectEnabled != nil { + data.Set("PublicApplicationConnectEnabled", fmt.Sprint(*params.PublicApplicationConnectEnabled)) + } diff --git a/rest/api/v2010/accounts_authorized_connect_apps.go b/rest/api/v2010/accounts_authorized_connect_apps.go index e449f11c9..66aaaff3d 100644 --- a/rest/api/v2010/accounts_authorized_connect_apps.go +++ b/rest/api/v2010/accounts_authorized_connect_apps.go @@ -49,6 +49,7 @@ func (c *ApiService) FetchAuthorizedConnectApp(ConnectAppSid string, params *Fet + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -99,9 +100,10 @@ func (c *ApiService) PageAuthorizedConnectApp(params *ListAuthorizedConnectAppPa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_available_phone_numbers.go b/rest/api/v2010/accounts_available_phone_numbers.go index 5828ed475..509b1362d 100644 --- a/rest/api/v2010/accounts_available_phone_numbers.go +++ b/rest/api/v2010/accounts_available_phone_numbers.go @@ -49,6 +49,7 @@ func (c *ApiService) FetchAvailablePhoneNumberCountry(CountryCode string, params + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -99,9 +100,10 @@ func (c *ApiService) PageAvailablePhoneNumberCountry(params *ListAvailablePhoneN data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_available_phone_numbers_local.go b/rest/api/v2010/accounts_available_phone_numbers_local.go index 6065fee9e..861dbfdde 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_local.go +++ b/rest/api/v2010/accounts_available_phone_numbers_local.go @@ -167,63 +167,64 @@ func (c *ApiService) PageAvailablePhoneNumberLocal(CountryCode string, params *L data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.AreaCode != nil { - data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) -} -if params != nil && params.Contains != nil { - data.Set("Contains", *params.Contains) -} -if params != nil && params.SmsEnabled != nil { - data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) -} -if params != nil && params.MmsEnabled != nil { - data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) -} -if params != nil && params.VoiceEnabled != nil { - data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) -} -if params != nil && params.ExcludeAllAddressRequired != nil { - data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) -} -if params != nil && params.ExcludeLocalAddressRequired != nil { - data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) -} -if params != nil && params.ExcludeForeignAddressRequired != nil { - data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) -} -if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) -} -if params != nil && params.NearNumber != nil { - data.Set("NearNumber", *params.NearNumber) -} -if params != nil && params.NearLatLong != nil { - data.Set("NearLatLong", *params.NearLatLong) -} -if params != nil && params.Distance != nil { - data.Set("Distance", fmt.Sprint(*params.Distance)) -} -if params != nil && params.InPostalCode != nil { - data.Set("InPostalCode", *params.InPostalCode) -} -if params != nil && params.InRegion != nil { - data.Set("InRegion", *params.InRegion) -} -if params != nil && params.InRateCenter != nil { - data.Set("InRateCenter", *params.InRateCenter) -} -if params != nil && params.InLata != nil { - data.Set("InLata", *params.InLata) -} -if params != nil && params.InLocality != nil { - data.Set("InLocality", *params.InLocality) -} -if params != nil && params.FaxEnabled != nil { - data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.AreaCode != nil { + data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) + } + if params != nil && params.Contains != nil { + data.Set("Contains", *params.Contains) + } + if params != nil && params.SmsEnabled != nil { + data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) + } + if params != nil && params.MmsEnabled != nil { + data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) + } + if params != nil && params.VoiceEnabled != nil { + data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) + } + if params != nil && params.ExcludeAllAddressRequired != nil { + data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) + } + if params != nil && params.ExcludeLocalAddressRequired != nil { + data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) + } + if params != nil && params.ExcludeForeignAddressRequired != nil { + data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) + } + if params != nil && params.Beta != nil { + data.Set("Beta", fmt.Sprint(*params.Beta)) + } + if params != nil && params.NearNumber != nil { + data.Set("NearNumber", *params.NearNumber) + } + if params != nil && params.NearLatLong != nil { + data.Set("NearLatLong", *params.NearLatLong) + } + if params != nil && params.Distance != nil { + data.Set("Distance", fmt.Sprint(*params.Distance)) + } + if params != nil && params.InPostalCode != nil { + data.Set("InPostalCode", *params.InPostalCode) + } + if params != nil && params.InRegion != nil { + data.Set("InRegion", *params.InRegion) + } + if params != nil && params.InRateCenter != nil { + data.Set("InRateCenter", *params.InRateCenter) + } + if params != nil && params.InLata != nil { + data.Set("InLata", *params.InLata) + } + if params != nil && params.InLocality != nil { + data.Set("InLocality", *params.InLocality) + } + if params != nil && params.FaxEnabled != nil { + data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) 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 661199e33..e54413836 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 @@ -167,63 +167,64 @@ func (c *ApiService) PageAvailablePhoneNumberMachineToMachine(CountryCode string data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.AreaCode != nil { - data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) -} -if params != nil && params.Contains != nil { - data.Set("Contains", *params.Contains) -} -if params != nil && params.SmsEnabled != nil { - data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) -} -if params != nil && params.MmsEnabled != nil { - data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) -} -if params != nil && params.VoiceEnabled != nil { - data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) -} -if params != nil && params.ExcludeAllAddressRequired != nil { - data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) -} -if params != nil && params.ExcludeLocalAddressRequired != nil { - data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) -} -if params != nil && params.ExcludeForeignAddressRequired != nil { - data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) -} -if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) -} -if params != nil && params.NearNumber != nil { - data.Set("NearNumber", *params.NearNumber) -} -if params != nil && params.NearLatLong != nil { - data.Set("NearLatLong", *params.NearLatLong) -} -if params != nil && params.Distance != nil { - data.Set("Distance", fmt.Sprint(*params.Distance)) -} -if params != nil && params.InPostalCode != nil { - data.Set("InPostalCode", *params.InPostalCode) -} -if params != nil && params.InRegion != nil { - data.Set("InRegion", *params.InRegion) -} -if params != nil && params.InRateCenter != nil { - data.Set("InRateCenter", *params.InRateCenter) -} -if params != nil && params.InLata != nil { - data.Set("InLata", *params.InLata) -} -if params != nil && params.InLocality != nil { - data.Set("InLocality", *params.InLocality) -} -if params != nil && params.FaxEnabled != nil { - data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.AreaCode != nil { + data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) + } + if params != nil && params.Contains != nil { + data.Set("Contains", *params.Contains) + } + if params != nil && params.SmsEnabled != nil { + data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) + } + if params != nil && params.MmsEnabled != nil { + data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) + } + if params != nil && params.VoiceEnabled != nil { + data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) + } + if params != nil && params.ExcludeAllAddressRequired != nil { + data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) + } + if params != nil && params.ExcludeLocalAddressRequired != nil { + data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) + } + if params != nil && params.ExcludeForeignAddressRequired != nil { + data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) + } + if params != nil && params.Beta != nil { + data.Set("Beta", fmt.Sprint(*params.Beta)) + } + if params != nil && params.NearNumber != nil { + data.Set("NearNumber", *params.NearNumber) + } + if params != nil && params.NearLatLong != nil { + data.Set("NearLatLong", *params.NearLatLong) + } + if params != nil && params.Distance != nil { + data.Set("Distance", fmt.Sprint(*params.Distance)) + } + if params != nil && params.InPostalCode != nil { + data.Set("InPostalCode", *params.InPostalCode) + } + if params != nil && params.InRegion != nil { + data.Set("InRegion", *params.InRegion) + } + if params != nil && params.InRateCenter != nil { + data.Set("InRateCenter", *params.InRateCenter) + } + if params != nil && params.InLata != nil { + data.Set("InLata", *params.InLata) + } + if params != nil && params.InLocality != nil { + data.Set("InLocality", *params.InLocality) + } + if params != nil && params.FaxEnabled != nil { + data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_available_phone_numbers_mobile.go b/rest/api/v2010/accounts_available_phone_numbers_mobile.go index 7d999f671..861d37fb4 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_mobile.go +++ b/rest/api/v2010/accounts_available_phone_numbers_mobile.go @@ -167,63 +167,64 @@ func (c *ApiService) PageAvailablePhoneNumberMobile(CountryCode string, params * data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.AreaCode != nil { - data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) -} -if params != nil && params.Contains != nil { - data.Set("Contains", *params.Contains) -} -if params != nil && params.SmsEnabled != nil { - data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) -} -if params != nil && params.MmsEnabled != nil { - data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) -} -if params != nil && params.VoiceEnabled != nil { - data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) -} -if params != nil && params.ExcludeAllAddressRequired != nil { - data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) -} -if params != nil && params.ExcludeLocalAddressRequired != nil { - data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) -} -if params != nil && params.ExcludeForeignAddressRequired != nil { - data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) -} -if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) -} -if params != nil && params.NearNumber != nil { - data.Set("NearNumber", *params.NearNumber) -} -if params != nil && params.NearLatLong != nil { - data.Set("NearLatLong", *params.NearLatLong) -} -if params != nil && params.Distance != nil { - data.Set("Distance", fmt.Sprint(*params.Distance)) -} -if params != nil && params.InPostalCode != nil { - data.Set("InPostalCode", *params.InPostalCode) -} -if params != nil && params.InRegion != nil { - data.Set("InRegion", *params.InRegion) -} -if params != nil && params.InRateCenter != nil { - data.Set("InRateCenter", *params.InRateCenter) -} -if params != nil && params.InLata != nil { - data.Set("InLata", *params.InLata) -} -if params != nil && params.InLocality != nil { - data.Set("InLocality", *params.InLocality) -} -if params != nil && params.FaxEnabled != nil { - data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.AreaCode != nil { + data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) + } + if params != nil && params.Contains != nil { + data.Set("Contains", *params.Contains) + } + if params != nil && params.SmsEnabled != nil { + data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) + } + if params != nil && params.MmsEnabled != nil { + data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) + } + if params != nil && params.VoiceEnabled != nil { + data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) + } + if params != nil && params.ExcludeAllAddressRequired != nil { + data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) + } + if params != nil && params.ExcludeLocalAddressRequired != nil { + data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) + } + if params != nil && params.ExcludeForeignAddressRequired != nil { + data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) + } + if params != nil && params.Beta != nil { + data.Set("Beta", fmt.Sprint(*params.Beta)) + } + if params != nil && params.NearNumber != nil { + data.Set("NearNumber", *params.NearNumber) + } + if params != nil && params.NearLatLong != nil { + data.Set("NearLatLong", *params.NearLatLong) + } + if params != nil && params.Distance != nil { + data.Set("Distance", fmt.Sprint(*params.Distance)) + } + if params != nil && params.InPostalCode != nil { + data.Set("InPostalCode", *params.InPostalCode) + } + if params != nil && params.InRegion != nil { + data.Set("InRegion", *params.InRegion) + } + if params != nil && params.InRateCenter != nil { + data.Set("InRateCenter", *params.InRateCenter) + } + if params != nil && params.InLata != nil { + data.Set("InLata", *params.InLata) + } + if params != nil && params.InLocality != nil { + data.Set("InLocality", *params.InLocality) + } + if params != nil && params.FaxEnabled != nil { + data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_available_phone_numbers_national.go b/rest/api/v2010/accounts_available_phone_numbers_national.go index 0868f0bb1..43874e233 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_national.go +++ b/rest/api/v2010/accounts_available_phone_numbers_national.go @@ -167,63 +167,64 @@ func (c *ApiService) PageAvailablePhoneNumberNational(CountryCode string, params data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.AreaCode != nil { - data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) -} -if params != nil && params.Contains != nil { - data.Set("Contains", *params.Contains) -} -if params != nil && params.SmsEnabled != nil { - data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) -} -if params != nil && params.MmsEnabled != nil { - data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) -} -if params != nil && params.VoiceEnabled != nil { - data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) -} -if params != nil && params.ExcludeAllAddressRequired != nil { - data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) -} -if params != nil && params.ExcludeLocalAddressRequired != nil { - data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) -} -if params != nil && params.ExcludeForeignAddressRequired != nil { - data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) -} -if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) -} -if params != nil && params.NearNumber != nil { - data.Set("NearNumber", *params.NearNumber) -} -if params != nil && params.NearLatLong != nil { - data.Set("NearLatLong", *params.NearLatLong) -} -if params != nil && params.Distance != nil { - data.Set("Distance", fmt.Sprint(*params.Distance)) -} -if params != nil && params.InPostalCode != nil { - data.Set("InPostalCode", *params.InPostalCode) -} -if params != nil && params.InRegion != nil { - data.Set("InRegion", *params.InRegion) -} -if params != nil && params.InRateCenter != nil { - data.Set("InRateCenter", *params.InRateCenter) -} -if params != nil && params.InLata != nil { - data.Set("InLata", *params.InLata) -} -if params != nil && params.InLocality != nil { - data.Set("InLocality", *params.InLocality) -} -if params != nil && params.FaxEnabled != nil { - data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.AreaCode != nil { + data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) + } + if params != nil && params.Contains != nil { + data.Set("Contains", *params.Contains) + } + if params != nil && params.SmsEnabled != nil { + data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) + } + if params != nil && params.MmsEnabled != nil { + data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) + } + if params != nil && params.VoiceEnabled != nil { + data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) + } + if params != nil && params.ExcludeAllAddressRequired != nil { + data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) + } + if params != nil && params.ExcludeLocalAddressRequired != nil { + data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) + } + if params != nil && params.ExcludeForeignAddressRequired != nil { + data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) + } + if params != nil && params.Beta != nil { + data.Set("Beta", fmt.Sprint(*params.Beta)) + } + if params != nil && params.NearNumber != nil { + data.Set("NearNumber", *params.NearNumber) + } + if params != nil && params.NearLatLong != nil { + data.Set("NearLatLong", *params.NearLatLong) + } + if params != nil && params.Distance != nil { + data.Set("Distance", fmt.Sprint(*params.Distance)) + } + if params != nil && params.InPostalCode != nil { + data.Set("InPostalCode", *params.InPostalCode) + } + if params != nil && params.InRegion != nil { + data.Set("InRegion", *params.InRegion) + } + if params != nil && params.InRateCenter != nil { + data.Set("InRateCenter", *params.InRateCenter) + } + if params != nil && params.InLata != nil { + data.Set("InLata", *params.InLata) + } + if params != nil && params.InLocality != nil { + data.Set("InLocality", *params.InLocality) + } + if params != nil && params.FaxEnabled != nil { + data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) 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 354ea37bb..d06b83a49 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_shared_cost.go +++ b/rest/api/v2010/accounts_available_phone_numbers_shared_cost.go @@ -167,63 +167,64 @@ func (c *ApiService) PageAvailablePhoneNumberSharedCost(CountryCode string, para data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.AreaCode != nil { - data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) -} -if params != nil && params.Contains != nil { - data.Set("Contains", *params.Contains) -} -if params != nil && params.SmsEnabled != nil { - data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) -} -if params != nil && params.MmsEnabled != nil { - data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) -} -if params != nil && params.VoiceEnabled != nil { - data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) -} -if params != nil && params.ExcludeAllAddressRequired != nil { - data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) -} -if params != nil && params.ExcludeLocalAddressRequired != nil { - data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) -} -if params != nil && params.ExcludeForeignAddressRequired != nil { - data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) -} -if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) -} -if params != nil && params.NearNumber != nil { - data.Set("NearNumber", *params.NearNumber) -} -if params != nil && params.NearLatLong != nil { - data.Set("NearLatLong", *params.NearLatLong) -} -if params != nil && params.Distance != nil { - data.Set("Distance", fmt.Sprint(*params.Distance)) -} -if params != nil && params.InPostalCode != nil { - data.Set("InPostalCode", *params.InPostalCode) -} -if params != nil && params.InRegion != nil { - data.Set("InRegion", *params.InRegion) -} -if params != nil && params.InRateCenter != nil { - data.Set("InRateCenter", *params.InRateCenter) -} -if params != nil && params.InLata != nil { - data.Set("InLata", *params.InLata) -} -if params != nil && params.InLocality != nil { - data.Set("InLocality", *params.InLocality) -} -if params != nil && params.FaxEnabled != nil { - data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.AreaCode != nil { + data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) + } + if params != nil && params.Contains != nil { + data.Set("Contains", *params.Contains) + } + if params != nil && params.SmsEnabled != nil { + data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) + } + if params != nil && params.MmsEnabled != nil { + data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) + } + if params != nil && params.VoiceEnabled != nil { + data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) + } + if params != nil && params.ExcludeAllAddressRequired != nil { + data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) + } + if params != nil && params.ExcludeLocalAddressRequired != nil { + data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) + } + if params != nil && params.ExcludeForeignAddressRequired != nil { + data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) + } + if params != nil && params.Beta != nil { + data.Set("Beta", fmt.Sprint(*params.Beta)) + } + if params != nil && params.NearNumber != nil { + data.Set("NearNumber", *params.NearNumber) + } + if params != nil && params.NearLatLong != nil { + data.Set("NearLatLong", *params.NearLatLong) + } + if params != nil && params.Distance != nil { + data.Set("Distance", fmt.Sprint(*params.Distance)) + } + if params != nil && params.InPostalCode != nil { + data.Set("InPostalCode", *params.InPostalCode) + } + if params != nil && params.InRegion != nil { + data.Set("InRegion", *params.InRegion) + } + if params != nil && params.InRateCenter != nil { + data.Set("InRateCenter", *params.InRateCenter) + } + if params != nil && params.InLata != nil { + data.Set("InLata", *params.InLata) + } + if params != nil && params.InLocality != nil { + data.Set("InLocality", *params.InLocality) + } + if params != nil && params.FaxEnabled != nil { + data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) 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 21ef151f5..fd4f2222c 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_toll_free.go +++ b/rest/api/v2010/accounts_available_phone_numbers_toll_free.go @@ -167,63 +167,64 @@ func (c *ApiService) PageAvailablePhoneNumberTollFree(CountryCode string, params data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.AreaCode != nil { - data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) -} -if params != nil && params.Contains != nil { - data.Set("Contains", *params.Contains) -} -if params != nil && params.SmsEnabled != nil { - data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) -} -if params != nil && params.MmsEnabled != nil { - data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) -} -if params != nil && params.VoiceEnabled != nil { - data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) -} -if params != nil && params.ExcludeAllAddressRequired != nil { - data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) -} -if params != nil && params.ExcludeLocalAddressRequired != nil { - data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) -} -if params != nil && params.ExcludeForeignAddressRequired != nil { - data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) -} -if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) -} -if params != nil && params.NearNumber != nil { - data.Set("NearNumber", *params.NearNumber) -} -if params != nil && params.NearLatLong != nil { - data.Set("NearLatLong", *params.NearLatLong) -} -if params != nil && params.Distance != nil { - data.Set("Distance", fmt.Sprint(*params.Distance)) -} -if params != nil && params.InPostalCode != nil { - data.Set("InPostalCode", *params.InPostalCode) -} -if params != nil && params.InRegion != nil { - data.Set("InRegion", *params.InRegion) -} -if params != nil && params.InRateCenter != nil { - data.Set("InRateCenter", *params.InRateCenter) -} -if params != nil && params.InLata != nil { - data.Set("InLata", *params.InLata) -} -if params != nil && params.InLocality != nil { - data.Set("InLocality", *params.InLocality) -} -if params != nil && params.FaxEnabled != nil { - data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.AreaCode != nil { + data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) + } + if params != nil && params.Contains != nil { + data.Set("Contains", *params.Contains) + } + if params != nil && params.SmsEnabled != nil { + data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) + } + if params != nil && params.MmsEnabled != nil { + data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) + } + if params != nil && params.VoiceEnabled != nil { + data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) + } + if params != nil && params.ExcludeAllAddressRequired != nil { + data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) + } + if params != nil && params.ExcludeLocalAddressRequired != nil { + data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) + } + if params != nil && params.ExcludeForeignAddressRequired != nil { + data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) + } + if params != nil && params.Beta != nil { + data.Set("Beta", fmt.Sprint(*params.Beta)) + } + if params != nil && params.NearNumber != nil { + data.Set("NearNumber", *params.NearNumber) + } + if params != nil && params.NearLatLong != nil { + data.Set("NearLatLong", *params.NearLatLong) + } + if params != nil && params.Distance != nil { + data.Set("Distance", fmt.Sprint(*params.Distance)) + } + if params != nil && params.InPostalCode != nil { + data.Set("InPostalCode", *params.InPostalCode) + } + if params != nil && params.InRegion != nil { + data.Set("InRegion", *params.InRegion) + } + if params != nil && params.InRateCenter != nil { + data.Set("InRateCenter", *params.InRateCenter) + } + if params != nil && params.InLata != nil { + data.Set("InLata", *params.InLata) + } + if params != nil && params.InLocality != nil { + data.Set("InLocality", *params.InLocality) + } + if params != nil && params.FaxEnabled != nil { + data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_available_phone_numbers_voip.go b/rest/api/v2010/accounts_available_phone_numbers_voip.go index 7800d556e..2247967cf 100644 --- a/rest/api/v2010/accounts_available_phone_numbers_voip.go +++ b/rest/api/v2010/accounts_available_phone_numbers_voip.go @@ -167,63 +167,64 @@ func (c *ApiService) PageAvailablePhoneNumberVoip(CountryCode string, params *Li data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.AreaCode != nil { - data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) -} -if params != nil && params.Contains != nil { - data.Set("Contains", *params.Contains) -} -if params != nil && params.SmsEnabled != nil { - data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) -} -if params != nil && params.MmsEnabled != nil { - data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) -} -if params != nil && params.VoiceEnabled != nil { - data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) -} -if params != nil && params.ExcludeAllAddressRequired != nil { - data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) -} -if params != nil && params.ExcludeLocalAddressRequired != nil { - data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) -} -if params != nil && params.ExcludeForeignAddressRequired != nil { - data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) -} -if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) -} -if params != nil && params.NearNumber != nil { - data.Set("NearNumber", *params.NearNumber) -} -if params != nil && params.NearLatLong != nil { - data.Set("NearLatLong", *params.NearLatLong) -} -if params != nil && params.Distance != nil { - data.Set("Distance", fmt.Sprint(*params.Distance)) -} -if params != nil && params.InPostalCode != nil { - data.Set("InPostalCode", *params.InPostalCode) -} -if params != nil && params.InRegion != nil { - data.Set("InRegion", *params.InRegion) -} -if params != nil && params.InRateCenter != nil { - data.Set("InRateCenter", *params.InRateCenter) -} -if params != nil && params.InLata != nil { - data.Set("InLata", *params.InLata) -} -if params != nil && params.InLocality != nil { - data.Set("InLocality", *params.InLocality) -} -if params != nil && params.FaxEnabled != nil { - data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.AreaCode != nil { + data.Set("AreaCode", fmt.Sprint(*params.AreaCode)) + } + if params != nil && params.Contains != nil { + data.Set("Contains", *params.Contains) + } + if params != nil && params.SmsEnabled != nil { + data.Set("SmsEnabled", fmt.Sprint(*params.SmsEnabled)) + } + if params != nil && params.MmsEnabled != nil { + data.Set("MmsEnabled", fmt.Sprint(*params.MmsEnabled)) + } + if params != nil && params.VoiceEnabled != nil { + data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) + } + if params != nil && params.ExcludeAllAddressRequired != nil { + data.Set("ExcludeAllAddressRequired", fmt.Sprint(*params.ExcludeAllAddressRequired)) + } + if params != nil && params.ExcludeLocalAddressRequired != nil { + data.Set("ExcludeLocalAddressRequired", fmt.Sprint(*params.ExcludeLocalAddressRequired)) + } + if params != nil && params.ExcludeForeignAddressRequired != nil { + data.Set("ExcludeForeignAddressRequired", fmt.Sprint(*params.ExcludeForeignAddressRequired)) + } + if params != nil && params.Beta != nil { + data.Set("Beta", fmt.Sprint(*params.Beta)) + } + if params != nil && params.NearNumber != nil { + data.Set("NearNumber", *params.NearNumber) + } + if params != nil && params.NearLatLong != nil { + data.Set("NearLatLong", *params.NearLatLong) + } + if params != nil && params.Distance != nil { + data.Set("Distance", fmt.Sprint(*params.Distance)) + } + if params != nil && params.InPostalCode != nil { + data.Set("InPostalCode", *params.InPostalCode) + } + if params != nil && params.InRegion != nil { + data.Set("InRegion", *params.InRegion) + } + if params != nil && params.InRateCenter != nil { + data.Set("InRateCenter", *params.InRateCenter) + } + if params != nil && params.InLata != nil { + data.Set("InLata", *params.InLata) + } + if params != nil && params.InLocality != nil { + data.Set("InLocality", *params.InLocality) + } + if params != nil && params.FaxEnabled != nil { + data.Set("FaxEnabled", fmt.Sprint(*params.FaxEnabled)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_balance.go b/rest/api/v2010/accounts_balance.go index 029ed99a3..742b39d72 100644 --- a/rest/api/v2010/accounts_balance.go +++ b/rest/api/v2010/accounts_balance.go @@ -48,6 +48,7 @@ func (c *ApiService) FetchBalance(params *FetchBalanceParams) (*ApiV2010Balance, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/api/v2010/accounts_calls.go b/rest/api/v2010/accounts_calls.go index 9c671021b..ced786ed0 100644 --- a/rest/api/v2010/accounts_calls.go +++ b/rest/api/v2010/accounts_calls.go @@ -255,115 +255,116 @@ func (c *ApiService) CreateCall(params *CreateCallParams) (*ApiV2010Call, error) data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.To != nil { - data.Set("To", *params.To) -} -if params != nil && params.From != nil { - data.Set("From", *params.From) -} -if params != nil && params.Method != nil { - data.Set("Method", *params.Method) -} -if params != nil && params.FallbackUrl != nil { - data.Set("FallbackUrl", *params.FallbackUrl) -} -if params != nil && params.FallbackMethod != nil { - data.Set("FallbackMethod", *params.FallbackMethod) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackEvent != nil { - for _, item := range *params.StatusCallbackEvent { - data.Add("StatusCallbackEvent", item) + + if params != nil && params.To != nil { + data.Set("To", *params.To) } -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.SendDigits != nil { - data.Set("SendDigits", *params.SendDigits) -} -if params != nil && params.Timeout != nil { - data.Set("Timeout", fmt.Sprint(*params.Timeout)) -} -if params != nil && params.Record != nil { - data.Set("Record", fmt.Sprint(*params.Record)) -} -if params != nil && params.RecordingChannels != nil { - data.Set("RecordingChannels", *params.RecordingChannels) -} -if params != nil && params.RecordingStatusCallback != nil { - data.Set("RecordingStatusCallback", *params.RecordingStatusCallback) -} -if params != nil && params.RecordingStatusCallbackMethod != nil { - data.Set("RecordingStatusCallbackMethod", *params.RecordingStatusCallbackMethod) -} -if params != nil && params.SipAuthUsername != nil { - data.Set("SipAuthUsername", *params.SipAuthUsername) -} -if params != nil && params.SipAuthPassword != nil { - data.Set("SipAuthPassword", *params.SipAuthPassword) -} -if params != nil && params.MachineDetection != nil { - data.Set("MachineDetection", *params.MachineDetection) -} -if params != nil && params.MachineDetectionTimeout != nil { - data.Set("MachineDetectionTimeout", fmt.Sprint(*params.MachineDetectionTimeout)) -} -if params != nil && params.RecordingStatusCallbackEvent != nil { - for _, item := range *params.RecordingStatusCallbackEvent { - data.Add("RecordingStatusCallbackEvent", item) + if params != nil && params.From != nil { + data.Set("From", *params.From) + } + if params != nil && params.Method != nil { + data.Set("Method", *params.Method) + } + if params != nil && params.FallbackUrl != nil { + data.Set("FallbackUrl", *params.FallbackUrl) + } + if params != nil && params.FallbackMethod != nil { + data.Set("FallbackMethod", *params.FallbackMethod) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackEvent != nil { + for _, item := range *params.StatusCallbackEvent { + data.Add("StatusCallbackEvent", item) + } + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.SendDigits != nil { + data.Set("SendDigits", *params.SendDigits) + } + if params != nil && params.Timeout != nil { + data.Set("Timeout", fmt.Sprint(*params.Timeout)) + } + if params != nil && params.Record != nil { + data.Set("Record", fmt.Sprint(*params.Record)) + } + if params != nil && params.RecordingChannels != nil { + data.Set("RecordingChannels", *params.RecordingChannels) + } + if params != nil && params.RecordingStatusCallback != nil { + data.Set("RecordingStatusCallback", *params.RecordingStatusCallback) + } + if params != nil && params.RecordingStatusCallbackMethod != nil { + data.Set("RecordingStatusCallbackMethod", *params.RecordingStatusCallbackMethod) + } + if params != nil && params.SipAuthUsername != nil { + data.Set("SipAuthUsername", *params.SipAuthUsername) + } + if params != nil && params.SipAuthPassword != nil { + data.Set("SipAuthPassword", *params.SipAuthPassword) + } + if params != nil && params.MachineDetection != nil { + data.Set("MachineDetection", *params.MachineDetection) + } + if params != nil && params.MachineDetectionTimeout != nil { + data.Set("MachineDetectionTimeout", fmt.Sprint(*params.MachineDetectionTimeout)) + } + if params != nil && params.RecordingStatusCallbackEvent != nil { + for _, item := range *params.RecordingStatusCallbackEvent { + data.Add("RecordingStatusCallbackEvent", item) + } + } + if params != nil && params.Trim != nil { + data.Set("Trim", *params.Trim) + } + if params != nil && params.CallerId != nil { + data.Set("CallerId", *params.CallerId) + } + if params != nil && params.MachineDetectionSpeechThreshold != nil { + data.Set("MachineDetectionSpeechThreshold", fmt.Sprint(*params.MachineDetectionSpeechThreshold)) + } + if params != nil && params.MachineDetectionSpeechEndThreshold != nil { + data.Set("MachineDetectionSpeechEndThreshold", fmt.Sprint(*params.MachineDetectionSpeechEndThreshold)) + } + if params != nil && params.MachineDetectionSilenceTimeout != nil { + data.Set("MachineDetectionSilenceTimeout", fmt.Sprint(*params.MachineDetectionSilenceTimeout)) + } + if params != nil && params.AsyncAmd != nil { + data.Set("AsyncAmd", *params.AsyncAmd) + } + if params != nil && params.AsyncAmdStatusCallback != nil { + data.Set("AsyncAmdStatusCallback", *params.AsyncAmdStatusCallback) + } + if params != nil && params.AsyncAmdStatusCallbackMethod != nil { + data.Set("AsyncAmdStatusCallbackMethod", *params.AsyncAmdStatusCallbackMethod) + } + if params != nil && params.Byoc != nil { + data.Set("Byoc", *params.Byoc) + } + if params != nil && params.CallReason != nil { + data.Set("CallReason", *params.CallReason) + } + if params != nil && params.CallToken != nil { + data.Set("CallToken", *params.CallToken) + } + if params != nil && params.RecordingTrack != nil { + data.Set("RecordingTrack", *params.RecordingTrack) + } + if params != nil && params.TimeLimit != nil { + data.Set("TimeLimit", fmt.Sprint(*params.TimeLimit)) + } + if params != nil && params.Url != nil { + data.Set("Url", *params.Url) + } + if params != nil && params.Twiml != nil { + data.Set("Twiml", *params.Twiml) + } + if params != nil && params.ApplicationSid != nil { + data.Set("ApplicationSid", *params.ApplicationSid) } -} -if params != nil && params.Trim != nil { - data.Set("Trim", *params.Trim) -} -if params != nil && params.CallerId != nil { - data.Set("CallerId", *params.CallerId) -} -if params != nil && params.MachineDetectionSpeechThreshold != nil { - data.Set("MachineDetectionSpeechThreshold", fmt.Sprint(*params.MachineDetectionSpeechThreshold)) -} -if params != nil && params.MachineDetectionSpeechEndThreshold != nil { - data.Set("MachineDetectionSpeechEndThreshold", fmt.Sprint(*params.MachineDetectionSpeechEndThreshold)) -} -if params != nil && params.MachineDetectionSilenceTimeout != nil { - data.Set("MachineDetectionSilenceTimeout", fmt.Sprint(*params.MachineDetectionSilenceTimeout)) -} -if params != nil && params.AsyncAmd != nil { - data.Set("AsyncAmd", *params.AsyncAmd) -} -if params != nil && params.AsyncAmdStatusCallback != nil { - data.Set("AsyncAmdStatusCallback", *params.AsyncAmdStatusCallback) -} -if params != nil && params.AsyncAmdStatusCallbackMethod != nil { - data.Set("AsyncAmdStatusCallbackMethod", *params.AsyncAmdStatusCallbackMethod) -} -if params != nil && params.Byoc != nil { - data.Set("Byoc", *params.Byoc) -} -if params != nil && params.CallReason != nil { - data.Set("CallReason", *params.CallReason) -} -if params != nil && params.CallToken != nil { - data.Set("CallToken", *params.CallToken) -} -if params != nil && params.RecordingTrack != nil { - data.Set("RecordingTrack", *params.RecordingTrack) -} -if params != nil && params.TimeLimit != nil { - data.Set("TimeLimit", fmt.Sprint(*params.TimeLimit)) -} -if params != nil && params.Url != nil { - data.Set("Url", *params.Url) -} -if params != nil && params.Twiml != nil { - data.Set("Twiml", *params.Twiml) -} -if params != nil && params.ApplicationSid != nil { - data.Set("ApplicationSid", *params.ApplicationSid) -} @@ -408,6 +409,7 @@ func (c *ApiService) DeleteCall(Sid string, params *DeleteCallParams) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -444,6 +446,7 @@ func (c *ApiService) FetchCall(Sid string, params *FetchCallParams) (*ApiV2010Ca + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -530,27 +533,28 @@ func (c *ApiService) PageCall(params *ListCallParams, pageToken, pageNumber stri data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.To != nil { - data.Set("To", *params.To) -} -if params != nil && params.From != nil { - data.Set("From", *params.From) -} -if params != nil && params.ParentCallSid != nil { - data.Set("ParentCallSid", *params.ParentCallSid) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.StartTime != nil { - data.Set("StartTime", fmt.Sprint((*params.StartTime).Format(time.RFC3339))) -} -if params != nil && params.EndTime != nil { - data.Set("EndTime", fmt.Sprint((*params.EndTime).Format(time.RFC3339))) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.To != nil { + data.Set("To", *params.To) + } + if params != nil && params.From != nil { + data.Set("From", *params.From) + } + if params != nil && params.ParentCallSid != nil { + data.Set("ParentCallSid", *params.ParentCallSid) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.StartTime != nil { + data.Set("StartTime", fmt.Sprint((*params.StartTime).Format(time.RFC3339))) + } + if params != nil && params.EndTime != nil { + data.Set("EndTime", fmt.Sprint((*params.EndTime).Format(time.RFC3339))) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -739,33 +743,34 @@ func (c *ApiService) UpdateCall(Sid string, params *UpdateCallParams) (*ApiV2010 data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Url != nil { - data.Set("Url", *params.Url) -} -if params != nil && params.Method != nil { - data.Set("Method", *params.Method) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.FallbackUrl != nil { - data.Set("FallbackUrl", *params.FallbackUrl) -} -if params != nil && params.FallbackMethod != nil { - data.Set("FallbackMethod", *params.FallbackMethod) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.Twiml != nil { - data.Set("Twiml", *params.Twiml) -} -if params != nil && params.TimeLimit != nil { - data.Set("TimeLimit", fmt.Sprint(*params.TimeLimit)) -} + + if params != nil && params.Url != nil { + data.Set("Url", *params.Url) + } + if params != nil && params.Method != nil { + data.Set("Method", *params.Method) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.FallbackUrl != nil { + data.Set("FallbackUrl", *params.FallbackUrl) + } + if params != nil && params.FallbackMethod != nil { + data.Set("FallbackMethod", *params.FallbackMethod) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.Twiml != nil { + data.Set("Twiml", *params.Twiml) + } + if params != nil && params.TimeLimit != nil { + data.Set("TimeLimit", fmt.Sprint(*params.TimeLimit)) + } diff --git a/rest/api/v2010/accounts_calls_events.go b/rest/api/v2010/accounts_calls_events.go index 2e9d83cc5..3547168c4 100644 --- a/rest/api/v2010/accounts_calls_events.go +++ b/rest/api/v2010/accounts_calls_events.go @@ -59,9 +59,10 @@ func (c *ApiService) PageCallEvent(CallSid string, params *ListCallEventParams, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_calls_feedback.go b/rest/api/v2010/accounts_calls_feedback.go index d33464ab9..8cbad29cf 100644 --- a/rest/api/v2010/accounts_calls_feedback.go +++ b/rest/api/v2010/accounts_calls_feedback.go @@ -49,6 +49,7 @@ func (c *ApiService) FetchCallFeedback(CallSid string, params *FetchCallFeedback + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -99,14 +100,15 @@ func (c *ApiService) UpdateCallFeedback(CallSid string, params *UpdateCallFeedba data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.QualityScore != nil { - data.Set("QualityScore", fmt.Sprint(*params.QualityScore)) -} -if params != nil && params.Issue != nil { - for _, item := range *params.Issue { - data.Add("Issue", item) + + if params != nil && params.QualityScore != nil { + data.Set("QualityScore", fmt.Sprint(*params.QualityScore)) + } + if params != nil && params.Issue != nil { + for _, item := range *params.Issue { + data.Add("Issue", item) + } } -} diff --git a/rest/api/v2010/accounts_calls_feedback_summary.go b/rest/api/v2010/accounts_calls_feedback_summary.go index 6d5808db3..df28a0ace 100644 --- a/rest/api/v2010/accounts_calls_feedback_summary.go +++ b/rest/api/v2010/accounts_calls_feedback_summary.go @@ -75,21 +75,22 @@ func (c *ApiService) CreateCallFeedbackSummary(params *CreateCallFeedbackSummary data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) -} -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) -} -if params != nil && params.IncludeSubaccounts != nil { - data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} + + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint(*params.StartDate)) + } + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint(*params.EndDate)) + } + if params != nil && params.IncludeSubaccounts != nil { + data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } @@ -134,6 +135,7 @@ func (c *ApiService) DeleteCallFeedbackSummary(Sid string, params *DeleteCallFee + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -170,6 +172,7 @@ func (c *ApiService) FetchCallFeedbackSummary(Sid string, params *FetchCallFeedb + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/api/v2010/accounts_calls_notifications.go b/rest/api/v2010/accounts_calls_notifications.go index a1f697568..458969d37 100644 --- a/rest/api/v2010/accounts_calls_notifications.go +++ b/rest/api/v2010/accounts_calls_notifications.go @@ -50,6 +50,7 @@ func (c *ApiService) FetchCallNotification(CallSid string, Sid string, params *F + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -125,21 +126,22 @@ func (c *ApiService) PageCallNotification(CallSid string, params *ListCallNotifi data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Log != nil { - data.Set("Log", fmt.Sprint(*params.Log)) -} -if params != nil && params.MessageDate != nil { - data.Set("MessageDate", fmt.Sprint(*params.MessageDate)) -} -if params != nil && params.MessageDateBefore != nil { - data.Set("MessageDate<", fmt.Sprint(*params.MessageDateBefore)) -} -if params != nil && params.MessageDateAfter != nil { - data.Set("MessageDate>", fmt.Sprint(*params.MessageDateAfter)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Log != nil { + data.Set("Log", fmt.Sprint(*params.Log)) + } + if params != nil && params.MessageDate != nil { + data.Set("MessageDate", fmt.Sprint(*params.MessageDate)) + } + if params != nil && params.MessageDateBefore != nil { + data.Set("MessageDate<", fmt.Sprint(*params.MessageDateBefore)) + } + if params != nil && params.MessageDateAfter != nil { + data.Set("MessageDate>", fmt.Sprint(*params.MessageDateAfter)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_calls_payments.go b/rest/api/v2010/accounts_calls_payments.go index 3f44f7f26..9125de5ae 100644 --- a/rest/api/v2010/accounts_calls_payments.go +++ b/rest/api/v2010/accounts_calls_payments.go @@ -142,60 +142,61 @@ func (c *ApiService) CreatePayments(CallSid string, params *CreatePaymentsParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.IdempotencyKey != nil { - data.Set("IdempotencyKey", *params.IdempotencyKey) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.BankAccountType != nil { - data.Set("BankAccountType", *params.BankAccountType) -} -if params != nil && params.ChargeAmount != nil { - data.Set("ChargeAmount", fmt.Sprint(*params.ChargeAmount)) -} -if params != nil && params.Currency != nil { - data.Set("Currency", *params.Currency) -} -if params != nil && params.Description != nil { - data.Set("Description", *params.Description) -} -if params != nil && params.Input != nil { - data.Set("Input", *params.Input) -} -if params != nil && params.MinPostalCodeLength != nil { - data.Set("MinPostalCodeLength", fmt.Sprint(*params.MinPostalCodeLength)) -} -if params != nil && params.Parameter != nil { - v, err := json.Marshal(params.Parameter) - if err != nil { - return nil, err + if params != nil && params.IdempotencyKey != nil { + data.Set("IdempotencyKey", *params.IdempotencyKey) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) } + if params != nil && params.BankAccountType != nil { + data.Set("BankAccountType", *params.BankAccountType) + } + if params != nil && params.ChargeAmount != nil { + data.Set("ChargeAmount", fmt.Sprint(*params.ChargeAmount)) + } + if params != nil && params.Currency != nil { + data.Set("Currency", *params.Currency) + } + if params != nil && params.Description != nil { + data.Set("Description", *params.Description) + } + if params != nil && params.Input != nil { + data.Set("Input", *params.Input) + } + if params != nil && params.MinPostalCodeLength != nil { + data.Set("MinPostalCodeLength", fmt.Sprint(*params.MinPostalCodeLength)) + } + if params != nil && params.Parameter != nil { + v, err := json.Marshal(params.Parameter) - data.Set("Parameter", string(v)) -} -if params != nil && params.PaymentConnector != nil { - data.Set("PaymentConnector", *params.PaymentConnector) -} -if params != nil && params.PaymentMethod != nil { - data.Set("PaymentMethod", *params.PaymentMethod) -} -if params != nil && params.PostalCode != nil { - data.Set("PostalCode", fmt.Sprint(*params.PostalCode)) -} -if params != nil && params.SecurityCode != nil { - data.Set("SecurityCode", fmt.Sprint(*params.SecurityCode)) -} -if params != nil && params.Timeout != nil { - data.Set("Timeout", fmt.Sprint(*params.Timeout)) -} -if params != nil && params.TokenType != nil { - data.Set("TokenType", *params.TokenType) -} -if params != nil && params.ValidCardTypes != nil { - data.Set("ValidCardTypes", *params.ValidCardTypes) -} + if err != nil { + return nil, err + } + + data.Set("Parameter", string(v)) + } + if params != nil && params.PaymentConnector != nil { + data.Set("PaymentConnector", *params.PaymentConnector) + } + if params != nil && params.PaymentMethod != nil { + data.Set("PaymentMethod", *params.PaymentMethod) + } + if params != nil && params.PostalCode != nil { + data.Set("PostalCode", fmt.Sprint(*params.PostalCode)) + } + if params != nil && params.SecurityCode != nil { + data.Set("SecurityCode", fmt.Sprint(*params.SecurityCode)) + } + if params != nil && params.Timeout != nil { + data.Set("Timeout", fmt.Sprint(*params.Timeout)) + } + if params != nil && params.TokenType != nil { + data.Set("TokenType", *params.TokenType) + } + if params != nil && params.ValidCardTypes != nil { + data.Set("ValidCardTypes", *params.ValidCardTypes) + } @@ -262,18 +263,19 @@ func (c *ApiService) UpdatePayments(CallSid string, Sid string, params *UpdatePa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.IdempotencyKey != nil { - data.Set("IdempotencyKey", *params.IdempotencyKey) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.Capture != nil { - data.Set("Capture", *params.Capture) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} + + if params != nil && params.IdempotencyKey != nil { + data.Set("IdempotencyKey", *params.IdempotencyKey) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.Capture != nil { + data.Set("Capture", *params.Capture) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } diff --git a/rest/api/v2010/accounts_calls_recordings.go b/rest/api/v2010/accounts_calls_recordings.go index f780b252a..e79dedab5 100644 --- a/rest/api/v2010/accounts_calls_recordings.go +++ b/rest/api/v2010/accounts_calls_recordings.go @@ -82,26 +82,27 @@ func (c *ApiService) CreateCallRecording(CallSid string, params *CreateCallRecor data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.RecordingStatusCallbackEvent != nil { - for _, item := range *params.RecordingStatusCallbackEvent { - data.Add("RecordingStatusCallbackEvent", item) + + if params != nil && params.RecordingStatusCallbackEvent != nil { + for _, item := range *params.RecordingStatusCallbackEvent { + data.Add("RecordingStatusCallbackEvent", item) + } + } + if params != nil && params.RecordingStatusCallback != nil { + data.Set("RecordingStatusCallback", *params.RecordingStatusCallback) + } + if params != nil && params.RecordingStatusCallbackMethod != nil { + data.Set("RecordingStatusCallbackMethod", *params.RecordingStatusCallbackMethod) + } + if params != nil && params.Trim != nil { + data.Set("Trim", *params.Trim) + } + if params != nil && params.RecordingChannels != nil { + data.Set("RecordingChannels", *params.RecordingChannels) + } + if params != nil && params.RecordingTrack != nil { + data.Set("RecordingTrack", *params.RecordingTrack) } -} -if params != nil && params.RecordingStatusCallback != nil { - data.Set("RecordingStatusCallback", *params.RecordingStatusCallback) -} -if params != nil && params.RecordingStatusCallbackMethod != nil { - data.Set("RecordingStatusCallbackMethod", *params.RecordingStatusCallbackMethod) -} -if params != nil && params.Trim != nil { - data.Set("Trim", *params.Trim) -} -if params != nil && params.RecordingChannels != nil { - data.Set("RecordingChannels", *params.RecordingChannels) -} -if params != nil && params.RecordingTrack != nil { - data.Set("RecordingTrack", *params.RecordingTrack) -} @@ -147,6 +148,7 @@ func (c *ApiService) DeleteCallRecording(CallSid string, Sid string, params *Del + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -184,6 +186,7 @@ func (c *ApiService) FetchCallRecording(CallSid string, Sid string, params *Fetc + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -253,18 +256,19 @@ func (c *ApiService) PageCallRecording(CallSid string, params *ListCallRecording data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint(*params.DateCreated)) -} -if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreated<", fmt.Sprint(*params.DateCreatedBefore)) -} -if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreated>", fmt.Sprint(*params.DateCreatedAfter)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint(*params.DateCreated)) + } + if params != nil && params.DateCreatedBefore != nil { + data.Set("DateCreated<", fmt.Sprint(*params.DateCreatedBefore)) + } + if params != nil && params.DateCreatedAfter != nil { + data.Set("DateCreated>", fmt.Sprint(*params.DateCreatedAfter)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -412,12 +416,13 @@ func (c *ApiService) UpdateCallRecording(CallSid string, Sid string, params *Upd data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.PauseBehavior != nil { - data.Set("PauseBehavior", *params.PauseBehavior) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.PauseBehavior != nil { + data.Set("PauseBehavior", *params.PauseBehavior) + } diff --git a/rest/api/v2010/accounts_calls_siprec.go b/rest/api/v2010/accounts_calls_siprec.go index 5dacb2b93..6eaced5e2 100644 --- a/rest/api/v2010/accounts_calls_siprec.go +++ b/rest/api/v2010/accounts_calls_siprec.go @@ -1264,615 +1264,616 @@ func (c *ApiService) CreateSiprec(CallSid string, params *CreateSiprecParams) (* data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Name != nil { - data.Set("Name", *params.Name) -} -if params != nil && params.ConnectorName != nil { - data.Set("ConnectorName", *params.ConnectorName) -} -if params != nil && params.Track != nil { - data.Set("Track", *params.Track) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.Parameter1Name != nil { - data.Set("Parameter1.Name", *params.Parameter1Name) -} -if params != nil && params.Parameter1Value != nil { - data.Set("Parameter1.Value", *params.Parameter1Value) -} -if params != nil && params.Parameter2Name != nil { - data.Set("Parameter2.Name", *params.Parameter2Name) -} -if params != nil && params.Parameter2Value != nil { - data.Set("Parameter2.Value", *params.Parameter2Value) -} -if params != nil && params.Parameter3Name != nil { - data.Set("Parameter3.Name", *params.Parameter3Name) -} -if params != nil && params.Parameter3Value != nil { - data.Set("Parameter3.Value", *params.Parameter3Value) -} -if params != nil && params.Parameter4Name != nil { - data.Set("Parameter4.Name", *params.Parameter4Name) -} -if params != nil && params.Parameter4Value != nil { - data.Set("Parameter4.Value", *params.Parameter4Value) -} -if params != nil && params.Parameter5Name != nil { - data.Set("Parameter5.Name", *params.Parameter5Name) -} -if params != nil && params.Parameter5Value != nil { - data.Set("Parameter5.Value", *params.Parameter5Value) -} -if params != nil && params.Parameter6Name != nil { - data.Set("Parameter6.Name", *params.Parameter6Name) -} -if params != nil && params.Parameter6Value != nil { - data.Set("Parameter6.Value", *params.Parameter6Value) -} -if params != nil && params.Parameter7Name != nil { - data.Set("Parameter7.Name", *params.Parameter7Name) -} -if params != nil && params.Parameter7Value != nil { - data.Set("Parameter7.Value", *params.Parameter7Value) -} -if params != nil && params.Parameter8Name != nil { - data.Set("Parameter8.Name", *params.Parameter8Name) -} -if params != nil && params.Parameter8Value != nil { - data.Set("Parameter8.Value", *params.Parameter8Value) -} -if params != nil && params.Parameter9Name != nil { - data.Set("Parameter9.Name", *params.Parameter9Name) -} -if params != nil && params.Parameter9Value != nil { - data.Set("Parameter9.Value", *params.Parameter9Value) -} -if params != nil && params.Parameter10Name != nil { - data.Set("Parameter10.Name", *params.Parameter10Name) -} -if params != nil && params.Parameter10Value != nil { - data.Set("Parameter10.Value", *params.Parameter10Value) -} -if params != nil && params.Parameter11Name != nil { - data.Set("Parameter11.Name", *params.Parameter11Name) -} -if params != nil && params.Parameter11Value != nil { - data.Set("Parameter11.Value", *params.Parameter11Value) -} -if params != nil && params.Parameter12Name != nil { - data.Set("Parameter12.Name", *params.Parameter12Name) -} -if params != nil && params.Parameter12Value != nil { - data.Set("Parameter12.Value", *params.Parameter12Value) -} -if params != nil && params.Parameter13Name != nil { - data.Set("Parameter13.Name", *params.Parameter13Name) -} -if params != nil && params.Parameter13Value != nil { - data.Set("Parameter13.Value", *params.Parameter13Value) -} -if params != nil && params.Parameter14Name != nil { - data.Set("Parameter14.Name", *params.Parameter14Name) -} -if params != nil && params.Parameter14Value != nil { - data.Set("Parameter14.Value", *params.Parameter14Value) -} -if params != nil && params.Parameter15Name != nil { - data.Set("Parameter15.Name", *params.Parameter15Name) -} -if params != nil && params.Parameter15Value != nil { - data.Set("Parameter15.Value", *params.Parameter15Value) -} -if params != nil && params.Parameter16Name != nil { - data.Set("Parameter16.Name", *params.Parameter16Name) -} -if params != nil && params.Parameter16Value != nil { - data.Set("Parameter16.Value", *params.Parameter16Value) -} -if params != nil && params.Parameter17Name != nil { - data.Set("Parameter17.Name", *params.Parameter17Name) -} -if params != nil && params.Parameter17Value != nil { - data.Set("Parameter17.Value", *params.Parameter17Value) -} -if params != nil && params.Parameter18Name != nil { - data.Set("Parameter18.Name", *params.Parameter18Name) -} -if params != nil && params.Parameter18Value != nil { - data.Set("Parameter18.Value", *params.Parameter18Value) -} -if params != nil && params.Parameter19Name != nil { - data.Set("Parameter19.Name", *params.Parameter19Name) -} -if params != nil && params.Parameter19Value != nil { - data.Set("Parameter19.Value", *params.Parameter19Value) -} -if params != nil && params.Parameter20Name != nil { - data.Set("Parameter20.Name", *params.Parameter20Name) -} -if params != nil && params.Parameter20Value != nil { - data.Set("Parameter20.Value", *params.Parameter20Value) -} -if params != nil && params.Parameter21Name != nil { - data.Set("Parameter21.Name", *params.Parameter21Name) -} -if params != nil && params.Parameter21Value != nil { - data.Set("Parameter21.Value", *params.Parameter21Value) -} -if params != nil && params.Parameter22Name != nil { - data.Set("Parameter22.Name", *params.Parameter22Name) -} -if params != nil && params.Parameter22Value != nil { - data.Set("Parameter22.Value", *params.Parameter22Value) -} -if params != nil && params.Parameter23Name != nil { - data.Set("Parameter23.Name", *params.Parameter23Name) -} -if params != nil && params.Parameter23Value != nil { - data.Set("Parameter23.Value", *params.Parameter23Value) -} -if params != nil && params.Parameter24Name != nil { - data.Set("Parameter24.Name", *params.Parameter24Name) -} -if params != nil && params.Parameter24Value != nil { - data.Set("Parameter24.Value", *params.Parameter24Value) -} -if params != nil && params.Parameter25Name != nil { - data.Set("Parameter25.Name", *params.Parameter25Name) -} -if params != nil && params.Parameter25Value != nil { - data.Set("Parameter25.Value", *params.Parameter25Value) -} -if params != nil && params.Parameter26Name != nil { - data.Set("Parameter26.Name", *params.Parameter26Name) -} -if params != nil && params.Parameter26Value != nil { - data.Set("Parameter26.Value", *params.Parameter26Value) -} -if params != nil && params.Parameter27Name != nil { - data.Set("Parameter27.Name", *params.Parameter27Name) -} -if params != nil && params.Parameter27Value != nil { - data.Set("Parameter27.Value", *params.Parameter27Value) -} -if params != nil && params.Parameter28Name != nil { - data.Set("Parameter28.Name", *params.Parameter28Name) -} -if params != nil && params.Parameter28Value != nil { - data.Set("Parameter28.Value", *params.Parameter28Value) -} -if params != nil && params.Parameter29Name != nil { - data.Set("Parameter29.Name", *params.Parameter29Name) -} -if params != nil && params.Parameter29Value != nil { - data.Set("Parameter29.Value", *params.Parameter29Value) -} -if params != nil && params.Parameter30Name != nil { - data.Set("Parameter30.Name", *params.Parameter30Name) -} -if params != nil && params.Parameter30Value != nil { - data.Set("Parameter30.Value", *params.Parameter30Value) -} -if params != nil && params.Parameter31Name != nil { - data.Set("Parameter31.Name", *params.Parameter31Name) -} -if params != nil && params.Parameter31Value != nil { - data.Set("Parameter31.Value", *params.Parameter31Value) -} -if params != nil && params.Parameter32Name != nil { - data.Set("Parameter32.Name", *params.Parameter32Name) -} -if params != nil && params.Parameter32Value != nil { - data.Set("Parameter32.Value", *params.Parameter32Value) -} -if params != nil && params.Parameter33Name != nil { - data.Set("Parameter33.Name", *params.Parameter33Name) -} -if params != nil && params.Parameter33Value != nil { - data.Set("Parameter33.Value", *params.Parameter33Value) -} -if params != nil && params.Parameter34Name != nil { - data.Set("Parameter34.Name", *params.Parameter34Name) -} -if params != nil && params.Parameter34Value != nil { - data.Set("Parameter34.Value", *params.Parameter34Value) -} -if params != nil && params.Parameter35Name != nil { - data.Set("Parameter35.Name", *params.Parameter35Name) -} -if params != nil && params.Parameter35Value != nil { - data.Set("Parameter35.Value", *params.Parameter35Value) -} -if params != nil && params.Parameter36Name != nil { - data.Set("Parameter36.Name", *params.Parameter36Name) -} -if params != nil && params.Parameter36Value != nil { - data.Set("Parameter36.Value", *params.Parameter36Value) -} -if params != nil && params.Parameter37Name != nil { - data.Set("Parameter37.Name", *params.Parameter37Name) -} -if params != nil && params.Parameter37Value != nil { - data.Set("Parameter37.Value", *params.Parameter37Value) -} -if params != nil && params.Parameter38Name != nil { - data.Set("Parameter38.Name", *params.Parameter38Name) -} -if params != nil && params.Parameter38Value != nil { - data.Set("Parameter38.Value", *params.Parameter38Value) -} -if params != nil && params.Parameter39Name != nil { - data.Set("Parameter39.Name", *params.Parameter39Name) -} -if params != nil && params.Parameter39Value != nil { - data.Set("Parameter39.Value", *params.Parameter39Value) -} -if params != nil && params.Parameter40Name != nil { - data.Set("Parameter40.Name", *params.Parameter40Name) -} -if params != nil && params.Parameter40Value != nil { - data.Set("Parameter40.Value", *params.Parameter40Value) -} -if params != nil && params.Parameter41Name != nil { - data.Set("Parameter41.Name", *params.Parameter41Name) -} -if params != nil && params.Parameter41Value != nil { - data.Set("Parameter41.Value", *params.Parameter41Value) -} -if params != nil && params.Parameter42Name != nil { - data.Set("Parameter42.Name", *params.Parameter42Name) -} -if params != nil && params.Parameter42Value != nil { - data.Set("Parameter42.Value", *params.Parameter42Value) -} -if params != nil && params.Parameter43Name != nil { - data.Set("Parameter43.Name", *params.Parameter43Name) -} -if params != nil && params.Parameter43Value != nil { - data.Set("Parameter43.Value", *params.Parameter43Value) -} -if params != nil && params.Parameter44Name != nil { - data.Set("Parameter44.Name", *params.Parameter44Name) -} -if params != nil && params.Parameter44Value != nil { - data.Set("Parameter44.Value", *params.Parameter44Value) -} -if params != nil && params.Parameter45Name != nil { - data.Set("Parameter45.Name", *params.Parameter45Name) -} -if params != nil && params.Parameter45Value != nil { - data.Set("Parameter45.Value", *params.Parameter45Value) -} -if params != nil && params.Parameter46Name != nil { - data.Set("Parameter46.Name", *params.Parameter46Name) -} -if params != nil && params.Parameter46Value != nil { - data.Set("Parameter46.Value", *params.Parameter46Value) -} -if params != nil && params.Parameter47Name != nil { - data.Set("Parameter47.Name", *params.Parameter47Name) -} -if params != nil && params.Parameter47Value != nil { - data.Set("Parameter47.Value", *params.Parameter47Value) -} -if params != nil && params.Parameter48Name != nil { - data.Set("Parameter48.Name", *params.Parameter48Name) -} -if params != nil && params.Parameter48Value != nil { - data.Set("Parameter48.Value", *params.Parameter48Value) -} -if params != nil && params.Parameter49Name != nil { - data.Set("Parameter49.Name", *params.Parameter49Name) -} -if params != nil && params.Parameter49Value != nil { - data.Set("Parameter49.Value", *params.Parameter49Value) -} -if params != nil && params.Parameter50Name != nil { - data.Set("Parameter50.Name", *params.Parameter50Name) -} -if params != nil && params.Parameter50Value != nil { - data.Set("Parameter50.Value", *params.Parameter50Value) -} -if params != nil && params.Parameter51Name != nil { - data.Set("Parameter51.Name", *params.Parameter51Name) -} -if params != nil && params.Parameter51Value != nil { - data.Set("Parameter51.Value", *params.Parameter51Value) -} -if params != nil && params.Parameter52Name != nil { - data.Set("Parameter52.Name", *params.Parameter52Name) -} -if params != nil && params.Parameter52Value != nil { - data.Set("Parameter52.Value", *params.Parameter52Value) -} -if params != nil && params.Parameter53Name != nil { - data.Set("Parameter53.Name", *params.Parameter53Name) -} -if params != nil && params.Parameter53Value != nil { - data.Set("Parameter53.Value", *params.Parameter53Value) -} -if params != nil && params.Parameter54Name != nil { - data.Set("Parameter54.Name", *params.Parameter54Name) -} -if params != nil && params.Parameter54Value != nil { - data.Set("Parameter54.Value", *params.Parameter54Value) -} -if params != nil && params.Parameter55Name != nil { - data.Set("Parameter55.Name", *params.Parameter55Name) -} -if params != nil && params.Parameter55Value != nil { - data.Set("Parameter55.Value", *params.Parameter55Value) -} -if params != nil && params.Parameter56Name != nil { - data.Set("Parameter56.Name", *params.Parameter56Name) -} -if params != nil && params.Parameter56Value != nil { - data.Set("Parameter56.Value", *params.Parameter56Value) -} -if params != nil && params.Parameter57Name != nil { - data.Set("Parameter57.Name", *params.Parameter57Name) -} -if params != nil && params.Parameter57Value != nil { - data.Set("Parameter57.Value", *params.Parameter57Value) -} -if params != nil && params.Parameter58Name != nil { - data.Set("Parameter58.Name", *params.Parameter58Name) -} -if params != nil && params.Parameter58Value != nil { - data.Set("Parameter58.Value", *params.Parameter58Value) -} -if params != nil && params.Parameter59Name != nil { - data.Set("Parameter59.Name", *params.Parameter59Name) -} -if params != nil && params.Parameter59Value != nil { - data.Set("Parameter59.Value", *params.Parameter59Value) -} -if params != nil && params.Parameter60Name != nil { - data.Set("Parameter60.Name", *params.Parameter60Name) -} -if params != nil && params.Parameter60Value != nil { - data.Set("Parameter60.Value", *params.Parameter60Value) -} -if params != nil && params.Parameter61Name != nil { - data.Set("Parameter61.Name", *params.Parameter61Name) -} -if params != nil && params.Parameter61Value != nil { - data.Set("Parameter61.Value", *params.Parameter61Value) -} -if params != nil && params.Parameter62Name != nil { - data.Set("Parameter62.Name", *params.Parameter62Name) -} -if params != nil && params.Parameter62Value != nil { - data.Set("Parameter62.Value", *params.Parameter62Value) -} -if params != nil && params.Parameter63Name != nil { - data.Set("Parameter63.Name", *params.Parameter63Name) -} -if params != nil && params.Parameter63Value != nil { - data.Set("Parameter63.Value", *params.Parameter63Value) -} -if params != nil && params.Parameter64Name != nil { - data.Set("Parameter64.Name", *params.Parameter64Name) -} -if params != nil && params.Parameter64Value != nil { - data.Set("Parameter64.Value", *params.Parameter64Value) -} -if params != nil && params.Parameter65Name != nil { - data.Set("Parameter65.Name", *params.Parameter65Name) -} -if params != nil && params.Parameter65Value != nil { - data.Set("Parameter65.Value", *params.Parameter65Value) -} -if params != nil && params.Parameter66Name != nil { - data.Set("Parameter66.Name", *params.Parameter66Name) -} -if params != nil && params.Parameter66Value != nil { - data.Set("Parameter66.Value", *params.Parameter66Value) -} -if params != nil && params.Parameter67Name != nil { - data.Set("Parameter67.Name", *params.Parameter67Name) -} -if params != nil && params.Parameter67Value != nil { - data.Set("Parameter67.Value", *params.Parameter67Value) -} -if params != nil && params.Parameter68Name != nil { - data.Set("Parameter68.Name", *params.Parameter68Name) -} -if params != nil && params.Parameter68Value != nil { - data.Set("Parameter68.Value", *params.Parameter68Value) -} -if params != nil && params.Parameter69Name != nil { - data.Set("Parameter69.Name", *params.Parameter69Name) -} -if params != nil && params.Parameter69Value != nil { - data.Set("Parameter69.Value", *params.Parameter69Value) -} -if params != nil && params.Parameter70Name != nil { - data.Set("Parameter70.Name", *params.Parameter70Name) -} -if params != nil && params.Parameter70Value != nil { - data.Set("Parameter70.Value", *params.Parameter70Value) -} -if params != nil && params.Parameter71Name != nil { - data.Set("Parameter71.Name", *params.Parameter71Name) -} -if params != nil && params.Parameter71Value != nil { - data.Set("Parameter71.Value", *params.Parameter71Value) -} -if params != nil && params.Parameter72Name != nil { - data.Set("Parameter72.Name", *params.Parameter72Name) -} -if params != nil && params.Parameter72Value != nil { - data.Set("Parameter72.Value", *params.Parameter72Value) -} -if params != nil && params.Parameter73Name != nil { - data.Set("Parameter73.Name", *params.Parameter73Name) -} -if params != nil && params.Parameter73Value != nil { - data.Set("Parameter73.Value", *params.Parameter73Value) -} -if params != nil && params.Parameter74Name != nil { - data.Set("Parameter74.Name", *params.Parameter74Name) -} -if params != nil && params.Parameter74Value != nil { - data.Set("Parameter74.Value", *params.Parameter74Value) -} -if params != nil && params.Parameter75Name != nil { - data.Set("Parameter75.Name", *params.Parameter75Name) -} -if params != nil && params.Parameter75Value != nil { - data.Set("Parameter75.Value", *params.Parameter75Value) -} -if params != nil && params.Parameter76Name != nil { - data.Set("Parameter76.Name", *params.Parameter76Name) -} -if params != nil && params.Parameter76Value != nil { - data.Set("Parameter76.Value", *params.Parameter76Value) -} -if params != nil && params.Parameter77Name != nil { - data.Set("Parameter77.Name", *params.Parameter77Name) -} -if params != nil && params.Parameter77Value != nil { - data.Set("Parameter77.Value", *params.Parameter77Value) -} -if params != nil && params.Parameter78Name != nil { - data.Set("Parameter78.Name", *params.Parameter78Name) -} -if params != nil && params.Parameter78Value != nil { - data.Set("Parameter78.Value", *params.Parameter78Value) -} -if params != nil && params.Parameter79Name != nil { - data.Set("Parameter79.Name", *params.Parameter79Name) -} -if params != nil && params.Parameter79Value != nil { - data.Set("Parameter79.Value", *params.Parameter79Value) -} -if params != nil && params.Parameter80Name != nil { - data.Set("Parameter80.Name", *params.Parameter80Name) -} -if params != nil && params.Parameter80Value != nil { - data.Set("Parameter80.Value", *params.Parameter80Value) -} -if params != nil && params.Parameter81Name != nil { - data.Set("Parameter81.Name", *params.Parameter81Name) -} -if params != nil && params.Parameter81Value != nil { - data.Set("Parameter81.Value", *params.Parameter81Value) -} -if params != nil && params.Parameter82Name != nil { - data.Set("Parameter82.Name", *params.Parameter82Name) -} -if params != nil && params.Parameter82Value != nil { - data.Set("Parameter82.Value", *params.Parameter82Value) -} -if params != nil && params.Parameter83Name != nil { - data.Set("Parameter83.Name", *params.Parameter83Name) -} -if params != nil && params.Parameter83Value != nil { - data.Set("Parameter83.Value", *params.Parameter83Value) -} -if params != nil && params.Parameter84Name != nil { - data.Set("Parameter84.Name", *params.Parameter84Name) -} -if params != nil && params.Parameter84Value != nil { - data.Set("Parameter84.Value", *params.Parameter84Value) -} -if params != nil && params.Parameter85Name != nil { - data.Set("Parameter85.Name", *params.Parameter85Name) -} -if params != nil && params.Parameter85Value != nil { - data.Set("Parameter85.Value", *params.Parameter85Value) -} -if params != nil && params.Parameter86Name != nil { - data.Set("Parameter86.Name", *params.Parameter86Name) -} -if params != nil && params.Parameter86Value != nil { - data.Set("Parameter86.Value", *params.Parameter86Value) -} -if params != nil && params.Parameter87Name != nil { - data.Set("Parameter87.Name", *params.Parameter87Name) -} -if params != nil && params.Parameter87Value != nil { - data.Set("Parameter87.Value", *params.Parameter87Value) -} -if params != nil && params.Parameter88Name != nil { - data.Set("Parameter88.Name", *params.Parameter88Name) -} -if params != nil && params.Parameter88Value != nil { - data.Set("Parameter88.Value", *params.Parameter88Value) -} -if params != nil && params.Parameter89Name != nil { - data.Set("Parameter89.Name", *params.Parameter89Name) -} -if params != nil && params.Parameter89Value != nil { - data.Set("Parameter89.Value", *params.Parameter89Value) -} -if params != nil && params.Parameter90Name != nil { - data.Set("Parameter90.Name", *params.Parameter90Name) -} -if params != nil && params.Parameter90Value != nil { - data.Set("Parameter90.Value", *params.Parameter90Value) -} -if params != nil && params.Parameter91Name != nil { - data.Set("Parameter91.Name", *params.Parameter91Name) -} -if params != nil && params.Parameter91Value != nil { - data.Set("Parameter91.Value", *params.Parameter91Value) -} -if params != nil && params.Parameter92Name != nil { - data.Set("Parameter92.Name", *params.Parameter92Name) -} -if params != nil && params.Parameter92Value != nil { - data.Set("Parameter92.Value", *params.Parameter92Value) -} -if params != nil && params.Parameter93Name != nil { - data.Set("Parameter93.Name", *params.Parameter93Name) -} -if params != nil && params.Parameter93Value != nil { - data.Set("Parameter93.Value", *params.Parameter93Value) -} -if params != nil && params.Parameter94Name != nil { - data.Set("Parameter94.Name", *params.Parameter94Name) -} -if params != nil && params.Parameter94Value != nil { - data.Set("Parameter94.Value", *params.Parameter94Value) -} -if params != nil && params.Parameter95Name != nil { - data.Set("Parameter95.Name", *params.Parameter95Name) -} -if params != nil && params.Parameter95Value != nil { - data.Set("Parameter95.Value", *params.Parameter95Value) -} -if params != nil && params.Parameter96Name != nil { - data.Set("Parameter96.Name", *params.Parameter96Name) -} -if params != nil && params.Parameter96Value != nil { - data.Set("Parameter96.Value", *params.Parameter96Value) -} -if params != nil && params.Parameter97Name != nil { - data.Set("Parameter97.Name", *params.Parameter97Name) -} -if params != nil && params.Parameter97Value != nil { - data.Set("Parameter97.Value", *params.Parameter97Value) -} -if params != nil && params.Parameter98Name != nil { - data.Set("Parameter98.Name", *params.Parameter98Name) -} -if params != nil && params.Parameter98Value != nil { - data.Set("Parameter98.Value", *params.Parameter98Value) -} -if params != nil && params.Parameter99Name != nil { - data.Set("Parameter99.Name", *params.Parameter99Name) -} -if params != nil && params.Parameter99Value != nil { - data.Set("Parameter99.Value", *params.Parameter99Value) -} + + if params != nil && params.Name != nil { + data.Set("Name", *params.Name) + } + if params != nil && params.ConnectorName != nil { + data.Set("ConnectorName", *params.ConnectorName) + } + if params != nil && params.Track != nil { + data.Set("Track", *params.Track) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.Parameter1Name != nil { + data.Set("Parameter1.Name", *params.Parameter1Name) + } + if params != nil && params.Parameter1Value != nil { + data.Set("Parameter1.Value", *params.Parameter1Value) + } + if params != nil && params.Parameter2Name != nil { + data.Set("Parameter2.Name", *params.Parameter2Name) + } + if params != nil && params.Parameter2Value != nil { + data.Set("Parameter2.Value", *params.Parameter2Value) + } + if params != nil && params.Parameter3Name != nil { + data.Set("Parameter3.Name", *params.Parameter3Name) + } + if params != nil && params.Parameter3Value != nil { + data.Set("Parameter3.Value", *params.Parameter3Value) + } + if params != nil && params.Parameter4Name != nil { + data.Set("Parameter4.Name", *params.Parameter4Name) + } + if params != nil && params.Parameter4Value != nil { + data.Set("Parameter4.Value", *params.Parameter4Value) + } + if params != nil && params.Parameter5Name != nil { + data.Set("Parameter5.Name", *params.Parameter5Name) + } + if params != nil && params.Parameter5Value != nil { + data.Set("Parameter5.Value", *params.Parameter5Value) + } + if params != nil && params.Parameter6Name != nil { + data.Set("Parameter6.Name", *params.Parameter6Name) + } + if params != nil && params.Parameter6Value != nil { + data.Set("Parameter6.Value", *params.Parameter6Value) + } + if params != nil && params.Parameter7Name != nil { + data.Set("Parameter7.Name", *params.Parameter7Name) + } + if params != nil && params.Parameter7Value != nil { + data.Set("Parameter7.Value", *params.Parameter7Value) + } + if params != nil && params.Parameter8Name != nil { + data.Set("Parameter8.Name", *params.Parameter8Name) + } + if params != nil && params.Parameter8Value != nil { + data.Set("Parameter8.Value", *params.Parameter8Value) + } + if params != nil && params.Parameter9Name != nil { + data.Set("Parameter9.Name", *params.Parameter9Name) + } + if params != nil && params.Parameter9Value != nil { + data.Set("Parameter9.Value", *params.Parameter9Value) + } + if params != nil && params.Parameter10Name != nil { + data.Set("Parameter10.Name", *params.Parameter10Name) + } + if params != nil && params.Parameter10Value != nil { + data.Set("Parameter10.Value", *params.Parameter10Value) + } + if params != nil && params.Parameter11Name != nil { + data.Set("Parameter11.Name", *params.Parameter11Name) + } + if params != nil && params.Parameter11Value != nil { + data.Set("Parameter11.Value", *params.Parameter11Value) + } + if params != nil && params.Parameter12Name != nil { + data.Set("Parameter12.Name", *params.Parameter12Name) + } + if params != nil && params.Parameter12Value != nil { + data.Set("Parameter12.Value", *params.Parameter12Value) + } + if params != nil && params.Parameter13Name != nil { + data.Set("Parameter13.Name", *params.Parameter13Name) + } + if params != nil && params.Parameter13Value != nil { + data.Set("Parameter13.Value", *params.Parameter13Value) + } + if params != nil && params.Parameter14Name != nil { + data.Set("Parameter14.Name", *params.Parameter14Name) + } + if params != nil && params.Parameter14Value != nil { + data.Set("Parameter14.Value", *params.Parameter14Value) + } + if params != nil && params.Parameter15Name != nil { + data.Set("Parameter15.Name", *params.Parameter15Name) + } + if params != nil && params.Parameter15Value != nil { + data.Set("Parameter15.Value", *params.Parameter15Value) + } + if params != nil && params.Parameter16Name != nil { + data.Set("Parameter16.Name", *params.Parameter16Name) + } + if params != nil && params.Parameter16Value != nil { + data.Set("Parameter16.Value", *params.Parameter16Value) + } + if params != nil && params.Parameter17Name != nil { + data.Set("Parameter17.Name", *params.Parameter17Name) + } + if params != nil && params.Parameter17Value != nil { + data.Set("Parameter17.Value", *params.Parameter17Value) + } + if params != nil && params.Parameter18Name != nil { + data.Set("Parameter18.Name", *params.Parameter18Name) + } + if params != nil && params.Parameter18Value != nil { + data.Set("Parameter18.Value", *params.Parameter18Value) + } + if params != nil && params.Parameter19Name != nil { + data.Set("Parameter19.Name", *params.Parameter19Name) + } + if params != nil && params.Parameter19Value != nil { + data.Set("Parameter19.Value", *params.Parameter19Value) + } + if params != nil && params.Parameter20Name != nil { + data.Set("Parameter20.Name", *params.Parameter20Name) + } + if params != nil && params.Parameter20Value != nil { + data.Set("Parameter20.Value", *params.Parameter20Value) + } + if params != nil && params.Parameter21Name != nil { + data.Set("Parameter21.Name", *params.Parameter21Name) + } + if params != nil && params.Parameter21Value != nil { + data.Set("Parameter21.Value", *params.Parameter21Value) + } + if params != nil && params.Parameter22Name != nil { + data.Set("Parameter22.Name", *params.Parameter22Name) + } + if params != nil && params.Parameter22Value != nil { + data.Set("Parameter22.Value", *params.Parameter22Value) + } + if params != nil && params.Parameter23Name != nil { + data.Set("Parameter23.Name", *params.Parameter23Name) + } + if params != nil && params.Parameter23Value != nil { + data.Set("Parameter23.Value", *params.Parameter23Value) + } + if params != nil && params.Parameter24Name != nil { + data.Set("Parameter24.Name", *params.Parameter24Name) + } + if params != nil && params.Parameter24Value != nil { + data.Set("Parameter24.Value", *params.Parameter24Value) + } + if params != nil && params.Parameter25Name != nil { + data.Set("Parameter25.Name", *params.Parameter25Name) + } + if params != nil && params.Parameter25Value != nil { + data.Set("Parameter25.Value", *params.Parameter25Value) + } + if params != nil && params.Parameter26Name != nil { + data.Set("Parameter26.Name", *params.Parameter26Name) + } + if params != nil && params.Parameter26Value != nil { + data.Set("Parameter26.Value", *params.Parameter26Value) + } + if params != nil && params.Parameter27Name != nil { + data.Set("Parameter27.Name", *params.Parameter27Name) + } + if params != nil && params.Parameter27Value != nil { + data.Set("Parameter27.Value", *params.Parameter27Value) + } + if params != nil && params.Parameter28Name != nil { + data.Set("Parameter28.Name", *params.Parameter28Name) + } + if params != nil && params.Parameter28Value != nil { + data.Set("Parameter28.Value", *params.Parameter28Value) + } + if params != nil && params.Parameter29Name != nil { + data.Set("Parameter29.Name", *params.Parameter29Name) + } + if params != nil && params.Parameter29Value != nil { + data.Set("Parameter29.Value", *params.Parameter29Value) + } + if params != nil && params.Parameter30Name != nil { + data.Set("Parameter30.Name", *params.Parameter30Name) + } + if params != nil && params.Parameter30Value != nil { + data.Set("Parameter30.Value", *params.Parameter30Value) + } + if params != nil && params.Parameter31Name != nil { + data.Set("Parameter31.Name", *params.Parameter31Name) + } + if params != nil && params.Parameter31Value != nil { + data.Set("Parameter31.Value", *params.Parameter31Value) + } + if params != nil && params.Parameter32Name != nil { + data.Set("Parameter32.Name", *params.Parameter32Name) + } + if params != nil && params.Parameter32Value != nil { + data.Set("Parameter32.Value", *params.Parameter32Value) + } + if params != nil && params.Parameter33Name != nil { + data.Set("Parameter33.Name", *params.Parameter33Name) + } + if params != nil && params.Parameter33Value != nil { + data.Set("Parameter33.Value", *params.Parameter33Value) + } + if params != nil && params.Parameter34Name != nil { + data.Set("Parameter34.Name", *params.Parameter34Name) + } + if params != nil && params.Parameter34Value != nil { + data.Set("Parameter34.Value", *params.Parameter34Value) + } + if params != nil && params.Parameter35Name != nil { + data.Set("Parameter35.Name", *params.Parameter35Name) + } + if params != nil && params.Parameter35Value != nil { + data.Set("Parameter35.Value", *params.Parameter35Value) + } + if params != nil && params.Parameter36Name != nil { + data.Set("Parameter36.Name", *params.Parameter36Name) + } + if params != nil && params.Parameter36Value != nil { + data.Set("Parameter36.Value", *params.Parameter36Value) + } + if params != nil && params.Parameter37Name != nil { + data.Set("Parameter37.Name", *params.Parameter37Name) + } + if params != nil && params.Parameter37Value != nil { + data.Set("Parameter37.Value", *params.Parameter37Value) + } + if params != nil && params.Parameter38Name != nil { + data.Set("Parameter38.Name", *params.Parameter38Name) + } + if params != nil && params.Parameter38Value != nil { + data.Set("Parameter38.Value", *params.Parameter38Value) + } + if params != nil && params.Parameter39Name != nil { + data.Set("Parameter39.Name", *params.Parameter39Name) + } + if params != nil && params.Parameter39Value != nil { + data.Set("Parameter39.Value", *params.Parameter39Value) + } + if params != nil && params.Parameter40Name != nil { + data.Set("Parameter40.Name", *params.Parameter40Name) + } + if params != nil && params.Parameter40Value != nil { + data.Set("Parameter40.Value", *params.Parameter40Value) + } + if params != nil && params.Parameter41Name != nil { + data.Set("Parameter41.Name", *params.Parameter41Name) + } + if params != nil && params.Parameter41Value != nil { + data.Set("Parameter41.Value", *params.Parameter41Value) + } + if params != nil && params.Parameter42Name != nil { + data.Set("Parameter42.Name", *params.Parameter42Name) + } + if params != nil && params.Parameter42Value != nil { + data.Set("Parameter42.Value", *params.Parameter42Value) + } + if params != nil && params.Parameter43Name != nil { + data.Set("Parameter43.Name", *params.Parameter43Name) + } + if params != nil && params.Parameter43Value != nil { + data.Set("Parameter43.Value", *params.Parameter43Value) + } + if params != nil && params.Parameter44Name != nil { + data.Set("Parameter44.Name", *params.Parameter44Name) + } + if params != nil && params.Parameter44Value != nil { + data.Set("Parameter44.Value", *params.Parameter44Value) + } + if params != nil && params.Parameter45Name != nil { + data.Set("Parameter45.Name", *params.Parameter45Name) + } + if params != nil && params.Parameter45Value != nil { + data.Set("Parameter45.Value", *params.Parameter45Value) + } + if params != nil && params.Parameter46Name != nil { + data.Set("Parameter46.Name", *params.Parameter46Name) + } + if params != nil && params.Parameter46Value != nil { + data.Set("Parameter46.Value", *params.Parameter46Value) + } + if params != nil && params.Parameter47Name != nil { + data.Set("Parameter47.Name", *params.Parameter47Name) + } + if params != nil && params.Parameter47Value != nil { + data.Set("Parameter47.Value", *params.Parameter47Value) + } + if params != nil && params.Parameter48Name != nil { + data.Set("Parameter48.Name", *params.Parameter48Name) + } + if params != nil && params.Parameter48Value != nil { + data.Set("Parameter48.Value", *params.Parameter48Value) + } + if params != nil && params.Parameter49Name != nil { + data.Set("Parameter49.Name", *params.Parameter49Name) + } + if params != nil && params.Parameter49Value != nil { + data.Set("Parameter49.Value", *params.Parameter49Value) + } + if params != nil && params.Parameter50Name != nil { + data.Set("Parameter50.Name", *params.Parameter50Name) + } + if params != nil && params.Parameter50Value != nil { + data.Set("Parameter50.Value", *params.Parameter50Value) + } + if params != nil && params.Parameter51Name != nil { + data.Set("Parameter51.Name", *params.Parameter51Name) + } + if params != nil && params.Parameter51Value != nil { + data.Set("Parameter51.Value", *params.Parameter51Value) + } + if params != nil && params.Parameter52Name != nil { + data.Set("Parameter52.Name", *params.Parameter52Name) + } + if params != nil && params.Parameter52Value != nil { + data.Set("Parameter52.Value", *params.Parameter52Value) + } + if params != nil && params.Parameter53Name != nil { + data.Set("Parameter53.Name", *params.Parameter53Name) + } + if params != nil && params.Parameter53Value != nil { + data.Set("Parameter53.Value", *params.Parameter53Value) + } + if params != nil && params.Parameter54Name != nil { + data.Set("Parameter54.Name", *params.Parameter54Name) + } + if params != nil && params.Parameter54Value != nil { + data.Set("Parameter54.Value", *params.Parameter54Value) + } + if params != nil && params.Parameter55Name != nil { + data.Set("Parameter55.Name", *params.Parameter55Name) + } + if params != nil && params.Parameter55Value != nil { + data.Set("Parameter55.Value", *params.Parameter55Value) + } + if params != nil && params.Parameter56Name != nil { + data.Set("Parameter56.Name", *params.Parameter56Name) + } + if params != nil && params.Parameter56Value != nil { + data.Set("Parameter56.Value", *params.Parameter56Value) + } + if params != nil && params.Parameter57Name != nil { + data.Set("Parameter57.Name", *params.Parameter57Name) + } + if params != nil && params.Parameter57Value != nil { + data.Set("Parameter57.Value", *params.Parameter57Value) + } + if params != nil && params.Parameter58Name != nil { + data.Set("Parameter58.Name", *params.Parameter58Name) + } + if params != nil && params.Parameter58Value != nil { + data.Set("Parameter58.Value", *params.Parameter58Value) + } + if params != nil && params.Parameter59Name != nil { + data.Set("Parameter59.Name", *params.Parameter59Name) + } + if params != nil && params.Parameter59Value != nil { + data.Set("Parameter59.Value", *params.Parameter59Value) + } + if params != nil && params.Parameter60Name != nil { + data.Set("Parameter60.Name", *params.Parameter60Name) + } + if params != nil && params.Parameter60Value != nil { + data.Set("Parameter60.Value", *params.Parameter60Value) + } + if params != nil && params.Parameter61Name != nil { + data.Set("Parameter61.Name", *params.Parameter61Name) + } + if params != nil && params.Parameter61Value != nil { + data.Set("Parameter61.Value", *params.Parameter61Value) + } + if params != nil && params.Parameter62Name != nil { + data.Set("Parameter62.Name", *params.Parameter62Name) + } + if params != nil && params.Parameter62Value != nil { + data.Set("Parameter62.Value", *params.Parameter62Value) + } + if params != nil && params.Parameter63Name != nil { + data.Set("Parameter63.Name", *params.Parameter63Name) + } + if params != nil && params.Parameter63Value != nil { + data.Set("Parameter63.Value", *params.Parameter63Value) + } + if params != nil && params.Parameter64Name != nil { + data.Set("Parameter64.Name", *params.Parameter64Name) + } + if params != nil && params.Parameter64Value != nil { + data.Set("Parameter64.Value", *params.Parameter64Value) + } + if params != nil && params.Parameter65Name != nil { + data.Set("Parameter65.Name", *params.Parameter65Name) + } + if params != nil && params.Parameter65Value != nil { + data.Set("Parameter65.Value", *params.Parameter65Value) + } + if params != nil && params.Parameter66Name != nil { + data.Set("Parameter66.Name", *params.Parameter66Name) + } + if params != nil && params.Parameter66Value != nil { + data.Set("Parameter66.Value", *params.Parameter66Value) + } + if params != nil && params.Parameter67Name != nil { + data.Set("Parameter67.Name", *params.Parameter67Name) + } + if params != nil && params.Parameter67Value != nil { + data.Set("Parameter67.Value", *params.Parameter67Value) + } + if params != nil && params.Parameter68Name != nil { + data.Set("Parameter68.Name", *params.Parameter68Name) + } + if params != nil && params.Parameter68Value != nil { + data.Set("Parameter68.Value", *params.Parameter68Value) + } + if params != nil && params.Parameter69Name != nil { + data.Set("Parameter69.Name", *params.Parameter69Name) + } + if params != nil && params.Parameter69Value != nil { + data.Set("Parameter69.Value", *params.Parameter69Value) + } + if params != nil && params.Parameter70Name != nil { + data.Set("Parameter70.Name", *params.Parameter70Name) + } + if params != nil && params.Parameter70Value != nil { + data.Set("Parameter70.Value", *params.Parameter70Value) + } + if params != nil && params.Parameter71Name != nil { + data.Set("Parameter71.Name", *params.Parameter71Name) + } + if params != nil && params.Parameter71Value != nil { + data.Set("Parameter71.Value", *params.Parameter71Value) + } + if params != nil && params.Parameter72Name != nil { + data.Set("Parameter72.Name", *params.Parameter72Name) + } + if params != nil && params.Parameter72Value != nil { + data.Set("Parameter72.Value", *params.Parameter72Value) + } + if params != nil && params.Parameter73Name != nil { + data.Set("Parameter73.Name", *params.Parameter73Name) + } + if params != nil && params.Parameter73Value != nil { + data.Set("Parameter73.Value", *params.Parameter73Value) + } + if params != nil && params.Parameter74Name != nil { + data.Set("Parameter74.Name", *params.Parameter74Name) + } + if params != nil && params.Parameter74Value != nil { + data.Set("Parameter74.Value", *params.Parameter74Value) + } + if params != nil && params.Parameter75Name != nil { + data.Set("Parameter75.Name", *params.Parameter75Name) + } + if params != nil && params.Parameter75Value != nil { + data.Set("Parameter75.Value", *params.Parameter75Value) + } + if params != nil && params.Parameter76Name != nil { + data.Set("Parameter76.Name", *params.Parameter76Name) + } + if params != nil && params.Parameter76Value != nil { + data.Set("Parameter76.Value", *params.Parameter76Value) + } + if params != nil && params.Parameter77Name != nil { + data.Set("Parameter77.Name", *params.Parameter77Name) + } + if params != nil && params.Parameter77Value != nil { + data.Set("Parameter77.Value", *params.Parameter77Value) + } + if params != nil && params.Parameter78Name != nil { + data.Set("Parameter78.Name", *params.Parameter78Name) + } + if params != nil && params.Parameter78Value != nil { + data.Set("Parameter78.Value", *params.Parameter78Value) + } + if params != nil && params.Parameter79Name != nil { + data.Set("Parameter79.Name", *params.Parameter79Name) + } + if params != nil && params.Parameter79Value != nil { + data.Set("Parameter79.Value", *params.Parameter79Value) + } + if params != nil && params.Parameter80Name != nil { + data.Set("Parameter80.Name", *params.Parameter80Name) + } + if params != nil && params.Parameter80Value != nil { + data.Set("Parameter80.Value", *params.Parameter80Value) + } + if params != nil && params.Parameter81Name != nil { + data.Set("Parameter81.Name", *params.Parameter81Name) + } + if params != nil && params.Parameter81Value != nil { + data.Set("Parameter81.Value", *params.Parameter81Value) + } + if params != nil && params.Parameter82Name != nil { + data.Set("Parameter82.Name", *params.Parameter82Name) + } + if params != nil && params.Parameter82Value != nil { + data.Set("Parameter82.Value", *params.Parameter82Value) + } + if params != nil && params.Parameter83Name != nil { + data.Set("Parameter83.Name", *params.Parameter83Name) + } + if params != nil && params.Parameter83Value != nil { + data.Set("Parameter83.Value", *params.Parameter83Value) + } + if params != nil && params.Parameter84Name != nil { + data.Set("Parameter84.Name", *params.Parameter84Name) + } + if params != nil && params.Parameter84Value != nil { + data.Set("Parameter84.Value", *params.Parameter84Value) + } + if params != nil && params.Parameter85Name != nil { + data.Set("Parameter85.Name", *params.Parameter85Name) + } + if params != nil && params.Parameter85Value != nil { + data.Set("Parameter85.Value", *params.Parameter85Value) + } + if params != nil && params.Parameter86Name != nil { + data.Set("Parameter86.Name", *params.Parameter86Name) + } + if params != nil && params.Parameter86Value != nil { + data.Set("Parameter86.Value", *params.Parameter86Value) + } + if params != nil && params.Parameter87Name != nil { + data.Set("Parameter87.Name", *params.Parameter87Name) + } + if params != nil && params.Parameter87Value != nil { + data.Set("Parameter87.Value", *params.Parameter87Value) + } + if params != nil && params.Parameter88Name != nil { + data.Set("Parameter88.Name", *params.Parameter88Name) + } + if params != nil && params.Parameter88Value != nil { + data.Set("Parameter88.Value", *params.Parameter88Value) + } + if params != nil && params.Parameter89Name != nil { + data.Set("Parameter89.Name", *params.Parameter89Name) + } + if params != nil && params.Parameter89Value != nil { + data.Set("Parameter89.Value", *params.Parameter89Value) + } + if params != nil && params.Parameter90Name != nil { + data.Set("Parameter90.Name", *params.Parameter90Name) + } + if params != nil && params.Parameter90Value != nil { + data.Set("Parameter90.Value", *params.Parameter90Value) + } + if params != nil && params.Parameter91Name != nil { + data.Set("Parameter91.Name", *params.Parameter91Name) + } + if params != nil && params.Parameter91Value != nil { + data.Set("Parameter91.Value", *params.Parameter91Value) + } + if params != nil && params.Parameter92Name != nil { + data.Set("Parameter92.Name", *params.Parameter92Name) + } + if params != nil && params.Parameter92Value != nil { + data.Set("Parameter92.Value", *params.Parameter92Value) + } + if params != nil && params.Parameter93Name != nil { + data.Set("Parameter93.Name", *params.Parameter93Name) + } + if params != nil && params.Parameter93Value != nil { + data.Set("Parameter93.Value", *params.Parameter93Value) + } + if params != nil && params.Parameter94Name != nil { + data.Set("Parameter94.Name", *params.Parameter94Name) + } + if params != nil && params.Parameter94Value != nil { + data.Set("Parameter94.Value", *params.Parameter94Value) + } + if params != nil && params.Parameter95Name != nil { + data.Set("Parameter95.Name", *params.Parameter95Name) + } + if params != nil && params.Parameter95Value != nil { + data.Set("Parameter95.Value", *params.Parameter95Value) + } + if params != nil && params.Parameter96Name != nil { + data.Set("Parameter96.Name", *params.Parameter96Name) + } + if params != nil && params.Parameter96Value != nil { + data.Set("Parameter96.Value", *params.Parameter96Value) + } + if params != nil && params.Parameter97Name != nil { + data.Set("Parameter97.Name", *params.Parameter97Name) + } + if params != nil && params.Parameter97Value != nil { + data.Set("Parameter97.Value", *params.Parameter97Value) + } + if params != nil && params.Parameter98Name != nil { + data.Set("Parameter98.Name", *params.Parameter98Name) + } + if params != nil && params.Parameter98Value != nil { + data.Set("Parameter98.Value", *params.Parameter98Value) + } + if params != nil && params.Parameter99Name != nil { + data.Set("Parameter99.Name", *params.Parameter99Name) + } + if params != nil && params.Parameter99Value != nil { + data.Set("Parameter99.Value", *params.Parameter99Value) + } @@ -1921,9 +1922,10 @@ func (c *ApiService) UpdateSiprec(CallSid string, Sid string, params *UpdateSipr data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } diff --git a/rest/api/v2010/accounts_calls_streams.go b/rest/api/v2010/accounts_calls_streams.go index f92069815..2c3e98576 100644 --- a/rest/api/v2010/accounts_calls_streams.go +++ b/rest/api/v2010/accounts_calls_streams.go @@ -1264,615 +1264,616 @@ func (c *ApiService) CreateStream(CallSid string, params *CreateStreamParams) (* data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Url != nil { - data.Set("Url", *params.Url) -} -if params != nil && params.Name != nil { - data.Set("Name", *params.Name) -} -if params != nil && params.Track != nil { - data.Set("Track", *params.Track) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.Parameter1Name != nil { - data.Set("Parameter1.Name", *params.Parameter1Name) -} -if params != nil && params.Parameter1Value != nil { - data.Set("Parameter1.Value", *params.Parameter1Value) -} -if params != nil && params.Parameter2Name != nil { - data.Set("Parameter2.Name", *params.Parameter2Name) -} -if params != nil && params.Parameter2Value != nil { - data.Set("Parameter2.Value", *params.Parameter2Value) -} -if params != nil && params.Parameter3Name != nil { - data.Set("Parameter3.Name", *params.Parameter3Name) -} -if params != nil && params.Parameter3Value != nil { - data.Set("Parameter3.Value", *params.Parameter3Value) -} -if params != nil && params.Parameter4Name != nil { - data.Set("Parameter4.Name", *params.Parameter4Name) -} -if params != nil && params.Parameter4Value != nil { - data.Set("Parameter4.Value", *params.Parameter4Value) -} -if params != nil && params.Parameter5Name != nil { - data.Set("Parameter5.Name", *params.Parameter5Name) -} -if params != nil && params.Parameter5Value != nil { - data.Set("Parameter5.Value", *params.Parameter5Value) -} -if params != nil && params.Parameter6Name != nil { - data.Set("Parameter6.Name", *params.Parameter6Name) -} -if params != nil && params.Parameter6Value != nil { - data.Set("Parameter6.Value", *params.Parameter6Value) -} -if params != nil && params.Parameter7Name != nil { - data.Set("Parameter7.Name", *params.Parameter7Name) -} -if params != nil && params.Parameter7Value != nil { - data.Set("Parameter7.Value", *params.Parameter7Value) -} -if params != nil && params.Parameter8Name != nil { - data.Set("Parameter8.Name", *params.Parameter8Name) -} -if params != nil && params.Parameter8Value != nil { - data.Set("Parameter8.Value", *params.Parameter8Value) -} -if params != nil && params.Parameter9Name != nil { - data.Set("Parameter9.Name", *params.Parameter9Name) -} -if params != nil && params.Parameter9Value != nil { - data.Set("Parameter9.Value", *params.Parameter9Value) -} -if params != nil && params.Parameter10Name != nil { - data.Set("Parameter10.Name", *params.Parameter10Name) -} -if params != nil && params.Parameter10Value != nil { - data.Set("Parameter10.Value", *params.Parameter10Value) -} -if params != nil && params.Parameter11Name != nil { - data.Set("Parameter11.Name", *params.Parameter11Name) -} -if params != nil && params.Parameter11Value != nil { - data.Set("Parameter11.Value", *params.Parameter11Value) -} -if params != nil && params.Parameter12Name != nil { - data.Set("Parameter12.Name", *params.Parameter12Name) -} -if params != nil && params.Parameter12Value != nil { - data.Set("Parameter12.Value", *params.Parameter12Value) -} -if params != nil && params.Parameter13Name != nil { - data.Set("Parameter13.Name", *params.Parameter13Name) -} -if params != nil && params.Parameter13Value != nil { - data.Set("Parameter13.Value", *params.Parameter13Value) -} -if params != nil && params.Parameter14Name != nil { - data.Set("Parameter14.Name", *params.Parameter14Name) -} -if params != nil && params.Parameter14Value != nil { - data.Set("Parameter14.Value", *params.Parameter14Value) -} -if params != nil && params.Parameter15Name != nil { - data.Set("Parameter15.Name", *params.Parameter15Name) -} -if params != nil && params.Parameter15Value != nil { - data.Set("Parameter15.Value", *params.Parameter15Value) -} -if params != nil && params.Parameter16Name != nil { - data.Set("Parameter16.Name", *params.Parameter16Name) -} -if params != nil && params.Parameter16Value != nil { - data.Set("Parameter16.Value", *params.Parameter16Value) -} -if params != nil && params.Parameter17Name != nil { - data.Set("Parameter17.Name", *params.Parameter17Name) -} -if params != nil && params.Parameter17Value != nil { - data.Set("Parameter17.Value", *params.Parameter17Value) -} -if params != nil && params.Parameter18Name != nil { - data.Set("Parameter18.Name", *params.Parameter18Name) -} -if params != nil && params.Parameter18Value != nil { - data.Set("Parameter18.Value", *params.Parameter18Value) -} -if params != nil && params.Parameter19Name != nil { - data.Set("Parameter19.Name", *params.Parameter19Name) -} -if params != nil && params.Parameter19Value != nil { - data.Set("Parameter19.Value", *params.Parameter19Value) -} -if params != nil && params.Parameter20Name != nil { - data.Set("Parameter20.Name", *params.Parameter20Name) -} -if params != nil && params.Parameter20Value != nil { - data.Set("Parameter20.Value", *params.Parameter20Value) -} -if params != nil && params.Parameter21Name != nil { - data.Set("Parameter21.Name", *params.Parameter21Name) -} -if params != nil && params.Parameter21Value != nil { - data.Set("Parameter21.Value", *params.Parameter21Value) -} -if params != nil && params.Parameter22Name != nil { - data.Set("Parameter22.Name", *params.Parameter22Name) -} -if params != nil && params.Parameter22Value != nil { - data.Set("Parameter22.Value", *params.Parameter22Value) -} -if params != nil && params.Parameter23Name != nil { - data.Set("Parameter23.Name", *params.Parameter23Name) -} -if params != nil && params.Parameter23Value != nil { - data.Set("Parameter23.Value", *params.Parameter23Value) -} -if params != nil && params.Parameter24Name != nil { - data.Set("Parameter24.Name", *params.Parameter24Name) -} -if params != nil && params.Parameter24Value != nil { - data.Set("Parameter24.Value", *params.Parameter24Value) -} -if params != nil && params.Parameter25Name != nil { - data.Set("Parameter25.Name", *params.Parameter25Name) -} -if params != nil && params.Parameter25Value != nil { - data.Set("Parameter25.Value", *params.Parameter25Value) -} -if params != nil && params.Parameter26Name != nil { - data.Set("Parameter26.Name", *params.Parameter26Name) -} -if params != nil && params.Parameter26Value != nil { - data.Set("Parameter26.Value", *params.Parameter26Value) -} -if params != nil && params.Parameter27Name != nil { - data.Set("Parameter27.Name", *params.Parameter27Name) -} -if params != nil && params.Parameter27Value != nil { - data.Set("Parameter27.Value", *params.Parameter27Value) -} -if params != nil && params.Parameter28Name != nil { - data.Set("Parameter28.Name", *params.Parameter28Name) -} -if params != nil && params.Parameter28Value != nil { - data.Set("Parameter28.Value", *params.Parameter28Value) -} -if params != nil && params.Parameter29Name != nil { - data.Set("Parameter29.Name", *params.Parameter29Name) -} -if params != nil && params.Parameter29Value != nil { - data.Set("Parameter29.Value", *params.Parameter29Value) -} -if params != nil && params.Parameter30Name != nil { - data.Set("Parameter30.Name", *params.Parameter30Name) -} -if params != nil && params.Parameter30Value != nil { - data.Set("Parameter30.Value", *params.Parameter30Value) -} -if params != nil && params.Parameter31Name != nil { - data.Set("Parameter31.Name", *params.Parameter31Name) -} -if params != nil && params.Parameter31Value != nil { - data.Set("Parameter31.Value", *params.Parameter31Value) -} -if params != nil && params.Parameter32Name != nil { - data.Set("Parameter32.Name", *params.Parameter32Name) -} -if params != nil && params.Parameter32Value != nil { - data.Set("Parameter32.Value", *params.Parameter32Value) -} -if params != nil && params.Parameter33Name != nil { - data.Set("Parameter33.Name", *params.Parameter33Name) -} -if params != nil && params.Parameter33Value != nil { - data.Set("Parameter33.Value", *params.Parameter33Value) -} -if params != nil && params.Parameter34Name != nil { - data.Set("Parameter34.Name", *params.Parameter34Name) -} -if params != nil && params.Parameter34Value != nil { - data.Set("Parameter34.Value", *params.Parameter34Value) -} -if params != nil && params.Parameter35Name != nil { - data.Set("Parameter35.Name", *params.Parameter35Name) -} -if params != nil && params.Parameter35Value != nil { - data.Set("Parameter35.Value", *params.Parameter35Value) -} -if params != nil && params.Parameter36Name != nil { - data.Set("Parameter36.Name", *params.Parameter36Name) -} -if params != nil && params.Parameter36Value != nil { - data.Set("Parameter36.Value", *params.Parameter36Value) -} -if params != nil && params.Parameter37Name != nil { - data.Set("Parameter37.Name", *params.Parameter37Name) -} -if params != nil && params.Parameter37Value != nil { - data.Set("Parameter37.Value", *params.Parameter37Value) -} -if params != nil && params.Parameter38Name != nil { - data.Set("Parameter38.Name", *params.Parameter38Name) -} -if params != nil && params.Parameter38Value != nil { - data.Set("Parameter38.Value", *params.Parameter38Value) -} -if params != nil && params.Parameter39Name != nil { - data.Set("Parameter39.Name", *params.Parameter39Name) -} -if params != nil && params.Parameter39Value != nil { - data.Set("Parameter39.Value", *params.Parameter39Value) -} -if params != nil && params.Parameter40Name != nil { - data.Set("Parameter40.Name", *params.Parameter40Name) -} -if params != nil && params.Parameter40Value != nil { - data.Set("Parameter40.Value", *params.Parameter40Value) -} -if params != nil && params.Parameter41Name != nil { - data.Set("Parameter41.Name", *params.Parameter41Name) -} -if params != nil && params.Parameter41Value != nil { - data.Set("Parameter41.Value", *params.Parameter41Value) -} -if params != nil && params.Parameter42Name != nil { - data.Set("Parameter42.Name", *params.Parameter42Name) -} -if params != nil && params.Parameter42Value != nil { - data.Set("Parameter42.Value", *params.Parameter42Value) -} -if params != nil && params.Parameter43Name != nil { - data.Set("Parameter43.Name", *params.Parameter43Name) -} -if params != nil && params.Parameter43Value != nil { - data.Set("Parameter43.Value", *params.Parameter43Value) -} -if params != nil && params.Parameter44Name != nil { - data.Set("Parameter44.Name", *params.Parameter44Name) -} -if params != nil && params.Parameter44Value != nil { - data.Set("Parameter44.Value", *params.Parameter44Value) -} -if params != nil && params.Parameter45Name != nil { - data.Set("Parameter45.Name", *params.Parameter45Name) -} -if params != nil && params.Parameter45Value != nil { - data.Set("Parameter45.Value", *params.Parameter45Value) -} -if params != nil && params.Parameter46Name != nil { - data.Set("Parameter46.Name", *params.Parameter46Name) -} -if params != nil && params.Parameter46Value != nil { - data.Set("Parameter46.Value", *params.Parameter46Value) -} -if params != nil && params.Parameter47Name != nil { - data.Set("Parameter47.Name", *params.Parameter47Name) -} -if params != nil && params.Parameter47Value != nil { - data.Set("Parameter47.Value", *params.Parameter47Value) -} -if params != nil && params.Parameter48Name != nil { - data.Set("Parameter48.Name", *params.Parameter48Name) -} -if params != nil && params.Parameter48Value != nil { - data.Set("Parameter48.Value", *params.Parameter48Value) -} -if params != nil && params.Parameter49Name != nil { - data.Set("Parameter49.Name", *params.Parameter49Name) -} -if params != nil && params.Parameter49Value != nil { - data.Set("Parameter49.Value", *params.Parameter49Value) -} -if params != nil && params.Parameter50Name != nil { - data.Set("Parameter50.Name", *params.Parameter50Name) -} -if params != nil && params.Parameter50Value != nil { - data.Set("Parameter50.Value", *params.Parameter50Value) -} -if params != nil && params.Parameter51Name != nil { - data.Set("Parameter51.Name", *params.Parameter51Name) -} -if params != nil && params.Parameter51Value != nil { - data.Set("Parameter51.Value", *params.Parameter51Value) -} -if params != nil && params.Parameter52Name != nil { - data.Set("Parameter52.Name", *params.Parameter52Name) -} -if params != nil && params.Parameter52Value != nil { - data.Set("Parameter52.Value", *params.Parameter52Value) -} -if params != nil && params.Parameter53Name != nil { - data.Set("Parameter53.Name", *params.Parameter53Name) -} -if params != nil && params.Parameter53Value != nil { - data.Set("Parameter53.Value", *params.Parameter53Value) -} -if params != nil && params.Parameter54Name != nil { - data.Set("Parameter54.Name", *params.Parameter54Name) -} -if params != nil && params.Parameter54Value != nil { - data.Set("Parameter54.Value", *params.Parameter54Value) -} -if params != nil && params.Parameter55Name != nil { - data.Set("Parameter55.Name", *params.Parameter55Name) -} -if params != nil && params.Parameter55Value != nil { - data.Set("Parameter55.Value", *params.Parameter55Value) -} -if params != nil && params.Parameter56Name != nil { - data.Set("Parameter56.Name", *params.Parameter56Name) -} -if params != nil && params.Parameter56Value != nil { - data.Set("Parameter56.Value", *params.Parameter56Value) -} -if params != nil && params.Parameter57Name != nil { - data.Set("Parameter57.Name", *params.Parameter57Name) -} -if params != nil && params.Parameter57Value != nil { - data.Set("Parameter57.Value", *params.Parameter57Value) -} -if params != nil && params.Parameter58Name != nil { - data.Set("Parameter58.Name", *params.Parameter58Name) -} -if params != nil && params.Parameter58Value != nil { - data.Set("Parameter58.Value", *params.Parameter58Value) -} -if params != nil && params.Parameter59Name != nil { - data.Set("Parameter59.Name", *params.Parameter59Name) -} -if params != nil && params.Parameter59Value != nil { - data.Set("Parameter59.Value", *params.Parameter59Value) -} -if params != nil && params.Parameter60Name != nil { - data.Set("Parameter60.Name", *params.Parameter60Name) -} -if params != nil && params.Parameter60Value != nil { - data.Set("Parameter60.Value", *params.Parameter60Value) -} -if params != nil && params.Parameter61Name != nil { - data.Set("Parameter61.Name", *params.Parameter61Name) -} -if params != nil && params.Parameter61Value != nil { - data.Set("Parameter61.Value", *params.Parameter61Value) -} -if params != nil && params.Parameter62Name != nil { - data.Set("Parameter62.Name", *params.Parameter62Name) -} -if params != nil && params.Parameter62Value != nil { - data.Set("Parameter62.Value", *params.Parameter62Value) -} -if params != nil && params.Parameter63Name != nil { - data.Set("Parameter63.Name", *params.Parameter63Name) -} -if params != nil && params.Parameter63Value != nil { - data.Set("Parameter63.Value", *params.Parameter63Value) -} -if params != nil && params.Parameter64Name != nil { - data.Set("Parameter64.Name", *params.Parameter64Name) -} -if params != nil && params.Parameter64Value != nil { - data.Set("Parameter64.Value", *params.Parameter64Value) -} -if params != nil && params.Parameter65Name != nil { - data.Set("Parameter65.Name", *params.Parameter65Name) -} -if params != nil && params.Parameter65Value != nil { - data.Set("Parameter65.Value", *params.Parameter65Value) -} -if params != nil && params.Parameter66Name != nil { - data.Set("Parameter66.Name", *params.Parameter66Name) -} -if params != nil && params.Parameter66Value != nil { - data.Set("Parameter66.Value", *params.Parameter66Value) -} -if params != nil && params.Parameter67Name != nil { - data.Set("Parameter67.Name", *params.Parameter67Name) -} -if params != nil && params.Parameter67Value != nil { - data.Set("Parameter67.Value", *params.Parameter67Value) -} -if params != nil && params.Parameter68Name != nil { - data.Set("Parameter68.Name", *params.Parameter68Name) -} -if params != nil && params.Parameter68Value != nil { - data.Set("Parameter68.Value", *params.Parameter68Value) -} -if params != nil && params.Parameter69Name != nil { - data.Set("Parameter69.Name", *params.Parameter69Name) -} -if params != nil && params.Parameter69Value != nil { - data.Set("Parameter69.Value", *params.Parameter69Value) -} -if params != nil && params.Parameter70Name != nil { - data.Set("Parameter70.Name", *params.Parameter70Name) -} -if params != nil && params.Parameter70Value != nil { - data.Set("Parameter70.Value", *params.Parameter70Value) -} -if params != nil && params.Parameter71Name != nil { - data.Set("Parameter71.Name", *params.Parameter71Name) -} -if params != nil && params.Parameter71Value != nil { - data.Set("Parameter71.Value", *params.Parameter71Value) -} -if params != nil && params.Parameter72Name != nil { - data.Set("Parameter72.Name", *params.Parameter72Name) -} -if params != nil && params.Parameter72Value != nil { - data.Set("Parameter72.Value", *params.Parameter72Value) -} -if params != nil && params.Parameter73Name != nil { - data.Set("Parameter73.Name", *params.Parameter73Name) -} -if params != nil && params.Parameter73Value != nil { - data.Set("Parameter73.Value", *params.Parameter73Value) -} -if params != nil && params.Parameter74Name != nil { - data.Set("Parameter74.Name", *params.Parameter74Name) -} -if params != nil && params.Parameter74Value != nil { - data.Set("Parameter74.Value", *params.Parameter74Value) -} -if params != nil && params.Parameter75Name != nil { - data.Set("Parameter75.Name", *params.Parameter75Name) -} -if params != nil && params.Parameter75Value != nil { - data.Set("Parameter75.Value", *params.Parameter75Value) -} -if params != nil && params.Parameter76Name != nil { - data.Set("Parameter76.Name", *params.Parameter76Name) -} -if params != nil && params.Parameter76Value != nil { - data.Set("Parameter76.Value", *params.Parameter76Value) -} -if params != nil && params.Parameter77Name != nil { - data.Set("Parameter77.Name", *params.Parameter77Name) -} -if params != nil && params.Parameter77Value != nil { - data.Set("Parameter77.Value", *params.Parameter77Value) -} -if params != nil && params.Parameter78Name != nil { - data.Set("Parameter78.Name", *params.Parameter78Name) -} -if params != nil && params.Parameter78Value != nil { - data.Set("Parameter78.Value", *params.Parameter78Value) -} -if params != nil && params.Parameter79Name != nil { - data.Set("Parameter79.Name", *params.Parameter79Name) -} -if params != nil && params.Parameter79Value != nil { - data.Set("Parameter79.Value", *params.Parameter79Value) -} -if params != nil && params.Parameter80Name != nil { - data.Set("Parameter80.Name", *params.Parameter80Name) -} -if params != nil && params.Parameter80Value != nil { - data.Set("Parameter80.Value", *params.Parameter80Value) -} -if params != nil && params.Parameter81Name != nil { - data.Set("Parameter81.Name", *params.Parameter81Name) -} -if params != nil && params.Parameter81Value != nil { - data.Set("Parameter81.Value", *params.Parameter81Value) -} -if params != nil && params.Parameter82Name != nil { - data.Set("Parameter82.Name", *params.Parameter82Name) -} -if params != nil && params.Parameter82Value != nil { - data.Set("Parameter82.Value", *params.Parameter82Value) -} -if params != nil && params.Parameter83Name != nil { - data.Set("Parameter83.Name", *params.Parameter83Name) -} -if params != nil && params.Parameter83Value != nil { - data.Set("Parameter83.Value", *params.Parameter83Value) -} -if params != nil && params.Parameter84Name != nil { - data.Set("Parameter84.Name", *params.Parameter84Name) -} -if params != nil && params.Parameter84Value != nil { - data.Set("Parameter84.Value", *params.Parameter84Value) -} -if params != nil && params.Parameter85Name != nil { - data.Set("Parameter85.Name", *params.Parameter85Name) -} -if params != nil && params.Parameter85Value != nil { - data.Set("Parameter85.Value", *params.Parameter85Value) -} -if params != nil && params.Parameter86Name != nil { - data.Set("Parameter86.Name", *params.Parameter86Name) -} -if params != nil && params.Parameter86Value != nil { - data.Set("Parameter86.Value", *params.Parameter86Value) -} -if params != nil && params.Parameter87Name != nil { - data.Set("Parameter87.Name", *params.Parameter87Name) -} -if params != nil && params.Parameter87Value != nil { - data.Set("Parameter87.Value", *params.Parameter87Value) -} -if params != nil && params.Parameter88Name != nil { - data.Set("Parameter88.Name", *params.Parameter88Name) -} -if params != nil && params.Parameter88Value != nil { - data.Set("Parameter88.Value", *params.Parameter88Value) -} -if params != nil && params.Parameter89Name != nil { - data.Set("Parameter89.Name", *params.Parameter89Name) -} -if params != nil && params.Parameter89Value != nil { - data.Set("Parameter89.Value", *params.Parameter89Value) -} -if params != nil && params.Parameter90Name != nil { - data.Set("Parameter90.Name", *params.Parameter90Name) -} -if params != nil && params.Parameter90Value != nil { - data.Set("Parameter90.Value", *params.Parameter90Value) -} -if params != nil && params.Parameter91Name != nil { - data.Set("Parameter91.Name", *params.Parameter91Name) -} -if params != nil && params.Parameter91Value != nil { - data.Set("Parameter91.Value", *params.Parameter91Value) -} -if params != nil && params.Parameter92Name != nil { - data.Set("Parameter92.Name", *params.Parameter92Name) -} -if params != nil && params.Parameter92Value != nil { - data.Set("Parameter92.Value", *params.Parameter92Value) -} -if params != nil && params.Parameter93Name != nil { - data.Set("Parameter93.Name", *params.Parameter93Name) -} -if params != nil && params.Parameter93Value != nil { - data.Set("Parameter93.Value", *params.Parameter93Value) -} -if params != nil && params.Parameter94Name != nil { - data.Set("Parameter94.Name", *params.Parameter94Name) -} -if params != nil && params.Parameter94Value != nil { - data.Set("Parameter94.Value", *params.Parameter94Value) -} -if params != nil && params.Parameter95Name != nil { - data.Set("Parameter95.Name", *params.Parameter95Name) -} -if params != nil && params.Parameter95Value != nil { - data.Set("Parameter95.Value", *params.Parameter95Value) -} -if params != nil && params.Parameter96Name != nil { - data.Set("Parameter96.Name", *params.Parameter96Name) -} -if params != nil && params.Parameter96Value != nil { - data.Set("Parameter96.Value", *params.Parameter96Value) -} -if params != nil && params.Parameter97Name != nil { - data.Set("Parameter97.Name", *params.Parameter97Name) -} -if params != nil && params.Parameter97Value != nil { - data.Set("Parameter97.Value", *params.Parameter97Value) -} -if params != nil && params.Parameter98Name != nil { - data.Set("Parameter98.Name", *params.Parameter98Name) -} -if params != nil && params.Parameter98Value != nil { - data.Set("Parameter98.Value", *params.Parameter98Value) -} -if params != nil && params.Parameter99Name != nil { - data.Set("Parameter99.Name", *params.Parameter99Name) -} -if params != nil && params.Parameter99Value != nil { - data.Set("Parameter99.Value", *params.Parameter99Value) -} + + if params != nil && params.Url != nil { + data.Set("Url", *params.Url) + } + if params != nil && params.Name != nil { + data.Set("Name", *params.Name) + } + if params != nil && params.Track != nil { + data.Set("Track", *params.Track) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.Parameter1Name != nil { + data.Set("Parameter1.Name", *params.Parameter1Name) + } + if params != nil && params.Parameter1Value != nil { + data.Set("Parameter1.Value", *params.Parameter1Value) + } + if params != nil && params.Parameter2Name != nil { + data.Set("Parameter2.Name", *params.Parameter2Name) + } + if params != nil && params.Parameter2Value != nil { + data.Set("Parameter2.Value", *params.Parameter2Value) + } + if params != nil && params.Parameter3Name != nil { + data.Set("Parameter3.Name", *params.Parameter3Name) + } + if params != nil && params.Parameter3Value != nil { + data.Set("Parameter3.Value", *params.Parameter3Value) + } + if params != nil && params.Parameter4Name != nil { + data.Set("Parameter4.Name", *params.Parameter4Name) + } + if params != nil && params.Parameter4Value != nil { + data.Set("Parameter4.Value", *params.Parameter4Value) + } + if params != nil && params.Parameter5Name != nil { + data.Set("Parameter5.Name", *params.Parameter5Name) + } + if params != nil && params.Parameter5Value != nil { + data.Set("Parameter5.Value", *params.Parameter5Value) + } + if params != nil && params.Parameter6Name != nil { + data.Set("Parameter6.Name", *params.Parameter6Name) + } + if params != nil && params.Parameter6Value != nil { + data.Set("Parameter6.Value", *params.Parameter6Value) + } + if params != nil && params.Parameter7Name != nil { + data.Set("Parameter7.Name", *params.Parameter7Name) + } + if params != nil && params.Parameter7Value != nil { + data.Set("Parameter7.Value", *params.Parameter7Value) + } + if params != nil && params.Parameter8Name != nil { + data.Set("Parameter8.Name", *params.Parameter8Name) + } + if params != nil && params.Parameter8Value != nil { + data.Set("Parameter8.Value", *params.Parameter8Value) + } + if params != nil && params.Parameter9Name != nil { + data.Set("Parameter9.Name", *params.Parameter9Name) + } + if params != nil && params.Parameter9Value != nil { + data.Set("Parameter9.Value", *params.Parameter9Value) + } + if params != nil && params.Parameter10Name != nil { + data.Set("Parameter10.Name", *params.Parameter10Name) + } + if params != nil && params.Parameter10Value != nil { + data.Set("Parameter10.Value", *params.Parameter10Value) + } + if params != nil && params.Parameter11Name != nil { + data.Set("Parameter11.Name", *params.Parameter11Name) + } + if params != nil && params.Parameter11Value != nil { + data.Set("Parameter11.Value", *params.Parameter11Value) + } + if params != nil && params.Parameter12Name != nil { + data.Set("Parameter12.Name", *params.Parameter12Name) + } + if params != nil && params.Parameter12Value != nil { + data.Set("Parameter12.Value", *params.Parameter12Value) + } + if params != nil && params.Parameter13Name != nil { + data.Set("Parameter13.Name", *params.Parameter13Name) + } + if params != nil && params.Parameter13Value != nil { + data.Set("Parameter13.Value", *params.Parameter13Value) + } + if params != nil && params.Parameter14Name != nil { + data.Set("Parameter14.Name", *params.Parameter14Name) + } + if params != nil && params.Parameter14Value != nil { + data.Set("Parameter14.Value", *params.Parameter14Value) + } + if params != nil && params.Parameter15Name != nil { + data.Set("Parameter15.Name", *params.Parameter15Name) + } + if params != nil && params.Parameter15Value != nil { + data.Set("Parameter15.Value", *params.Parameter15Value) + } + if params != nil && params.Parameter16Name != nil { + data.Set("Parameter16.Name", *params.Parameter16Name) + } + if params != nil && params.Parameter16Value != nil { + data.Set("Parameter16.Value", *params.Parameter16Value) + } + if params != nil && params.Parameter17Name != nil { + data.Set("Parameter17.Name", *params.Parameter17Name) + } + if params != nil && params.Parameter17Value != nil { + data.Set("Parameter17.Value", *params.Parameter17Value) + } + if params != nil && params.Parameter18Name != nil { + data.Set("Parameter18.Name", *params.Parameter18Name) + } + if params != nil && params.Parameter18Value != nil { + data.Set("Parameter18.Value", *params.Parameter18Value) + } + if params != nil && params.Parameter19Name != nil { + data.Set("Parameter19.Name", *params.Parameter19Name) + } + if params != nil && params.Parameter19Value != nil { + data.Set("Parameter19.Value", *params.Parameter19Value) + } + if params != nil && params.Parameter20Name != nil { + data.Set("Parameter20.Name", *params.Parameter20Name) + } + if params != nil && params.Parameter20Value != nil { + data.Set("Parameter20.Value", *params.Parameter20Value) + } + if params != nil && params.Parameter21Name != nil { + data.Set("Parameter21.Name", *params.Parameter21Name) + } + if params != nil && params.Parameter21Value != nil { + data.Set("Parameter21.Value", *params.Parameter21Value) + } + if params != nil && params.Parameter22Name != nil { + data.Set("Parameter22.Name", *params.Parameter22Name) + } + if params != nil && params.Parameter22Value != nil { + data.Set("Parameter22.Value", *params.Parameter22Value) + } + if params != nil && params.Parameter23Name != nil { + data.Set("Parameter23.Name", *params.Parameter23Name) + } + if params != nil && params.Parameter23Value != nil { + data.Set("Parameter23.Value", *params.Parameter23Value) + } + if params != nil && params.Parameter24Name != nil { + data.Set("Parameter24.Name", *params.Parameter24Name) + } + if params != nil && params.Parameter24Value != nil { + data.Set("Parameter24.Value", *params.Parameter24Value) + } + if params != nil && params.Parameter25Name != nil { + data.Set("Parameter25.Name", *params.Parameter25Name) + } + if params != nil && params.Parameter25Value != nil { + data.Set("Parameter25.Value", *params.Parameter25Value) + } + if params != nil && params.Parameter26Name != nil { + data.Set("Parameter26.Name", *params.Parameter26Name) + } + if params != nil && params.Parameter26Value != nil { + data.Set("Parameter26.Value", *params.Parameter26Value) + } + if params != nil && params.Parameter27Name != nil { + data.Set("Parameter27.Name", *params.Parameter27Name) + } + if params != nil && params.Parameter27Value != nil { + data.Set("Parameter27.Value", *params.Parameter27Value) + } + if params != nil && params.Parameter28Name != nil { + data.Set("Parameter28.Name", *params.Parameter28Name) + } + if params != nil && params.Parameter28Value != nil { + data.Set("Parameter28.Value", *params.Parameter28Value) + } + if params != nil && params.Parameter29Name != nil { + data.Set("Parameter29.Name", *params.Parameter29Name) + } + if params != nil && params.Parameter29Value != nil { + data.Set("Parameter29.Value", *params.Parameter29Value) + } + if params != nil && params.Parameter30Name != nil { + data.Set("Parameter30.Name", *params.Parameter30Name) + } + if params != nil && params.Parameter30Value != nil { + data.Set("Parameter30.Value", *params.Parameter30Value) + } + if params != nil && params.Parameter31Name != nil { + data.Set("Parameter31.Name", *params.Parameter31Name) + } + if params != nil && params.Parameter31Value != nil { + data.Set("Parameter31.Value", *params.Parameter31Value) + } + if params != nil && params.Parameter32Name != nil { + data.Set("Parameter32.Name", *params.Parameter32Name) + } + if params != nil && params.Parameter32Value != nil { + data.Set("Parameter32.Value", *params.Parameter32Value) + } + if params != nil && params.Parameter33Name != nil { + data.Set("Parameter33.Name", *params.Parameter33Name) + } + if params != nil && params.Parameter33Value != nil { + data.Set("Parameter33.Value", *params.Parameter33Value) + } + if params != nil && params.Parameter34Name != nil { + data.Set("Parameter34.Name", *params.Parameter34Name) + } + if params != nil && params.Parameter34Value != nil { + data.Set("Parameter34.Value", *params.Parameter34Value) + } + if params != nil && params.Parameter35Name != nil { + data.Set("Parameter35.Name", *params.Parameter35Name) + } + if params != nil && params.Parameter35Value != nil { + data.Set("Parameter35.Value", *params.Parameter35Value) + } + if params != nil && params.Parameter36Name != nil { + data.Set("Parameter36.Name", *params.Parameter36Name) + } + if params != nil && params.Parameter36Value != nil { + data.Set("Parameter36.Value", *params.Parameter36Value) + } + if params != nil && params.Parameter37Name != nil { + data.Set("Parameter37.Name", *params.Parameter37Name) + } + if params != nil && params.Parameter37Value != nil { + data.Set("Parameter37.Value", *params.Parameter37Value) + } + if params != nil && params.Parameter38Name != nil { + data.Set("Parameter38.Name", *params.Parameter38Name) + } + if params != nil && params.Parameter38Value != nil { + data.Set("Parameter38.Value", *params.Parameter38Value) + } + if params != nil && params.Parameter39Name != nil { + data.Set("Parameter39.Name", *params.Parameter39Name) + } + if params != nil && params.Parameter39Value != nil { + data.Set("Parameter39.Value", *params.Parameter39Value) + } + if params != nil && params.Parameter40Name != nil { + data.Set("Parameter40.Name", *params.Parameter40Name) + } + if params != nil && params.Parameter40Value != nil { + data.Set("Parameter40.Value", *params.Parameter40Value) + } + if params != nil && params.Parameter41Name != nil { + data.Set("Parameter41.Name", *params.Parameter41Name) + } + if params != nil && params.Parameter41Value != nil { + data.Set("Parameter41.Value", *params.Parameter41Value) + } + if params != nil && params.Parameter42Name != nil { + data.Set("Parameter42.Name", *params.Parameter42Name) + } + if params != nil && params.Parameter42Value != nil { + data.Set("Parameter42.Value", *params.Parameter42Value) + } + if params != nil && params.Parameter43Name != nil { + data.Set("Parameter43.Name", *params.Parameter43Name) + } + if params != nil && params.Parameter43Value != nil { + data.Set("Parameter43.Value", *params.Parameter43Value) + } + if params != nil && params.Parameter44Name != nil { + data.Set("Parameter44.Name", *params.Parameter44Name) + } + if params != nil && params.Parameter44Value != nil { + data.Set("Parameter44.Value", *params.Parameter44Value) + } + if params != nil && params.Parameter45Name != nil { + data.Set("Parameter45.Name", *params.Parameter45Name) + } + if params != nil && params.Parameter45Value != nil { + data.Set("Parameter45.Value", *params.Parameter45Value) + } + if params != nil && params.Parameter46Name != nil { + data.Set("Parameter46.Name", *params.Parameter46Name) + } + if params != nil && params.Parameter46Value != nil { + data.Set("Parameter46.Value", *params.Parameter46Value) + } + if params != nil && params.Parameter47Name != nil { + data.Set("Parameter47.Name", *params.Parameter47Name) + } + if params != nil && params.Parameter47Value != nil { + data.Set("Parameter47.Value", *params.Parameter47Value) + } + if params != nil && params.Parameter48Name != nil { + data.Set("Parameter48.Name", *params.Parameter48Name) + } + if params != nil && params.Parameter48Value != nil { + data.Set("Parameter48.Value", *params.Parameter48Value) + } + if params != nil && params.Parameter49Name != nil { + data.Set("Parameter49.Name", *params.Parameter49Name) + } + if params != nil && params.Parameter49Value != nil { + data.Set("Parameter49.Value", *params.Parameter49Value) + } + if params != nil && params.Parameter50Name != nil { + data.Set("Parameter50.Name", *params.Parameter50Name) + } + if params != nil && params.Parameter50Value != nil { + data.Set("Parameter50.Value", *params.Parameter50Value) + } + if params != nil && params.Parameter51Name != nil { + data.Set("Parameter51.Name", *params.Parameter51Name) + } + if params != nil && params.Parameter51Value != nil { + data.Set("Parameter51.Value", *params.Parameter51Value) + } + if params != nil && params.Parameter52Name != nil { + data.Set("Parameter52.Name", *params.Parameter52Name) + } + if params != nil && params.Parameter52Value != nil { + data.Set("Parameter52.Value", *params.Parameter52Value) + } + if params != nil && params.Parameter53Name != nil { + data.Set("Parameter53.Name", *params.Parameter53Name) + } + if params != nil && params.Parameter53Value != nil { + data.Set("Parameter53.Value", *params.Parameter53Value) + } + if params != nil && params.Parameter54Name != nil { + data.Set("Parameter54.Name", *params.Parameter54Name) + } + if params != nil && params.Parameter54Value != nil { + data.Set("Parameter54.Value", *params.Parameter54Value) + } + if params != nil && params.Parameter55Name != nil { + data.Set("Parameter55.Name", *params.Parameter55Name) + } + if params != nil && params.Parameter55Value != nil { + data.Set("Parameter55.Value", *params.Parameter55Value) + } + if params != nil && params.Parameter56Name != nil { + data.Set("Parameter56.Name", *params.Parameter56Name) + } + if params != nil && params.Parameter56Value != nil { + data.Set("Parameter56.Value", *params.Parameter56Value) + } + if params != nil && params.Parameter57Name != nil { + data.Set("Parameter57.Name", *params.Parameter57Name) + } + if params != nil && params.Parameter57Value != nil { + data.Set("Parameter57.Value", *params.Parameter57Value) + } + if params != nil && params.Parameter58Name != nil { + data.Set("Parameter58.Name", *params.Parameter58Name) + } + if params != nil && params.Parameter58Value != nil { + data.Set("Parameter58.Value", *params.Parameter58Value) + } + if params != nil && params.Parameter59Name != nil { + data.Set("Parameter59.Name", *params.Parameter59Name) + } + if params != nil && params.Parameter59Value != nil { + data.Set("Parameter59.Value", *params.Parameter59Value) + } + if params != nil && params.Parameter60Name != nil { + data.Set("Parameter60.Name", *params.Parameter60Name) + } + if params != nil && params.Parameter60Value != nil { + data.Set("Parameter60.Value", *params.Parameter60Value) + } + if params != nil && params.Parameter61Name != nil { + data.Set("Parameter61.Name", *params.Parameter61Name) + } + if params != nil && params.Parameter61Value != nil { + data.Set("Parameter61.Value", *params.Parameter61Value) + } + if params != nil && params.Parameter62Name != nil { + data.Set("Parameter62.Name", *params.Parameter62Name) + } + if params != nil && params.Parameter62Value != nil { + data.Set("Parameter62.Value", *params.Parameter62Value) + } + if params != nil && params.Parameter63Name != nil { + data.Set("Parameter63.Name", *params.Parameter63Name) + } + if params != nil && params.Parameter63Value != nil { + data.Set("Parameter63.Value", *params.Parameter63Value) + } + if params != nil && params.Parameter64Name != nil { + data.Set("Parameter64.Name", *params.Parameter64Name) + } + if params != nil && params.Parameter64Value != nil { + data.Set("Parameter64.Value", *params.Parameter64Value) + } + if params != nil && params.Parameter65Name != nil { + data.Set("Parameter65.Name", *params.Parameter65Name) + } + if params != nil && params.Parameter65Value != nil { + data.Set("Parameter65.Value", *params.Parameter65Value) + } + if params != nil && params.Parameter66Name != nil { + data.Set("Parameter66.Name", *params.Parameter66Name) + } + if params != nil && params.Parameter66Value != nil { + data.Set("Parameter66.Value", *params.Parameter66Value) + } + if params != nil && params.Parameter67Name != nil { + data.Set("Parameter67.Name", *params.Parameter67Name) + } + if params != nil && params.Parameter67Value != nil { + data.Set("Parameter67.Value", *params.Parameter67Value) + } + if params != nil && params.Parameter68Name != nil { + data.Set("Parameter68.Name", *params.Parameter68Name) + } + if params != nil && params.Parameter68Value != nil { + data.Set("Parameter68.Value", *params.Parameter68Value) + } + if params != nil && params.Parameter69Name != nil { + data.Set("Parameter69.Name", *params.Parameter69Name) + } + if params != nil && params.Parameter69Value != nil { + data.Set("Parameter69.Value", *params.Parameter69Value) + } + if params != nil && params.Parameter70Name != nil { + data.Set("Parameter70.Name", *params.Parameter70Name) + } + if params != nil && params.Parameter70Value != nil { + data.Set("Parameter70.Value", *params.Parameter70Value) + } + if params != nil && params.Parameter71Name != nil { + data.Set("Parameter71.Name", *params.Parameter71Name) + } + if params != nil && params.Parameter71Value != nil { + data.Set("Parameter71.Value", *params.Parameter71Value) + } + if params != nil && params.Parameter72Name != nil { + data.Set("Parameter72.Name", *params.Parameter72Name) + } + if params != nil && params.Parameter72Value != nil { + data.Set("Parameter72.Value", *params.Parameter72Value) + } + if params != nil && params.Parameter73Name != nil { + data.Set("Parameter73.Name", *params.Parameter73Name) + } + if params != nil && params.Parameter73Value != nil { + data.Set("Parameter73.Value", *params.Parameter73Value) + } + if params != nil && params.Parameter74Name != nil { + data.Set("Parameter74.Name", *params.Parameter74Name) + } + if params != nil && params.Parameter74Value != nil { + data.Set("Parameter74.Value", *params.Parameter74Value) + } + if params != nil && params.Parameter75Name != nil { + data.Set("Parameter75.Name", *params.Parameter75Name) + } + if params != nil && params.Parameter75Value != nil { + data.Set("Parameter75.Value", *params.Parameter75Value) + } + if params != nil && params.Parameter76Name != nil { + data.Set("Parameter76.Name", *params.Parameter76Name) + } + if params != nil && params.Parameter76Value != nil { + data.Set("Parameter76.Value", *params.Parameter76Value) + } + if params != nil && params.Parameter77Name != nil { + data.Set("Parameter77.Name", *params.Parameter77Name) + } + if params != nil && params.Parameter77Value != nil { + data.Set("Parameter77.Value", *params.Parameter77Value) + } + if params != nil && params.Parameter78Name != nil { + data.Set("Parameter78.Name", *params.Parameter78Name) + } + if params != nil && params.Parameter78Value != nil { + data.Set("Parameter78.Value", *params.Parameter78Value) + } + if params != nil && params.Parameter79Name != nil { + data.Set("Parameter79.Name", *params.Parameter79Name) + } + if params != nil && params.Parameter79Value != nil { + data.Set("Parameter79.Value", *params.Parameter79Value) + } + if params != nil && params.Parameter80Name != nil { + data.Set("Parameter80.Name", *params.Parameter80Name) + } + if params != nil && params.Parameter80Value != nil { + data.Set("Parameter80.Value", *params.Parameter80Value) + } + if params != nil && params.Parameter81Name != nil { + data.Set("Parameter81.Name", *params.Parameter81Name) + } + if params != nil && params.Parameter81Value != nil { + data.Set("Parameter81.Value", *params.Parameter81Value) + } + if params != nil && params.Parameter82Name != nil { + data.Set("Parameter82.Name", *params.Parameter82Name) + } + if params != nil && params.Parameter82Value != nil { + data.Set("Parameter82.Value", *params.Parameter82Value) + } + if params != nil && params.Parameter83Name != nil { + data.Set("Parameter83.Name", *params.Parameter83Name) + } + if params != nil && params.Parameter83Value != nil { + data.Set("Parameter83.Value", *params.Parameter83Value) + } + if params != nil && params.Parameter84Name != nil { + data.Set("Parameter84.Name", *params.Parameter84Name) + } + if params != nil && params.Parameter84Value != nil { + data.Set("Parameter84.Value", *params.Parameter84Value) + } + if params != nil && params.Parameter85Name != nil { + data.Set("Parameter85.Name", *params.Parameter85Name) + } + if params != nil && params.Parameter85Value != nil { + data.Set("Parameter85.Value", *params.Parameter85Value) + } + if params != nil && params.Parameter86Name != nil { + data.Set("Parameter86.Name", *params.Parameter86Name) + } + if params != nil && params.Parameter86Value != nil { + data.Set("Parameter86.Value", *params.Parameter86Value) + } + if params != nil && params.Parameter87Name != nil { + data.Set("Parameter87.Name", *params.Parameter87Name) + } + if params != nil && params.Parameter87Value != nil { + data.Set("Parameter87.Value", *params.Parameter87Value) + } + if params != nil && params.Parameter88Name != nil { + data.Set("Parameter88.Name", *params.Parameter88Name) + } + if params != nil && params.Parameter88Value != nil { + data.Set("Parameter88.Value", *params.Parameter88Value) + } + if params != nil && params.Parameter89Name != nil { + data.Set("Parameter89.Name", *params.Parameter89Name) + } + if params != nil && params.Parameter89Value != nil { + data.Set("Parameter89.Value", *params.Parameter89Value) + } + if params != nil && params.Parameter90Name != nil { + data.Set("Parameter90.Name", *params.Parameter90Name) + } + if params != nil && params.Parameter90Value != nil { + data.Set("Parameter90.Value", *params.Parameter90Value) + } + if params != nil && params.Parameter91Name != nil { + data.Set("Parameter91.Name", *params.Parameter91Name) + } + if params != nil && params.Parameter91Value != nil { + data.Set("Parameter91.Value", *params.Parameter91Value) + } + if params != nil && params.Parameter92Name != nil { + data.Set("Parameter92.Name", *params.Parameter92Name) + } + if params != nil && params.Parameter92Value != nil { + data.Set("Parameter92.Value", *params.Parameter92Value) + } + if params != nil && params.Parameter93Name != nil { + data.Set("Parameter93.Name", *params.Parameter93Name) + } + if params != nil && params.Parameter93Value != nil { + data.Set("Parameter93.Value", *params.Parameter93Value) + } + if params != nil && params.Parameter94Name != nil { + data.Set("Parameter94.Name", *params.Parameter94Name) + } + if params != nil && params.Parameter94Value != nil { + data.Set("Parameter94.Value", *params.Parameter94Value) + } + if params != nil && params.Parameter95Name != nil { + data.Set("Parameter95.Name", *params.Parameter95Name) + } + if params != nil && params.Parameter95Value != nil { + data.Set("Parameter95.Value", *params.Parameter95Value) + } + if params != nil && params.Parameter96Name != nil { + data.Set("Parameter96.Name", *params.Parameter96Name) + } + if params != nil && params.Parameter96Value != nil { + data.Set("Parameter96.Value", *params.Parameter96Value) + } + if params != nil && params.Parameter97Name != nil { + data.Set("Parameter97.Name", *params.Parameter97Name) + } + if params != nil && params.Parameter97Value != nil { + data.Set("Parameter97.Value", *params.Parameter97Value) + } + if params != nil && params.Parameter98Name != nil { + data.Set("Parameter98.Name", *params.Parameter98Name) + } + if params != nil && params.Parameter98Value != nil { + data.Set("Parameter98.Value", *params.Parameter98Value) + } + if params != nil && params.Parameter99Name != nil { + data.Set("Parameter99.Name", *params.Parameter99Name) + } + if params != nil && params.Parameter99Value != nil { + data.Set("Parameter99.Value", *params.Parameter99Value) + } @@ -1921,9 +1922,10 @@ func (c *ApiService) UpdateStream(CallSid string, Sid string, params *UpdateStre data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } diff --git a/rest/api/v2010/accounts_calls_user_defined_message_subscriptions.go b/rest/api/v2010/accounts_calls_user_defined_message_subscriptions.go index f70ce5a88..925319f1a 100644 --- a/rest/api/v2010/accounts_calls_user_defined_message_subscriptions.go +++ b/rest/api/v2010/accounts_calls_user_defined_message_subscriptions.go @@ -64,15 +64,16 @@ func (c *ApiService) CreateUserDefinedMessageSubscription(CallSid string, params data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Callback != nil { - data.Set("Callback", *params.Callback) -} -if params != nil && params.IdempotencyKey != nil { - data.Set("IdempotencyKey", *params.IdempotencyKey) -} -if params != nil && params.Method != nil { - data.Set("Method", *params.Method) -} + + if params != nil && params.Callback != nil { + data.Set("Callback", *params.Callback) + } + if params != nil && params.IdempotencyKey != nil { + data.Set("IdempotencyKey", *params.IdempotencyKey) + } + if params != nil && params.Method != nil { + data.Set("Method", *params.Method) + } @@ -118,6 +119,7 @@ func (c *ApiService) DeleteUserDefinedMessageSubscription(CallSid string, Sid st + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err diff --git a/rest/api/v2010/accounts_calls_user_defined_messages.go b/rest/api/v2010/accounts_calls_user_defined_messages.go index a4dfeee4f..972324e00 100644 --- a/rest/api/v2010/accounts_calls_user_defined_messages.go +++ b/rest/api/v2010/accounts_calls_user_defined_messages.go @@ -58,12 +58,13 @@ func (c *ApiService) CreateUserDefinedMessage(CallSid string, params *CreateUser data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Content != nil { - data.Set("Content", *params.Content) -} -if params != nil && params.IdempotencyKey != nil { - data.Set("IdempotencyKey", *params.IdempotencyKey) -} + + if params != nil && params.Content != nil { + data.Set("Content", *params.Content) + } + if params != nil && params.IdempotencyKey != nil { + data.Set("IdempotencyKey", *params.IdempotencyKey) + } diff --git a/rest/api/v2010/accounts_conferences.go b/rest/api/v2010/accounts_conferences.go index 6cd98beb4..23fafea05 100644 --- a/rest/api/v2010/accounts_conferences.go +++ b/rest/api/v2010/accounts_conferences.go @@ -49,6 +49,7 @@ func (c *ApiService) FetchConference(Sid string, params *FetchConferenceParams) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -123,21 +124,22 @@ func (c *ApiService) PageConference(params *ListConferenceParams, pageToken, pag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint(*params.DateCreated)) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint(*params.DateUpdated)) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint(*params.DateCreated)) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint(*params.DateUpdated)) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -290,15 +292,16 @@ func (c *ApiService) UpdateConference(Sid string, params *UpdateConferenceParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.AnnounceUrl != nil { - data.Set("AnnounceUrl", *params.AnnounceUrl) -} -if params != nil && params.AnnounceMethod != nil { - data.Set("AnnounceMethod", *params.AnnounceMethod) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.AnnounceUrl != nil { + data.Set("AnnounceUrl", *params.AnnounceUrl) + } + if params != nil && params.AnnounceMethod != nil { + data.Set("AnnounceMethod", *params.AnnounceMethod) + } diff --git a/rest/api/v2010/accounts_conferences_participants.go b/rest/api/v2010/accounts_conferences_participants.go index 7f210f357..3af08e790 100644 --- a/rest/api/v2010/accounts_conferences_participants.go +++ b/rest/api/v2010/accounts_conferences_participants.go @@ -328,155 +328,156 @@ func (c *ApiService) CreateParticipant(ConferenceSid string, params *CreateParti data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.From != nil { - data.Set("From", *params.From) -} -if params != nil && params.To != nil { - data.Set("To", *params.To) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.StatusCallbackEvent != nil { - for _, item := range *params.StatusCallbackEvent { - data.Add("StatusCallbackEvent", item) + + if params != nil && params.From != nil { + data.Set("From", *params.From) } -} -if params != nil && params.Label != nil { - data.Set("Label", *params.Label) -} -if params != nil && params.Timeout != nil { - data.Set("Timeout", fmt.Sprint(*params.Timeout)) -} -if params != nil && params.Record != nil { - data.Set("Record", fmt.Sprint(*params.Record)) -} -if params != nil && params.Muted != nil { - data.Set("Muted", fmt.Sprint(*params.Muted)) -} -if params != nil && params.Beep != nil { - data.Set("Beep", *params.Beep) -} -if params != nil && params.StartConferenceOnEnter != nil { - data.Set("StartConferenceOnEnter", fmt.Sprint(*params.StartConferenceOnEnter)) -} -if params != nil && params.EndConferenceOnExit != nil { - data.Set("EndConferenceOnExit", fmt.Sprint(*params.EndConferenceOnExit)) -} -if params != nil && params.WaitUrl != nil { - data.Set("WaitUrl", *params.WaitUrl) -} -if params != nil && params.WaitMethod != nil { - data.Set("WaitMethod", *params.WaitMethod) -} -if params != nil && params.EarlyMedia != nil { - data.Set("EarlyMedia", fmt.Sprint(*params.EarlyMedia)) -} -if params != nil && params.MaxParticipants != nil { - data.Set("MaxParticipants", fmt.Sprint(*params.MaxParticipants)) -} -if params != nil && params.ConferenceRecord != nil { - data.Set("ConferenceRecord", *params.ConferenceRecord) -} -if params != nil && params.ConferenceTrim != nil { - data.Set("ConferenceTrim", *params.ConferenceTrim) -} -if params != nil && params.ConferenceStatusCallback != nil { - data.Set("ConferenceStatusCallback", *params.ConferenceStatusCallback) -} -if params != nil && params.ConferenceStatusCallbackMethod != nil { - data.Set("ConferenceStatusCallbackMethod", *params.ConferenceStatusCallbackMethod) -} -if params != nil && params.ConferenceStatusCallbackEvent != nil { - for _, item := range *params.ConferenceStatusCallbackEvent { - data.Add("ConferenceStatusCallbackEvent", item) + if params != nil && params.To != nil { + data.Set("To", *params.To) } -} -if params != nil && params.RecordingChannels != nil { - data.Set("RecordingChannels", *params.RecordingChannels) -} -if params != nil && params.RecordingStatusCallback != nil { - data.Set("RecordingStatusCallback", *params.RecordingStatusCallback) -} -if params != nil && params.RecordingStatusCallbackMethod != nil { - data.Set("RecordingStatusCallbackMethod", *params.RecordingStatusCallbackMethod) -} -if params != nil && params.SipAuthUsername != nil { - data.Set("SipAuthUsername", *params.SipAuthUsername) -} -if params != nil && params.SipAuthPassword != nil { - data.Set("SipAuthPassword", *params.SipAuthPassword) -} -if params != nil && params.Region != nil { - data.Set("Region", *params.Region) -} -if params != nil && params.ConferenceRecordingStatusCallback != nil { - data.Set("ConferenceRecordingStatusCallback", *params.ConferenceRecordingStatusCallback) -} -if params != nil && params.ConferenceRecordingStatusCallbackMethod != nil { - data.Set("ConferenceRecordingStatusCallbackMethod", *params.ConferenceRecordingStatusCallbackMethod) -} -if params != nil && params.RecordingStatusCallbackEvent != nil { - for _, item := range *params.RecordingStatusCallbackEvent { - data.Add("RecordingStatusCallbackEvent", item) + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) } -} -if params != nil && params.ConferenceRecordingStatusCallbackEvent != nil { - for _, item := range *params.ConferenceRecordingStatusCallbackEvent { - data.Add("ConferenceRecordingStatusCallbackEvent", item) + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.StatusCallbackEvent != nil { + for _, item := range *params.StatusCallbackEvent { + data.Add("StatusCallbackEvent", item) + } + } + if params != nil && params.Label != nil { + data.Set("Label", *params.Label) + } + if params != nil && params.Timeout != nil { + data.Set("Timeout", fmt.Sprint(*params.Timeout)) + } + if params != nil && params.Record != nil { + data.Set("Record", fmt.Sprint(*params.Record)) + } + if params != nil && params.Muted != nil { + data.Set("Muted", fmt.Sprint(*params.Muted)) + } + if params != nil && params.Beep != nil { + data.Set("Beep", *params.Beep) + } + if params != nil && params.StartConferenceOnEnter != nil { + data.Set("StartConferenceOnEnter", fmt.Sprint(*params.StartConferenceOnEnter)) + } + if params != nil && params.EndConferenceOnExit != nil { + data.Set("EndConferenceOnExit", fmt.Sprint(*params.EndConferenceOnExit)) + } + if params != nil && params.WaitUrl != nil { + data.Set("WaitUrl", *params.WaitUrl) + } + if params != nil && params.WaitMethod != nil { + data.Set("WaitMethod", *params.WaitMethod) + } + if params != nil && params.EarlyMedia != nil { + data.Set("EarlyMedia", fmt.Sprint(*params.EarlyMedia)) + } + if params != nil && params.MaxParticipants != nil { + data.Set("MaxParticipants", fmt.Sprint(*params.MaxParticipants)) + } + if params != nil && params.ConferenceRecord != nil { + data.Set("ConferenceRecord", *params.ConferenceRecord) + } + if params != nil && params.ConferenceTrim != nil { + data.Set("ConferenceTrim", *params.ConferenceTrim) + } + if params != nil && params.ConferenceStatusCallback != nil { + data.Set("ConferenceStatusCallback", *params.ConferenceStatusCallback) + } + if params != nil && params.ConferenceStatusCallbackMethod != nil { + data.Set("ConferenceStatusCallbackMethod", *params.ConferenceStatusCallbackMethod) + } + if params != nil && params.ConferenceStatusCallbackEvent != nil { + for _, item := range *params.ConferenceStatusCallbackEvent { + data.Add("ConferenceStatusCallbackEvent", item) + } + } + if params != nil && params.RecordingChannels != nil { + data.Set("RecordingChannels", *params.RecordingChannels) + } + if params != nil && params.RecordingStatusCallback != nil { + data.Set("RecordingStatusCallback", *params.RecordingStatusCallback) + } + if params != nil && params.RecordingStatusCallbackMethod != nil { + data.Set("RecordingStatusCallbackMethod", *params.RecordingStatusCallbackMethod) + } + if params != nil && params.SipAuthUsername != nil { + data.Set("SipAuthUsername", *params.SipAuthUsername) + } + if params != nil && params.SipAuthPassword != nil { + data.Set("SipAuthPassword", *params.SipAuthPassword) + } + if params != nil && params.Region != nil { + data.Set("Region", *params.Region) + } + if params != nil && params.ConferenceRecordingStatusCallback != nil { + data.Set("ConferenceRecordingStatusCallback", *params.ConferenceRecordingStatusCallback) + } + if params != nil && params.ConferenceRecordingStatusCallbackMethod != nil { + data.Set("ConferenceRecordingStatusCallbackMethod", *params.ConferenceRecordingStatusCallbackMethod) + } + if params != nil && params.RecordingStatusCallbackEvent != nil { + for _, item := range *params.RecordingStatusCallbackEvent { + data.Add("RecordingStatusCallbackEvent", item) + } + } + if params != nil && params.ConferenceRecordingStatusCallbackEvent != nil { + for _, item := range *params.ConferenceRecordingStatusCallbackEvent { + data.Add("ConferenceRecordingStatusCallbackEvent", item) + } + } + if params != nil && params.Coaching != nil { + data.Set("Coaching", fmt.Sprint(*params.Coaching)) + } + if params != nil && params.CallSidToCoach != nil { + data.Set("CallSidToCoach", *params.CallSidToCoach) + } + if params != nil && params.JitterBufferSize != nil { + data.Set("JitterBufferSize", *params.JitterBufferSize) + } + if params != nil && params.Byoc != nil { + data.Set("Byoc", *params.Byoc) + } + if params != nil && params.CallerId != nil { + data.Set("CallerId", *params.CallerId) + } + if params != nil && params.CallReason != nil { + data.Set("CallReason", *params.CallReason) + } + if params != nil && params.RecordingTrack != nil { + data.Set("RecordingTrack", *params.RecordingTrack) + } + if params != nil && params.TimeLimit != nil { + data.Set("TimeLimit", fmt.Sprint(*params.TimeLimit)) + } + if params != nil && params.MachineDetection != nil { + data.Set("MachineDetection", *params.MachineDetection) + } + if params != nil && params.MachineDetectionTimeout != nil { + data.Set("MachineDetectionTimeout", fmt.Sprint(*params.MachineDetectionTimeout)) + } + if params != nil && params.MachineDetectionSpeechThreshold != nil { + data.Set("MachineDetectionSpeechThreshold", fmt.Sprint(*params.MachineDetectionSpeechThreshold)) + } + if params != nil && params.MachineDetectionSpeechEndThreshold != nil { + data.Set("MachineDetectionSpeechEndThreshold", fmt.Sprint(*params.MachineDetectionSpeechEndThreshold)) + } + if params != nil && params.MachineDetectionSilenceTimeout != nil { + data.Set("MachineDetectionSilenceTimeout", fmt.Sprint(*params.MachineDetectionSilenceTimeout)) + } + if params != nil && params.AmdStatusCallback != nil { + data.Set("AmdStatusCallback", *params.AmdStatusCallback) + } + if params != nil && params.AmdStatusCallbackMethod != nil { + data.Set("AmdStatusCallbackMethod", *params.AmdStatusCallbackMethod) + } + if params != nil && params.Trim != nil { + data.Set("Trim", *params.Trim) } -} -if params != nil && params.Coaching != nil { - data.Set("Coaching", fmt.Sprint(*params.Coaching)) -} -if params != nil && params.CallSidToCoach != nil { - data.Set("CallSidToCoach", *params.CallSidToCoach) -} -if params != nil && params.JitterBufferSize != nil { - data.Set("JitterBufferSize", *params.JitterBufferSize) -} -if params != nil && params.Byoc != nil { - data.Set("Byoc", *params.Byoc) -} -if params != nil && params.CallerId != nil { - data.Set("CallerId", *params.CallerId) -} -if params != nil && params.CallReason != nil { - data.Set("CallReason", *params.CallReason) -} -if params != nil && params.RecordingTrack != nil { - data.Set("RecordingTrack", *params.RecordingTrack) -} -if params != nil && params.TimeLimit != nil { - data.Set("TimeLimit", fmt.Sprint(*params.TimeLimit)) -} -if params != nil && params.MachineDetection != nil { - data.Set("MachineDetection", *params.MachineDetection) -} -if params != nil && params.MachineDetectionTimeout != nil { - data.Set("MachineDetectionTimeout", fmt.Sprint(*params.MachineDetectionTimeout)) -} -if params != nil && params.MachineDetectionSpeechThreshold != nil { - data.Set("MachineDetectionSpeechThreshold", fmt.Sprint(*params.MachineDetectionSpeechThreshold)) -} -if params != nil && params.MachineDetectionSpeechEndThreshold != nil { - data.Set("MachineDetectionSpeechEndThreshold", fmt.Sprint(*params.MachineDetectionSpeechEndThreshold)) -} -if params != nil && params.MachineDetectionSilenceTimeout != nil { - data.Set("MachineDetectionSilenceTimeout", fmt.Sprint(*params.MachineDetectionSilenceTimeout)) -} -if params != nil && params.AmdStatusCallback != nil { - data.Set("AmdStatusCallback", *params.AmdStatusCallback) -} -if params != nil && params.AmdStatusCallbackMethod != nil { - data.Set("AmdStatusCallbackMethod", *params.AmdStatusCallbackMethod) -} -if params != nil && params.Trim != nil { - data.Set("Trim", *params.Trim) -} @@ -522,6 +523,7 @@ func (c *ApiService) DeleteParticipant(ConferenceSid string, CallSid string, par + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -559,6 +561,7 @@ func (c *ApiService) FetchParticipant(ConferenceSid string, CallSid string, para + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -628,18 +631,19 @@ func (c *ApiService) PageParticipant(ConferenceSid string, params *ListParticipa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Muted != nil { - data.Set("Muted", fmt.Sprint(*params.Muted)) -} -if params != nil && params.Hold != nil { - data.Set("Hold", fmt.Sprint(*params.Hold)) -} -if params != nil && params.Coaching != nil { - data.Set("Coaching", fmt.Sprint(*params.Coaching)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Muted != nil { + data.Set("Muted", fmt.Sprint(*params.Muted)) + } + if params != nil && params.Hold != nil { + data.Set("Hold", fmt.Sprint(*params.Hold)) + } + if params != nil && params.Coaching != nil { + data.Set("Coaching", fmt.Sprint(*params.Coaching)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -847,42 +851,43 @@ func (c *ApiService) UpdateParticipant(ConferenceSid string, CallSid string, par data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Muted != nil { - data.Set("Muted", fmt.Sprint(*params.Muted)) -} -if params != nil && params.Hold != nil { - data.Set("Hold", fmt.Sprint(*params.Hold)) -} -if params != nil && params.HoldUrl != nil { - data.Set("HoldUrl", *params.HoldUrl) -} -if params != nil && params.HoldMethod != nil { - data.Set("HoldMethod", *params.HoldMethod) -} -if params != nil && params.AnnounceUrl != nil { - data.Set("AnnounceUrl", *params.AnnounceUrl) -} -if params != nil && params.AnnounceMethod != nil { - data.Set("AnnounceMethod", *params.AnnounceMethod) -} -if params != nil && params.WaitUrl != nil { - data.Set("WaitUrl", *params.WaitUrl) -} -if params != nil && params.WaitMethod != nil { - data.Set("WaitMethod", *params.WaitMethod) -} -if params != nil && params.BeepOnExit != nil { - data.Set("BeepOnExit", fmt.Sprint(*params.BeepOnExit)) -} -if params != nil && params.EndConferenceOnExit != nil { - data.Set("EndConferenceOnExit", fmt.Sprint(*params.EndConferenceOnExit)) -} -if params != nil && params.Coaching != nil { - data.Set("Coaching", fmt.Sprint(*params.Coaching)) -} -if params != nil && params.CallSidToCoach != nil { - data.Set("CallSidToCoach", *params.CallSidToCoach) -} + + if params != nil && params.Muted != nil { + data.Set("Muted", fmt.Sprint(*params.Muted)) + } + if params != nil && params.Hold != nil { + data.Set("Hold", fmt.Sprint(*params.Hold)) + } + if params != nil && params.HoldUrl != nil { + data.Set("HoldUrl", *params.HoldUrl) + } + if params != nil && params.HoldMethod != nil { + data.Set("HoldMethod", *params.HoldMethod) + } + if params != nil && params.AnnounceUrl != nil { + data.Set("AnnounceUrl", *params.AnnounceUrl) + } + if params != nil && params.AnnounceMethod != nil { + data.Set("AnnounceMethod", *params.AnnounceMethod) + } + if params != nil && params.WaitUrl != nil { + data.Set("WaitUrl", *params.WaitUrl) + } + if params != nil && params.WaitMethod != nil { + data.Set("WaitMethod", *params.WaitMethod) + } + if params != nil && params.BeepOnExit != nil { + data.Set("BeepOnExit", fmt.Sprint(*params.BeepOnExit)) + } + if params != nil && params.EndConferenceOnExit != nil { + data.Set("EndConferenceOnExit", fmt.Sprint(*params.EndConferenceOnExit)) + } + if params != nil && params.Coaching != nil { + data.Set("Coaching", fmt.Sprint(*params.Coaching)) + } + if params != nil && params.CallSidToCoach != nil { + data.Set("CallSidToCoach", *params.CallSidToCoach) + } diff --git a/rest/api/v2010/accounts_conferences_recordings.go b/rest/api/v2010/accounts_conferences_recordings.go index 8a485543c..0049f053c 100644 --- a/rest/api/v2010/accounts_conferences_recordings.go +++ b/rest/api/v2010/accounts_conferences_recordings.go @@ -50,6 +50,7 @@ func (c *ApiService) DeleteConferenceRecording(ConferenceSid string, Sid string, + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -87,6 +88,7 @@ func (c *ApiService) FetchConferenceRecording(ConferenceSid string, Sid string, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -156,18 +158,19 @@ func (c *ApiService) PageConferenceRecording(ConferenceSid string, params *ListC data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint(*params.DateCreated)) -} -if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreated<", fmt.Sprint(*params.DateCreatedBefore)) -} -if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreated>", fmt.Sprint(*params.DateCreatedAfter)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint(*params.DateCreated)) + } + if params != nil && params.DateCreatedBefore != nil { + data.Set("DateCreated<", fmt.Sprint(*params.DateCreatedBefore)) + } + if params != nil && params.DateCreatedAfter != nil { + data.Set("DateCreated>", fmt.Sprint(*params.DateCreatedAfter)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -315,12 +318,13 @@ func (c *ApiService) UpdateConferenceRecording(ConferenceSid string, Sid string, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.PauseBehavior != nil { - data.Set("PauseBehavior", *params.PauseBehavior) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.PauseBehavior != nil { + data.Set("PauseBehavior", *params.PauseBehavior) + } diff --git a/rest/api/v2010/accounts_connect_apps.go b/rest/api/v2010/accounts_connect_apps.go index ff8d8a36c..b02690238 100644 --- a/rest/api/v2010/accounts_connect_apps.go +++ b/rest/api/v2010/accounts_connect_apps.go @@ -49,6 +49,7 @@ func (c *ApiService) DeleteConnectApp(Sid string, params *DeleteConnectAppParams + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -85,6 +86,7 @@ func (c *ApiService) FetchConnectApp(Sid string, params *FetchConnectAppParams) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -135,9 +137,10 @@ func (c *ApiService) PageConnectApp(params *ListConnectAppParams, pageToken, pag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -320,32 +323,33 @@ func (c *ApiService) UpdateConnectApp(Sid string, params *UpdateConnectAppParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.AuthorizeRedirectUrl != nil { - data.Set("AuthorizeRedirectUrl", *params.AuthorizeRedirectUrl) -} -if params != nil && params.CompanyName != nil { - data.Set("CompanyName", *params.CompanyName) -} -if params != nil && params.DeauthorizeCallbackMethod != nil { - data.Set("DeauthorizeCallbackMethod", *params.DeauthorizeCallbackMethod) -} -if params != nil && params.DeauthorizeCallbackUrl != nil { - data.Set("DeauthorizeCallbackUrl", *params.DeauthorizeCallbackUrl) -} -if params != nil && params.Description != nil { - data.Set("Description", *params.Description) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.HomepageUrl != nil { - data.Set("HomepageUrl", *params.HomepageUrl) -} -if params != nil && params.Permissions != nil { - for _, item := range *params.Permissions { - data.Add("Permissions", item) + + if params != nil && params.AuthorizeRedirectUrl != nil { + data.Set("AuthorizeRedirectUrl", *params.AuthorizeRedirectUrl) + } + if params != nil && params.CompanyName != nil { + data.Set("CompanyName", *params.CompanyName) + } + if params != nil && params.DeauthorizeCallbackMethod != nil { + data.Set("DeauthorizeCallbackMethod", *params.DeauthorizeCallbackMethod) + } + if params != nil && params.DeauthorizeCallbackUrl != nil { + data.Set("DeauthorizeCallbackUrl", *params.DeauthorizeCallbackUrl) + } + if params != nil && params.Description != nil { + data.Set("Description", *params.Description) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.HomepageUrl != nil { + data.Set("HomepageUrl", *params.HomepageUrl) + } + if params != nil && params.Permissions != nil { + for _, item := range *params.Permissions { + data.Add("Permissions", item) + } } -} diff --git a/rest/api/v2010/accounts_incoming_phone_numbers.go b/rest/api/v2010/accounts_incoming_phone_numbers.go index 514dd6b73..5444bbbd9 100644 --- a/rest/api/v2010/accounts_incoming_phone_numbers.go +++ b/rest/api/v2010/accounts_incoming_phone_numbers.go @@ -189,78 +189,79 @@ func (c *ApiService) CreateIncomingPhoneNumber(params *CreateIncomingPhoneNumber data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ApiVersion != nil { - data.Set("ApiVersion", *params.ApiVersion) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.SmsApplicationSid != nil { - data.Set("SmsApplicationSid", *params.SmsApplicationSid) -} -if params != nil && params.SmsFallbackMethod != nil { - data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) -} -if params != nil && params.SmsFallbackUrl != nil { - data.Set("SmsFallbackUrl", *params.SmsFallbackUrl) -} -if params != nil && params.SmsMethod != nil { - data.Set("SmsMethod", *params.SmsMethod) -} -if params != nil && params.SmsUrl != nil { - data.Set("SmsUrl", *params.SmsUrl) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.VoiceApplicationSid != nil { - data.Set("VoiceApplicationSid", *params.VoiceApplicationSid) -} -if params != nil && params.VoiceCallerIdLookup != nil { - data.Set("VoiceCallerIdLookup", fmt.Sprint(*params.VoiceCallerIdLookup)) -} -if params != nil && params.VoiceFallbackMethod != nil { - data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) -} -if params != nil && params.VoiceFallbackUrl != nil { - data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) -} -if params != nil && params.VoiceMethod != nil { - data.Set("VoiceMethod", *params.VoiceMethod) -} -if params != nil && params.VoiceUrl != nil { - data.Set("VoiceUrl", *params.VoiceUrl) -} -if params != nil && params.EmergencyStatus != nil { - data.Set("EmergencyStatus", *params.EmergencyStatus) -} -if params != nil && params.EmergencyAddressSid != nil { - data.Set("EmergencyAddressSid", *params.EmergencyAddressSid) -} -if params != nil && params.TrunkSid != nil { - data.Set("TrunkSid", *params.TrunkSid) -} -if params != nil && params.IdentitySid != nil { - data.Set("IdentitySid", *params.IdentitySid) -} -if params != nil && params.AddressSid != nil { - data.Set("AddressSid", *params.AddressSid) -} -if params != nil && params.VoiceReceiveMode != nil { - data.Set("VoiceReceiveMode", *params.VoiceReceiveMode) -} -if params != nil && params.BundleSid != nil { - data.Set("BundleSid", *params.BundleSid) -} -if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) -} -if params != nil && params.AreaCode != nil { - data.Set("AreaCode", *params.AreaCode) -} + + if params != nil && params.ApiVersion != nil { + data.Set("ApiVersion", *params.ApiVersion) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.SmsApplicationSid != nil { + data.Set("SmsApplicationSid", *params.SmsApplicationSid) + } + if params != nil && params.SmsFallbackMethod != nil { + data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) + } + if params != nil && params.SmsFallbackUrl != nil { + data.Set("SmsFallbackUrl", *params.SmsFallbackUrl) + } + if params != nil && params.SmsMethod != nil { + data.Set("SmsMethod", *params.SmsMethod) + } + if params != nil && params.SmsUrl != nil { + data.Set("SmsUrl", *params.SmsUrl) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.VoiceApplicationSid != nil { + data.Set("VoiceApplicationSid", *params.VoiceApplicationSid) + } + if params != nil && params.VoiceCallerIdLookup != nil { + data.Set("VoiceCallerIdLookup", fmt.Sprint(*params.VoiceCallerIdLookup)) + } + if params != nil && params.VoiceFallbackMethod != nil { + data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) + } + if params != nil && params.VoiceFallbackUrl != nil { + data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) + } + if params != nil && params.VoiceMethod != nil { + data.Set("VoiceMethod", *params.VoiceMethod) + } + if params != nil && params.VoiceUrl != nil { + data.Set("VoiceUrl", *params.VoiceUrl) + } + if params != nil && params.EmergencyStatus != nil { + data.Set("EmergencyStatus", *params.EmergencyStatus) + } + if params != nil && params.EmergencyAddressSid != nil { + data.Set("EmergencyAddressSid", *params.EmergencyAddressSid) + } + if params != nil && params.TrunkSid != nil { + data.Set("TrunkSid", *params.TrunkSid) + } + if params != nil && params.IdentitySid != nil { + data.Set("IdentitySid", *params.IdentitySid) + } + if params != nil && params.AddressSid != nil { + data.Set("AddressSid", *params.AddressSid) + } + if params != nil && params.VoiceReceiveMode != nil { + data.Set("VoiceReceiveMode", *params.VoiceReceiveMode) + } + if params != nil && params.BundleSid != nil { + data.Set("BundleSid", *params.BundleSid) + } + if params != nil && params.PhoneNumber != nil { + data.Set("PhoneNumber", *params.PhoneNumber) + } + if params != nil && params.AreaCode != nil { + data.Set("AreaCode", *params.AreaCode) + } @@ -305,6 +306,7 @@ func (c *ApiService) DeleteIncomingPhoneNumber(Sid string, params *DeleteIncomin + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -341,6 +343,7 @@ func (c *ApiService) FetchIncomingPhoneNumber(Sid string, params *FetchIncomingP + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -415,21 +418,22 @@ func (c *ApiService) PageIncomingPhoneNumber(params *ListIncomingPhoneNumberPara data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) -} -if params != nil && params.Origin != nil { - data.Set("Origin", *params.Origin) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Beta != nil { + data.Set("Beta", fmt.Sprint(*params.Beta)) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.PhoneNumber != nil { + data.Set("PhoneNumber", *params.PhoneNumber) + } + if params != nil && params.Origin != nil { + data.Set("Origin", *params.Origin) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -702,75 +706,76 @@ func (c *ApiService) UpdateIncomingPhoneNumber(Sid string, params *UpdateIncomin data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.AccountSid != nil { - data.Set("AccountSid", *params.AccountSid) -} -if params != nil && params.ApiVersion != nil { - data.Set("ApiVersion", *params.ApiVersion) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.SmsApplicationSid != nil { - data.Set("SmsApplicationSid", *params.SmsApplicationSid) -} -if params != nil && params.SmsFallbackMethod != nil { - data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) -} -if params != nil && params.SmsFallbackUrl != nil { - data.Set("SmsFallbackUrl", *params.SmsFallbackUrl) -} -if params != nil && params.SmsMethod != nil { - data.Set("SmsMethod", *params.SmsMethod) -} -if params != nil && params.SmsUrl != nil { - data.Set("SmsUrl", *params.SmsUrl) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.VoiceApplicationSid != nil { - data.Set("VoiceApplicationSid", *params.VoiceApplicationSid) -} -if params != nil && params.VoiceCallerIdLookup != nil { - data.Set("VoiceCallerIdLookup", fmt.Sprint(*params.VoiceCallerIdLookup)) -} -if params != nil && params.VoiceFallbackMethod != nil { - data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) -} -if params != nil && params.VoiceFallbackUrl != nil { - data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) -} -if params != nil && params.VoiceMethod != nil { - data.Set("VoiceMethod", *params.VoiceMethod) -} -if params != nil && params.VoiceUrl != nil { - data.Set("VoiceUrl", *params.VoiceUrl) -} -if params != nil && params.EmergencyStatus != nil { - data.Set("EmergencyStatus", *params.EmergencyStatus) -} -if params != nil && params.EmergencyAddressSid != nil { - data.Set("EmergencyAddressSid", *params.EmergencyAddressSid) -} -if params != nil && params.TrunkSid != nil { - data.Set("TrunkSid", *params.TrunkSid) -} -if params != nil && params.VoiceReceiveMode != nil { - data.Set("VoiceReceiveMode", *params.VoiceReceiveMode) -} -if params != nil && params.IdentitySid != nil { - data.Set("IdentitySid", *params.IdentitySid) -} -if params != nil && params.AddressSid != nil { - data.Set("AddressSid", *params.AddressSid) -} -if params != nil && params.BundleSid != nil { - data.Set("BundleSid", *params.BundleSid) -} + + if params != nil && params.AccountSid != nil { + data.Set("AccountSid", *params.AccountSid) + } + if params != nil && params.ApiVersion != nil { + data.Set("ApiVersion", *params.ApiVersion) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.SmsApplicationSid != nil { + data.Set("SmsApplicationSid", *params.SmsApplicationSid) + } + if params != nil && params.SmsFallbackMethod != nil { + data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) + } + if params != nil && params.SmsFallbackUrl != nil { + data.Set("SmsFallbackUrl", *params.SmsFallbackUrl) + } + if params != nil && params.SmsMethod != nil { + data.Set("SmsMethod", *params.SmsMethod) + } + if params != nil && params.SmsUrl != nil { + data.Set("SmsUrl", *params.SmsUrl) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.VoiceApplicationSid != nil { + data.Set("VoiceApplicationSid", *params.VoiceApplicationSid) + } + if params != nil && params.VoiceCallerIdLookup != nil { + data.Set("VoiceCallerIdLookup", fmt.Sprint(*params.VoiceCallerIdLookup)) + } + if params != nil && params.VoiceFallbackMethod != nil { + data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) + } + if params != nil && params.VoiceFallbackUrl != nil { + data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) + } + if params != nil && params.VoiceMethod != nil { + data.Set("VoiceMethod", *params.VoiceMethod) + } + if params != nil && params.VoiceUrl != nil { + data.Set("VoiceUrl", *params.VoiceUrl) + } + if params != nil && params.EmergencyStatus != nil { + data.Set("EmergencyStatus", *params.EmergencyStatus) + } + if params != nil && params.EmergencyAddressSid != nil { + data.Set("EmergencyAddressSid", *params.EmergencyAddressSid) + } + if params != nil && params.TrunkSid != nil { + data.Set("TrunkSid", *params.TrunkSid) + } + if params != nil && params.VoiceReceiveMode != nil { + data.Set("VoiceReceiveMode", *params.VoiceReceiveMode) + } + if params != nil && params.IdentitySid != nil { + data.Set("IdentitySid", *params.IdentitySid) + } + if params != nil && params.AddressSid != nil { + data.Set("AddressSid", *params.AddressSid) + } + if params != nil && params.BundleSid != nil { + data.Set("BundleSid", *params.BundleSid) + } 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 dbaf32128..ebeb2c9f5 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 @@ -52,9 +52,10 @@ func (c *ApiService) CreateIncomingPhoneNumberAssignedAddOn(ResourceSid string, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.InstalledAddOnSid != nil { - data.Set("InstalledAddOnSid", *params.InstalledAddOnSid) -} + + if params != nil && params.InstalledAddOnSid != nil { + data.Set("InstalledAddOnSid", *params.InstalledAddOnSid) + } @@ -100,6 +101,7 @@ func (c *ApiService) DeleteIncomingPhoneNumberAssignedAddOn(ResourceSid string, + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -137,6 +139,7 @@ func (c *ApiService) FetchIncomingPhoneNumberAssignedAddOn(ResourceSid string, S + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -188,9 +191,10 @@ func (c *ApiService) PageIncomingPhoneNumberAssignedAddOn(ResourceSid string, pa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) 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 5c10f1828..9e332e914 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 @@ -51,6 +51,7 @@ func (c *ApiService) FetchIncomingPhoneNumberAssignedAddOnExtension(ResourceSid + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -103,9 +104,10 @@ func (c *ApiService) PageIncomingPhoneNumberAssignedAddOnExtension(ResourceSid s data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_incoming_phone_numbers_local.go b/rest/api/v2010/accounts_incoming_phone_numbers_local.go index 2fd764a1d..401cd19a2 100644 --- a/rest/api/v2010/accounts_incoming_phone_numbers_local.go +++ b/rest/api/v2010/accounts_incoming_phone_numbers_local.go @@ -183,75 +183,76 @@ func (c *ApiService) CreateIncomingPhoneNumberLocal(params *CreateIncomingPhoneN data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) -} -if params != nil && params.ApiVersion != nil { - data.Set("ApiVersion", *params.ApiVersion) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.SmsApplicationSid != nil { - data.Set("SmsApplicationSid", *params.SmsApplicationSid) -} -if params != nil && params.SmsFallbackMethod != nil { - data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) -} -if params != nil && params.SmsFallbackUrl != nil { - data.Set("SmsFallbackUrl", *params.SmsFallbackUrl) -} -if params != nil && params.SmsMethod != nil { - data.Set("SmsMethod", *params.SmsMethod) -} -if params != nil && params.SmsUrl != nil { - data.Set("SmsUrl", *params.SmsUrl) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.VoiceApplicationSid != nil { - data.Set("VoiceApplicationSid", *params.VoiceApplicationSid) -} -if params != nil && params.VoiceCallerIdLookup != nil { - data.Set("VoiceCallerIdLookup", fmt.Sprint(*params.VoiceCallerIdLookup)) -} -if params != nil && params.VoiceFallbackMethod != nil { - data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) -} -if params != nil && params.VoiceFallbackUrl != nil { - data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) -} -if params != nil && params.VoiceMethod != nil { - data.Set("VoiceMethod", *params.VoiceMethod) -} -if params != nil && params.VoiceUrl != nil { - data.Set("VoiceUrl", *params.VoiceUrl) -} -if params != nil && params.IdentitySid != nil { - data.Set("IdentitySid", *params.IdentitySid) -} -if params != nil && params.AddressSid != nil { - data.Set("AddressSid", *params.AddressSid) -} -if params != nil && params.EmergencyStatus != nil { - data.Set("EmergencyStatus", *params.EmergencyStatus) -} -if params != nil && params.EmergencyAddressSid != nil { - data.Set("EmergencyAddressSid", *params.EmergencyAddressSid) -} -if params != nil && params.TrunkSid != nil { - data.Set("TrunkSid", *params.TrunkSid) -} -if params != nil && params.VoiceReceiveMode != nil { - data.Set("VoiceReceiveMode", *params.VoiceReceiveMode) -} -if params != nil && params.BundleSid != nil { - data.Set("BundleSid", *params.BundleSid) -} + + if params != nil && params.PhoneNumber != nil { + data.Set("PhoneNumber", *params.PhoneNumber) + } + if params != nil && params.ApiVersion != nil { + data.Set("ApiVersion", *params.ApiVersion) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.SmsApplicationSid != nil { + data.Set("SmsApplicationSid", *params.SmsApplicationSid) + } + if params != nil && params.SmsFallbackMethod != nil { + data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) + } + if params != nil && params.SmsFallbackUrl != nil { + data.Set("SmsFallbackUrl", *params.SmsFallbackUrl) + } + if params != nil && params.SmsMethod != nil { + data.Set("SmsMethod", *params.SmsMethod) + } + if params != nil && params.SmsUrl != nil { + data.Set("SmsUrl", *params.SmsUrl) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.VoiceApplicationSid != nil { + data.Set("VoiceApplicationSid", *params.VoiceApplicationSid) + } + if params != nil && params.VoiceCallerIdLookup != nil { + data.Set("VoiceCallerIdLookup", fmt.Sprint(*params.VoiceCallerIdLookup)) + } + if params != nil && params.VoiceFallbackMethod != nil { + data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) + } + if params != nil && params.VoiceFallbackUrl != nil { + data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) + } + if params != nil && params.VoiceMethod != nil { + data.Set("VoiceMethod", *params.VoiceMethod) + } + if params != nil && params.VoiceUrl != nil { + data.Set("VoiceUrl", *params.VoiceUrl) + } + if params != nil && params.IdentitySid != nil { + data.Set("IdentitySid", *params.IdentitySid) + } + if params != nil && params.AddressSid != nil { + data.Set("AddressSid", *params.AddressSid) + } + if params != nil && params.EmergencyStatus != nil { + data.Set("EmergencyStatus", *params.EmergencyStatus) + } + if params != nil && params.EmergencyAddressSid != nil { + data.Set("EmergencyAddressSid", *params.EmergencyAddressSid) + } + if params != nil && params.TrunkSid != nil { + data.Set("TrunkSid", *params.TrunkSid) + } + if params != nil && params.VoiceReceiveMode != nil { + data.Set("VoiceReceiveMode", *params.VoiceReceiveMode) + } + if params != nil && params.BundleSid != nil { + data.Set("BundleSid", *params.BundleSid) + } @@ -329,21 +330,22 @@ func (c *ApiService) PageIncomingPhoneNumberLocal(params *ListIncomingPhoneNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) -} -if params != nil && params.Origin != nil { - data.Set("Origin", *params.Origin) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Beta != nil { + data.Set("Beta", fmt.Sprint(*params.Beta)) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.PhoneNumber != nil { + data.Set("PhoneNumber", *params.PhoneNumber) + } + if params != nil && params.Origin != nil { + data.Set("Origin", *params.Origin) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_incoming_phone_numbers_mobile.go b/rest/api/v2010/accounts_incoming_phone_numbers_mobile.go index ee4cab0c0..a7e8485ee 100644 --- a/rest/api/v2010/accounts_incoming_phone_numbers_mobile.go +++ b/rest/api/v2010/accounts_incoming_phone_numbers_mobile.go @@ -183,75 +183,76 @@ func (c *ApiService) CreateIncomingPhoneNumberMobile(params *CreateIncomingPhone data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) -} -if params != nil && params.ApiVersion != nil { - data.Set("ApiVersion", *params.ApiVersion) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.SmsApplicationSid != nil { - data.Set("SmsApplicationSid", *params.SmsApplicationSid) -} -if params != nil && params.SmsFallbackMethod != nil { - data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) -} -if params != nil && params.SmsFallbackUrl != nil { - data.Set("SmsFallbackUrl", *params.SmsFallbackUrl) -} -if params != nil && params.SmsMethod != nil { - data.Set("SmsMethod", *params.SmsMethod) -} -if params != nil && params.SmsUrl != nil { - data.Set("SmsUrl", *params.SmsUrl) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.VoiceApplicationSid != nil { - data.Set("VoiceApplicationSid", *params.VoiceApplicationSid) -} -if params != nil && params.VoiceCallerIdLookup != nil { - data.Set("VoiceCallerIdLookup", fmt.Sprint(*params.VoiceCallerIdLookup)) -} -if params != nil && params.VoiceFallbackMethod != nil { - data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) -} -if params != nil && params.VoiceFallbackUrl != nil { - data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) -} -if params != nil && params.VoiceMethod != nil { - data.Set("VoiceMethod", *params.VoiceMethod) -} -if params != nil && params.VoiceUrl != nil { - data.Set("VoiceUrl", *params.VoiceUrl) -} -if params != nil && params.IdentitySid != nil { - data.Set("IdentitySid", *params.IdentitySid) -} -if params != nil && params.AddressSid != nil { - data.Set("AddressSid", *params.AddressSid) -} -if params != nil && params.EmergencyStatus != nil { - data.Set("EmergencyStatus", *params.EmergencyStatus) -} -if params != nil && params.EmergencyAddressSid != nil { - data.Set("EmergencyAddressSid", *params.EmergencyAddressSid) -} -if params != nil && params.TrunkSid != nil { - data.Set("TrunkSid", *params.TrunkSid) -} -if params != nil && params.VoiceReceiveMode != nil { - data.Set("VoiceReceiveMode", *params.VoiceReceiveMode) -} -if params != nil && params.BundleSid != nil { - data.Set("BundleSid", *params.BundleSid) -} + + if params != nil && params.PhoneNumber != nil { + data.Set("PhoneNumber", *params.PhoneNumber) + } + if params != nil && params.ApiVersion != nil { + data.Set("ApiVersion", *params.ApiVersion) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.SmsApplicationSid != nil { + data.Set("SmsApplicationSid", *params.SmsApplicationSid) + } + if params != nil && params.SmsFallbackMethod != nil { + data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) + } + if params != nil && params.SmsFallbackUrl != nil { + data.Set("SmsFallbackUrl", *params.SmsFallbackUrl) + } + if params != nil && params.SmsMethod != nil { + data.Set("SmsMethod", *params.SmsMethod) + } + if params != nil && params.SmsUrl != nil { + data.Set("SmsUrl", *params.SmsUrl) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.VoiceApplicationSid != nil { + data.Set("VoiceApplicationSid", *params.VoiceApplicationSid) + } + if params != nil && params.VoiceCallerIdLookup != nil { + data.Set("VoiceCallerIdLookup", fmt.Sprint(*params.VoiceCallerIdLookup)) + } + if params != nil && params.VoiceFallbackMethod != nil { + data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) + } + if params != nil && params.VoiceFallbackUrl != nil { + data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) + } + if params != nil && params.VoiceMethod != nil { + data.Set("VoiceMethod", *params.VoiceMethod) + } + if params != nil && params.VoiceUrl != nil { + data.Set("VoiceUrl", *params.VoiceUrl) + } + if params != nil && params.IdentitySid != nil { + data.Set("IdentitySid", *params.IdentitySid) + } + if params != nil && params.AddressSid != nil { + data.Set("AddressSid", *params.AddressSid) + } + if params != nil && params.EmergencyStatus != nil { + data.Set("EmergencyStatus", *params.EmergencyStatus) + } + if params != nil && params.EmergencyAddressSid != nil { + data.Set("EmergencyAddressSid", *params.EmergencyAddressSid) + } + if params != nil && params.TrunkSid != nil { + data.Set("TrunkSid", *params.TrunkSid) + } + if params != nil && params.VoiceReceiveMode != nil { + data.Set("VoiceReceiveMode", *params.VoiceReceiveMode) + } + if params != nil && params.BundleSid != nil { + data.Set("BundleSid", *params.BundleSid) + } @@ -329,21 +330,22 @@ func (c *ApiService) PageIncomingPhoneNumberMobile(params *ListIncomingPhoneNumb data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) -} -if params != nil && params.Origin != nil { - data.Set("Origin", *params.Origin) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Beta != nil { + data.Set("Beta", fmt.Sprint(*params.Beta)) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.PhoneNumber != nil { + data.Set("PhoneNumber", *params.PhoneNumber) + } + if params != nil && params.Origin != nil { + data.Set("Origin", *params.Origin) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) 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 d13e0ce99..0075b902f 100644 --- a/rest/api/v2010/accounts_incoming_phone_numbers_toll_free.go +++ b/rest/api/v2010/accounts_incoming_phone_numbers_toll_free.go @@ -183,75 +183,76 @@ func (c *ApiService) CreateIncomingPhoneNumberTollFree(params *CreateIncomingPho data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) -} -if params != nil && params.ApiVersion != nil { - data.Set("ApiVersion", *params.ApiVersion) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.SmsApplicationSid != nil { - data.Set("SmsApplicationSid", *params.SmsApplicationSid) -} -if params != nil && params.SmsFallbackMethod != nil { - data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) -} -if params != nil && params.SmsFallbackUrl != nil { - data.Set("SmsFallbackUrl", *params.SmsFallbackUrl) -} -if params != nil && params.SmsMethod != nil { - data.Set("SmsMethod", *params.SmsMethod) -} -if params != nil && params.SmsUrl != nil { - data.Set("SmsUrl", *params.SmsUrl) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.VoiceApplicationSid != nil { - data.Set("VoiceApplicationSid", *params.VoiceApplicationSid) -} -if params != nil && params.VoiceCallerIdLookup != nil { - data.Set("VoiceCallerIdLookup", fmt.Sprint(*params.VoiceCallerIdLookup)) -} -if params != nil && params.VoiceFallbackMethod != nil { - data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) -} -if params != nil && params.VoiceFallbackUrl != nil { - data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) -} -if params != nil && params.VoiceMethod != nil { - data.Set("VoiceMethod", *params.VoiceMethod) -} -if params != nil && params.VoiceUrl != nil { - data.Set("VoiceUrl", *params.VoiceUrl) -} -if params != nil && params.IdentitySid != nil { - data.Set("IdentitySid", *params.IdentitySid) -} -if params != nil && params.AddressSid != nil { - data.Set("AddressSid", *params.AddressSid) -} -if params != nil && params.EmergencyStatus != nil { - data.Set("EmergencyStatus", *params.EmergencyStatus) -} -if params != nil && params.EmergencyAddressSid != nil { - data.Set("EmergencyAddressSid", *params.EmergencyAddressSid) -} -if params != nil && params.TrunkSid != nil { - data.Set("TrunkSid", *params.TrunkSid) -} -if params != nil && params.VoiceReceiveMode != nil { - data.Set("VoiceReceiveMode", *params.VoiceReceiveMode) -} -if params != nil && params.BundleSid != nil { - data.Set("BundleSid", *params.BundleSid) -} + + if params != nil && params.PhoneNumber != nil { + data.Set("PhoneNumber", *params.PhoneNumber) + } + if params != nil && params.ApiVersion != nil { + data.Set("ApiVersion", *params.ApiVersion) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.SmsApplicationSid != nil { + data.Set("SmsApplicationSid", *params.SmsApplicationSid) + } + if params != nil && params.SmsFallbackMethod != nil { + data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) + } + if params != nil && params.SmsFallbackUrl != nil { + data.Set("SmsFallbackUrl", *params.SmsFallbackUrl) + } + if params != nil && params.SmsMethod != nil { + data.Set("SmsMethod", *params.SmsMethod) + } + if params != nil && params.SmsUrl != nil { + data.Set("SmsUrl", *params.SmsUrl) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.VoiceApplicationSid != nil { + data.Set("VoiceApplicationSid", *params.VoiceApplicationSid) + } + if params != nil && params.VoiceCallerIdLookup != nil { + data.Set("VoiceCallerIdLookup", fmt.Sprint(*params.VoiceCallerIdLookup)) + } + if params != nil && params.VoiceFallbackMethod != nil { + data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) + } + if params != nil && params.VoiceFallbackUrl != nil { + data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) + } + if params != nil && params.VoiceMethod != nil { + data.Set("VoiceMethod", *params.VoiceMethod) + } + if params != nil && params.VoiceUrl != nil { + data.Set("VoiceUrl", *params.VoiceUrl) + } + if params != nil && params.IdentitySid != nil { + data.Set("IdentitySid", *params.IdentitySid) + } + if params != nil && params.AddressSid != nil { + data.Set("AddressSid", *params.AddressSid) + } + if params != nil && params.EmergencyStatus != nil { + data.Set("EmergencyStatus", *params.EmergencyStatus) + } + if params != nil && params.EmergencyAddressSid != nil { + data.Set("EmergencyAddressSid", *params.EmergencyAddressSid) + } + if params != nil && params.TrunkSid != nil { + data.Set("TrunkSid", *params.TrunkSid) + } + if params != nil && params.VoiceReceiveMode != nil { + data.Set("VoiceReceiveMode", *params.VoiceReceiveMode) + } + if params != nil && params.BundleSid != nil { + data.Set("BundleSid", *params.BundleSid) + } @@ -329,21 +330,22 @@ func (c *ApiService) PageIncomingPhoneNumberTollFree(params *ListIncomingPhoneNu data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Beta != nil { - data.Set("Beta", fmt.Sprint(*params.Beta)) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) -} -if params != nil && params.Origin != nil { - data.Set("Origin", *params.Origin) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Beta != nil { + data.Set("Beta", fmt.Sprint(*params.Beta)) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.PhoneNumber != nil { + data.Set("PhoneNumber", *params.PhoneNumber) + } + if params != nil && params.Origin != nil { + data.Set("Origin", *params.Origin) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_keys.go b/rest/api/v2010/accounts_keys.go index 58a74f2d6..e97a337fa 100644 --- a/rest/api/v2010/accounts_keys.go +++ b/rest/api/v2010/accounts_keys.go @@ -51,9 +51,10 @@ func (c *ApiService) CreateNewKey(params *CreateNewKeyParams) (*ApiV2010NewKey, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } @@ -98,6 +99,7 @@ func (c *ApiService) DeleteKey(Sid string, params *DeleteKeyParams) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -134,6 +136,7 @@ func (c *ApiService) FetchKey(Sid string, params *FetchKeyParams) (*ApiV2010Key, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -184,9 +187,10 @@ func (c *ApiService) PageKey(params *ListKeyParams, pageToken, pageNumber string data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -327,9 +331,10 @@ func (c *ApiService) UpdateKey(Sid string, params *UpdateKeyParams) (*ApiV2010Ke data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } diff --git a/rest/api/v2010/accounts_messages.go b/rest/api/v2010/accounts_messages.go index bdca4903e..344e21fe3 100644 --- a/rest/api/v2010/accounts_messages.go +++ b/rest/api/v2010/accounts_messages.go @@ -183,79 +183,80 @@ func (c *ApiService) CreateMessage(params *CreateMessageParams) (*ApiV2010Messag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.To != nil { - data.Set("To", *params.To) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.ApplicationSid != nil { - data.Set("ApplicationSid", *params.ApplicationSid) -} -if params != nil && params.MaxPrice != nil { - data.Set("MaxPrice", fmt.Sprint(*params.MaxPrice)) -} -if params != nil && params.ProvideFeedback != nil { - data.Set("ProvideFeedback", fmt.Sprint(*params.ProvideFeedback)) -} -if params != nil && params.Attempt != nil { - data.Set("Attempt", fmt.Sprint(*params.Attempt)) -} -if params != nil && params.ValidityPeriod != nil { - data.Set("ValidityPeriod", fmt.Sprint(*params.ValidityPeriod)) -} -if params != nil && params.ForceDelivery != nil { - data.Set("ForceDelivery", fmt.Sprint(*params.ForceDelivery)) -} -if params != nil && params.ContentRetention != nil { - data.Set("ContentRetention", *params.ContentRetention) -} -if params != nil && params.AddressRetention != nil { - data.Set("AddressRetention", *params.AddressRetention) -} -if params != nil && params.SmartEncoded != nil { - data.Set("SmartEncoded", fmt.Sprint(*params.SmartEncoded)) -} -if params != nil && params.PersistentAction != nil { - for _, item := range *params.PersistentAction { - data.Add("PersistentAction", item) + + if params != nil && params.To != nil { + data.Set("To", *params.To) } -} -if params != nil && params.ShortenUrls != nil { - data.Set("ShortenUrls", fmt.Sprint(*params.ShortenUrls)) -} -if params != nil && params.ScheduleType != nil { - data.Set("ScheduleType", *params.ScheduleType) -} -if params != nil && params.SendAt != nil { - data.Set("SendAt", fmt.Sprint((*params.SendAt).Format(time.RFC3339))) -} -if params != nil && params.SendAsMms != nil { - data.Set("SendAsMms", fmt.Sprint(*params.SendAsMms)) -} -if params != nil && params.ContentVariables != nil { - data.Set("ContentVariables", *params.ContentVariables) -} -if params != nil && params.RiskCheck != nil { - data.Set("RiskCheck", *params.RiskCheck) -} -if params != nil && params.From != nil { - data.Set("From", *params.From) -} -if params != nil && params.MessagingServiceSid != nil { - data.Set("MessagingServiceSid", *params.MessagingServiceSid) -} -if params != nil && params.Body != nil { - data.Set("Body", *params.Body) -} -if params != nil && params.MediaUrl != nil { - for _, item := range *params.MediaUrl { - data.Add("MediaUrl", item) + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.ApplicationSid != nil { + data.Set("ApplicationSid", *params.ApplicationSid) + } + if params != nil && params.MaxPrice != nil { + data.Set("MaxPrice", fmt.Sprint(*params.MaxPrice)) + } + if params != nil && params.ProvideFeedback != nil { + data.Set("ProvideFeedback", fmt.Sprint(*params.ProvideFeedback)) + } + if params != nil && params.Attempt != nil { + data.Set("Attempt", fmt.Sprint(*params.Attempt)) + } + if params != nil && params.ValidityPeriod != nil { + data.Set("ValidityPeriod", fmt.Sprint(*params.ValidityPeriod)) + } + if params != nil && params.ForceDelivery != nil { + data.Set("ForceDelivery", fmt.Sprint(*params.ForceDelivery)) + } + if params != nil && params.ContentRetention != nil { + data.Set("ContentRetention", *params.ContentRetention) + } + if params != nil && params.AddressRetention != nil { + data.Set("AddressRetention", *params.AddressRetention) + } + if params != nil && params.SmartEncoded != nil { + data.Set("SmartEncoded", fmt.Sprint(*params.SmartEncoded)) + } + if params != nil && params.PersistentAction != nil { + for _, item := range *params.PersistentAction { + data.Add("PersistentAction", item) + } + } + if params != nil && params.ShortenUrls != nil { + data.Set("ShortenUrls", fmt.Sprint(*params.ShortenUrls)) + } + if params != nil && params.ScheduleType != nil { + data.Set("ScheduleType", *params.ScheduleType) + } + if params != nil && params.SendAt != nil { + data.Set("SendAt", fmt.Sprint((*params.SendAt).Format(time.RFC3339))) + } + if params != nil && params.SendAsMms != nil { + data.Set("SendAsMms", fmt.Sprint(*params.SendAsMms)) + } + if params != nil && params.ContentVariables != nil { + data.Set("ContentVariables", *params.ContentVariables) + } + if params != nil && params.RiskCheck != nil { + data.Set("RiskCheck", *params.RiskCheck) + } + if params != nil && params.From != nil { + data.Set("From", *params.From) + } + if params != nil && params.MessagingServiceSid != nil { + data.Set("MessagingServiceSid", *params.MessagingServiceSid) + } + if params != nil && params.Body != nil { + data.Set("Body", *params.Body) + } + if params != nil && params.MediaUrl != nil { + for _, item := range *params.MediaUrl { + data.Add("MediaUrl", item) + } + } + if params != nil && params.ContentSid != nil { + data.Set("ContentSid", *params.ContentSid) } -} -if params != nil && params.ContentSid != nil { - data.Set("ContentSid", *params.ContentSid) -} @@ -300,6 +301,7 @@ func (c *ApiService) DeleteMessage(Sid string, params *DeleteMessageParams) (err + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -336,6 +338,7 @@ func (c *ApiService) FetchMessage(Sid string, params *FetchMessageParams) (*ApiV + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -404,18 +407,19 @@ func (c *ApiService) PageMessage(params *ListMessageParams, pageToken, pageNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.To != nil { - data.Set("To", *params.To) -} -if params != nil && params.From != nil { - data.Set("From", *params.From) -} -if params != nil && params.DateSent != nil { - data.Set("DateSent", fmt.Sprint((*params.DateSent).Format(time.RFC3339))) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.To != nil { + data.Set("To", *params.To) + } + if params != nil && params.From != nil { + data.Set("From", *params.From) + } + if params != nil && params.DateSent != nil { + data.Set("DateSent", fmt.Sprint((*params.DateSent).Format(time.RFC3339))) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -562,12 +566,13 @@ func (c *ApiService) UpdateMessage(Sid string, params *UpdateMessageParams) (*Ap data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Body != nil { - data.Set("Body", *params.Body) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} + + if params != nil && params.Body != nil { + data.Set("Body", *params.Body) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } diff --git a/rest/api/v2010/accounts_messages_feedback.go b/rest/api/v2010/accounts_messages_feedback.go index be1947176..cd2e8b6bb 100644 --- a/rest/api/v2010/accounts_messages_feedback.go +++ b/rest/api/v2010/accounts_messages_feedback.go @@ -52,9 +52,10 @@ func (c *ApiService) CreateMessageFeedback(MessageSid string, params *CreateMess data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Outcome != nil { - data.Set("Outcome", *params.Outcome) -} + + if params != nil && params.Outcome != nil { + data.Set("Outcome", *params.Outcome) + } diff --git a/rest/api/v2010/accounts_messages_media.go b/rest/api/v2010/accounts_messages_media.go index 40774cb25..f4862f061 100644 --- a/rest/api/v2010/accounts_messages_media.go +++ b/rest/api/v2010/accounts_messages_media.go @@ -50,6 +50,7 @@ func (c *ApiService) DeleteMedia(MessageSid string, Sid string, params *DeleteMe + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -87,6 +88,7 @@ func (c *ApiService) FetchMedia(MessageSid string, Sid string, params *FetchMedi + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -156,18 +158,19 @@ func (c *ApiService) PageMedia(MessageSid string, params *ListMediaParams, pageT data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreated<", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) -} -if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreated>", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateCreatedBefore != nil { + data.Set("DateCreated<", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) + } + if params != nil && params.DateCreatedAfter != nil { + data.Set("DateCreated>", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_notifications.go b/rest/api/v2010/accounts_notifications.go index d323b6a80..79ec2d5de 100644 --- a/rest/api/v2010/accounts_notifications.go +++ b/rest/api/v2010/accounts_notifications.go @@ -49,6 +49,7 @@ func (c *ApiService) FetchNotification(Sid string, params *FetchNotificationPara + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -123,21 +124,22 @@ func (c *ApiService) PageNotification(params *ListNotificationParams, pageToken, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Log != nil { - data.Set("Log", fmt.Sprint(*params.Log)) -} -if params != nil && params.MessageDate != nil { - data.Set("MessageDate", fmt.Sprint(*params.MessageDate)) -} -if params != nil && params.MessageDateBefore != nil { - data.Set("MessageDate<", fmt.Sprint(*params.MessageDateBefore)) -} -if params != nil && params.MessageDateAfter != nil { - data.Set("MessageDate>", fmt.Sprint(*params.MessageDateAfter)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Log != nil { + data.Set("Log", fmt.Sprint(*params.Log)) + } + if params != nil && params.MessageDate != nil { + data.Set("MessageDate", fmt.Sprint(*params.MessageDate)) + } + if params != nil && params.MessageDateBefore != nil { + data.Set("MessageDate<", fmt.Sprint(*params.MessageDateBefore)) + } + if params != nil && params.MessageDateAfter != nil { + data.Set("MessageDate>", fmt.Sprint(*params.MessageDateAfter)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_outgoing_caller_ids.go b/rest/api/v2010/accounts_outgoing_caller_ids.go index 2570d75ae..99e592b10 100644 --- a/rest/api/v2010/accounts_outgoing_caller_ids.go +++ b/rest/api/v2010/accounts_outgoing_caller_ids.go @@ -81,24 +81,25 @@ func (c *ApiService) CreateValidationRequest(params *CreateValidationRequestPara data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.CallDelay != nil { - data.Set("CallDelay", fmt.Sprint(*params.CallDelay)) -} -if params != nil && params.Extension != nil { - data.Set("Extension", *params.Extension) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} + + if params != nil && params.PhoneNumber != nil { + data.Set("PhoneNumber", *params.PhoneNumber) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.CallDelay != nil { + data.Set("CallDelay", fmt.Sprint(*params.CallDelay)) + } + if params != nil && params.Extension != nil { + data.Set("Extension", *params.Extension) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } @@ -143,6 +144,7 @@ func (c *ApiService) DeleteOutgoingCallerId(Sid string, params *DeleteOutgoingCa + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -179,6 +181,7 @@ func (c *ApiService) FetchOutgoingCallerId(Sid string, params *FetchOutgoingCall + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -241,15 +244,16 @@ func (c *ApiService) PageOutgoingCallerId(params *ListOutgoingCallerIdParams, pa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PhoneNumber != nil { + data.Set("PhoneNumber", *params.PhoneNumber) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -390,9 +394,10 @@ func (c *ApiService) UpdateOutgoingCallerId(Sid string, params *UpdateOutgoingCa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } diff --git a/rest/api/v2010/accounts_queues.go b/rest/api/v2010/accounts_queues.go index 32fe10158..8be1ead8e 100644 --- a/rest/api/v2010/accounts_queues.go +++ b/rest/api/v2010/accounts_queues.go @@ -57,12 +57,13 @@ func (c *ApiService) CreateQueue(params *CreateQueueParams) (*ApiV2010Queue, err 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)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.MaxSize != nil { + data.Set("MaxSize", fmt.Sprint(*params.MaxSize)) + } @@ -107,6 +108,7 @@ func (c *ApiService) DeleteQueue(Sid string, params *DeleteQueueParams) (error) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -143,6 +145,7 @@ func (c *ApiService) FetchQueue(Sid string, params *FetchQueueParams) (*ApiV2010 + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -193,9 +196,10 @@ func (c *ApiService) PageQueue(params *ListQueueParams, pageToken, pageNumber st data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -342,12 +346,13 @@ func (c *ApiService) UpdateQueue(Sid string, params *UpdateQueueParams) (*ApiV20 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)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.MaxSize != nil { + data.Set("MaxSize", fmt.Sprint(*params.MaxSize)) + } diff --git a/rest/api/v2010/accounts_queues_members.go b/rest/api/v2010/accounts_queues_members.go index 7ac167200..6df675c0f 100644 --- a/rest/api/v2010/accounts_queues_members.go +++ b/rest/api/v2010/accounts_queues_members.go @@ -50,6 +50,7 @@ func (c *ApiService) FetchMember(QueueSid string, CallSid string, params *FetchM + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -101,9 +102,10 @@ func (c *ApiService) PageMember(QueueSid string, params *ListMemberParams, pageT data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -251,12 +253,13 @@ func (c *ApiService) UpdateMember(QueueSid string, CallSid string, params *Updat data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Url != nil { - data.Set("Url", *params.Url) -} -if params != nil && params.Method != nil { - data.Set("Method", *params.Method) -} + + if params != nil && params.Url != nil { + data.Set("Url", *params.Url) + } + if params != nil && params.Method != nil { + data.Set("Method", *params.Method) + } diff --git a/rest/api/v2010/accounts_recordings.go b/rest/api/v2010/accounts_recordings.go index 19eaba894..c8173eff4 100644 --- a/rest/api/v2010/accounts_recordings.go +++ b/rest/api/v2010/accounts_recordings.go @@ -49,6 +49,7 @@ func (c *ApiService) DeleteRecording(Sid string, params *DeleteRecordingParams) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -88,9 +89,10 @@ func (c *ApiService) FetchRecording(Sid string, params *FetchRecordingParams) (* data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.IncludeSoftDeleted != nil { - data.Set("IncludeSoftDeleted", fmt.Sprint(*params.IncludeSoftDeleted)) -} + + if params != nil && params.IncludeSoftDeleted != nil { + data.Set("IncludeSoftDeleted", fmt.Sprint(*params.IncludeSoftDeleted)) + } @@ -180,27 +182,28 @@ func (c *ApiService) PageRecording(params *ListRecordingParams, pageToken, pageN data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreated<", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) -} -if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreated>", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) -} -if params != nil && params.CallSid != nil { - data.Set("CallSid", *params.CallSid) -} -if params != nil && params.ConferenceSid != nil { - data.Set("ConferenceSid", *params.ConferenceSid) -} -if params != nil && params.IncludeSoftDeleted != nil { - data.Set("IncludeSoftDeleted", fmt.Sprint(*params.IncludeSoftDeleted)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateCreatedBefore != nil { + data.Set("DateCreated<", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) + } + if params != nil && params.DateCreatedAfter != nil { + data.Set("DateCreated>", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) + } + if params != nil && params.CallSid != nil { + data.Set("CallSid", *params.CallSid) + } + if params != nil && params.ConferenceSid != nil { + data.Set("ConferenceSid", *params.ConferenceSid) + } + if params != nil && params.IncludeSoftDeleted != nil { + data.Set("IncludeSoftDeleted", fmt.Sprint(*params.IncludeSoftDeleted)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_recordings_add_on_results.go b/rest/api/v2010/accounts_recordings_add_on_results.go index e19a94c5a..92a15a575 100644 --- a/rest/api/v2010/accounts_recordings_add_on_results.go +++ b/rest/api/v2010/accounts_recordings_add_on_results.go @@ -50,6 +50,7 @@ func (c *ApiService) DeleteRecordingAddOnResult(ReferenceSid string, Sid string, + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -87,6 +88,7 @@ func (c *ApiService) FetchRecordingAddOnResult(ReferenceSid string, Sid string, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -138,9 +140,10 @@ func (c *ApiService) PageRecordingAddOnResult(ReferenceSid string, params *ListR data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) 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 7022acda1..449337e4e 100644 --- a/rest/api/v2010/accounts_recordings_add_on_results_payloads.go +++ b/rest/api/v2010/accounts_recordings_add_on_results_payloads.go @@ -51,6 +51,7 @@ func (c *ApiService) DeleteRecordingAddOnResultPayload(ReferenceSid string, AddO + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -89,6 +90,7 @@ func (c *ApiService) FetchRecordingAddOnResultPayload(ReferenceSid string, AddOn + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -141,9 +143,10 @@ func (c *ApiService) PageRecordingAddOnResultPayload(ReferenceSid string, AddOnR data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_recordings_transcriptions.go b/rest/api/v2010/accounts_recordings_transcriptions.go index b8676ec12..034ef4166 100644 --- a/rest/api/v2010/accounts_recordings_transcriptions.go +++ b/rest/api/v2010/accounts_recordings_transcriptions.go @@ -50,6 +50,7 @@ func (c *ApiService) DeleteRecordingTranscription(RecordingSid string, Sid strin + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -87,6 +88,7 @@ func (c *ApiService) FetchRecordingTranscription(RecordingSid string, Sid string + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -138,9 +140,10 @@ func (c *ApiService) PageRecordingTranscription(RecordingSid string, params *Lis data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_signing_keys.go b/rest/api/v2010/accounts_signing_keys.go index b401980a5..9460ef75f 100644 --- a/rest/api/v2010/accounts_signing_keys.go +++ b/rest/api/v2010/accounts_signing_keys.go @@ -51,9 +51,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) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } @@ -98,6 +99,7 @@ func (c *ApiService) DeleteSigningKey(Sid string, params *DeleteSigningKeyParams + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -134,6 +136,7 @@ func (c *ApiService) FetchSigningKey(Sid string, params *FetchSigningKeyParams) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -184,9 +187,10 @@ func (c *ApiService) PageSigningKey(params *ListSigningKeyParams, pageToken, pag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -327,9 +331,10 @@ func (c *ApiService) UpdateSigningKey(Sid string, params *UpdateSigningKeyParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } diff --git a/rest/api/v2010/accounts_sip_credential_lists.go b/rest/api/v2010/accounts_sip_credential_lists.go index d59394f1a..3ee21eb96 100644 --- a/rest/api/v2010/accounts_sip_credential_lists.go +++ b/rest/api/v2010/accounts_sip_credential_lists.go @@ -51,9 +51,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) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } @@ -98,6 +99,7 @@ func (c *ApiService) DeleteSipCredentialList(Sid string, params *DeleteSipCreden + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -134,6 +136,7 @@ func (c *ApiService) FetchSipCredentialList(Sid string, params *FetchSipCredenti + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -184,9 +187,10 @@ func (c *ApiService) PageSipCredentialList(params *ListSipCredentialListParams, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -327,9 +331,10 @@ func (c *ApiService) UpdateSipCredentialList(Sid string, params *UpdateSipCreden data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } diff --git a/rest/api/v2010/accounts_sip_credential_lists_credentials.go b/rest/api/v2010/accounts_sip_credential_lists_credentials.go index f78fb5975..4140b3c98 100644 --- a/rest/api/v2010/accounts_sip_credential_lists_credentials.go +++ b/rest/api/v2010/accounts_sip_credential_lists_credentials.go @@ -58,12 +58,13 @@ func (c *ApiService) CreateSipCredential(CredentialListSid string, params *Creat data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Username != nil { - data.Set("Username", *params.Username) -} -if params != nil && params.Password != nil { - data.Set("Password", *params.Password) -} + + if params != nil && params.Username != nil { + data.Set("Username", *params.Username) + } + if params != nil && params.Password != nil { + data.Set("Password", *params.Password) + } @@ -109,6 +110,7 @@ func (c *ApiService) DeleteSipCredential(CredentialListSid string, Sid string, p + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -146,6 +148,7 @@ func (c *ApiService) FetchSipCredential(CredentialListSid string, Sid string, pa + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -197,9 +200,10 @@ func (c *ApiService) PageSipCredential(CredentialListSid string, params *ListSip data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -341,9 +345,10 @@ func (c *ApiService) UpdateSipCredential(CredentialListSid string, Sid string, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Password != nil { - data.Set("Password", *params.Password) -} + + if params != nil && params.Password != nil { + data.Set("Password", *params.Password) + } diff --git a/rest/api/v2010/accounts_sip_domains.go b/rest/api/v2010/accounts_sip_domains.go index 277521756..285eaacbb 100644 --- a/rest/api/v2010/accounts_sip_domains.go +++ b/rest/api/v2010/accounts_sip_domains.go @@ -123,45 +123,46 @@ func (c *ApiService) CreateSipDomain(params *CreateSipDomainParams) (*ApiV2010Si data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.DomainName != nil { - data.Set("DomainName", *params.DomainName) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.VoiceUrl != nil { - data.Set("VoiceUrl", *params.VoiceUrl) -} -if params != nil && params.VoiceMethod != nil { - data.Set("VoiceMethod", *params.VoiceMethod) -} -if params != nil && params.VoiceFallbackUrl != nil { - data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) -} -if params != nil && params.VoiceFallbackMethod != nil { - data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) -} -if params != nil && params.VoiceStatusCallbackUrl != nil { - data.Set("VoiceStatusCallbackUrl", *params.VoiceStatusCallbackUrl) -} -if params != nil && params.VoiceStatusCallbackMethod != nil { - data.Set("VoiceStatusCallbackMethod", *params.VoiceStatusCallbackMethod) -} -if params != nil && params.SipRegistration != nil { - data.Set("SipRegistration", fmt.Sprint(*params.SipRegistration)) -} -if params != nil && params.EmergencyCallingEnabled != nil { - data.Set("EmergencyCallingEnabled", fmt.Sprint(*params.EmergencyCallingEnabled)) -} -if params != nil && params.Secure != nil { - data.Set("Secure", fmt.Sprint(*params.Secure)) -} -if params != nil && params.ByocTrunkSid != nil { - data.Set("ByocTrunkSid", *params.ByocTrunkSid) -} -if params != nil && params.EmergencyCallerSid != nil { - data.Set("EmergencyCallerSid", *params.EmergencyCallerSid) -} + + if params != nil && params.DomainName != nil { + data.Set("DomainName", *params.DomainName) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.VoiceUrl != nil { + data.Set("VoiceUrl", *params.VoiceUrl) + } + if params != nil && params.VoiceMethod != nil { + data.Set("VoiceMethod", *params.VoiceMethod) + } + if params != nil && params.VoiceFallbackUrl != nil { + data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) + } + if params != nil && params.VoiceFallbackMethod != nil { + data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) + } + if params != nil && params.VoiceStatusCallbackUrl != nil { + data.Set("VoiceStatusCallbackUrl", *params.VoiceStatusCallbackUrl) + } + if params != nil && params.VoiceStatusCallbackMethod != nil { + data.Set("VoiceStatusCallbackMethod", *params.VoiceStatusCallbackMethod) + } + if params != nil && params.SipRegistration != nil { + data.Set("SipRegistration", fmt.Sprint(*params.SipRegistration)) + } + if params != nil && params.EmergencyCallingEnabled != nil { + data.Set("EmergencyCallingEnabled", fmt.Sprint(*params.EmergencyCallingEnabled)) + } + if params != nil && params.Secure != nil { + data.Set("Secure", fmt.Sprint(*params.Secure)) + } + if params != nil && params.ByocTrunkSid != nil { + data.Set("ByocTrunkSid", *params.ByocTrunkSid) + } + if params != nil && params.EmergencyCallerSid != nil { + data.Set("EmergencyCallerSid", *params.EmergencyCallerSid) + } @@ -206,6 +207,7 @@ func (c *ApiService) DeleteSipDomain(Sid string, params *DeleteSipDomainParams) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -242,6 +244,7 @@ func (c *ApiService) FetchSipDomain(Sid string, params *FetchSipDomainParams) (* + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -292,9 +295,10 @@ func (c *ApiService) PageSipDomain(params *ListSipDomainParams, pageToken, pageN data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -507,45 +511,46 @@ func (c *ApiService) UpdateSipDomain(Sid string, params *UpdateSipDomainParams) data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.VoiceFallbackMethod != nil { - data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) -} -if params != nil && params.VoiceFallbackUrl != nil { - data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) -} -if params != nil && params.VoiceMethod != nil { - data.Set("VoiceMethod", *params.VoiceMethod) -} -if params != nil && params.VoiceStatusCallbackMethod != nil { - data.Set("VoiceStatusCallbackMethod", *params.VoiceStatusCallbackMethod) -} -if params != nil && params.VoiceStatusCallbackUrl != nil { - data.Set("VoiceStatusCallbackUrl", *params.VoiceStatusCallbackUrl) -} -if params != nil && params.VoiceUrl != nil { - data.Set("VoiceUrl", *params.VoiceUrl) -} -if params != nil && params.SipRegistration != nil { - data.Set("SipRegistration", fmt.Sprint(*params.SipRegistration)) -} -if params != nil && params.DomainName != nil { - data.Set("DomainName", *params.DomainName) -} -if params != nil && params.EmergencyCallingEnabled != nil { - data.Set("EmergencyCallingEnabled", fmt.Sprint(*params.EmergencyCallingEnabled)) -} -if params != nil && params.Secure != nil { - data.Set("Secure", fmt.Sprint(*params.Secure)) -} -if params != nil && params.ByocTrunkSid != nil { - data.Set("ByocTrunkSid", *params.ByocTrunkSid) -} -if params != nil && params.EmergencyCallerSid != nil { - data.Set("EmergencyCallerSid", *params.EmergencyCallerSid) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.VoiceFallbackMethod != nil { + data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) + } + if params != nil && params.VoiceFallbackUrl != nil { + data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) + } + if params != nil && params.VoiceMethod != nil { + data.Set("VoiceMethod", *params.VoiceMethod) + } + if params != nil && params.VoiceStatusCallbackMethod != nil { + data.Set("VoiceStatusCallbackMethod", *params.VoiceStatusCallbackMethod) + } + if params != nil && params.VoiceStatusCallbackUrl != nil { + data.Set("VoiceStatusCallbackUrl", *params.VoiceStatusCallbackUrl) + } + if params != nil && params.VoiceUrl != nil { + data.Set("VoiceUrl", *params.VoiceUrl) + } + if params != nil && params.SipRegistration != nil { + data.Set("SipRegistration", fmt.Sprint(*params.SipRegistration)) + } + if params != nil && params.DomainName != nil { + data.Set("DomainName", *params.DomainName) + } + if params != nil && params.EmergencyCallingEnabled != nil { + data.Set("EmergencyCallingEnabled", fmt.Sprint(*params.EmergencyCallingEnabled)) + } + if params != nil && params.Secure != nil { + data.Set("Secure", fmt.Sprint(*params.Secure)) + } + if params != nil && params.ByocTrunkSid != nil { + data.Set("ByocTrunkSid", *params.ByocTrunkSid) + } + if params != nil && params.EmergencyCallerSid != nil { + data.Set("EmergencyCallerSid", *params.EmergencyCallerSid) + } 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 9d9c6efd4..e7a7ed1aa 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 @@ -52,9 +52,10 @@ func (c *ApiService) CreateSipAuthCallsCredentialListMapping(DomainSid string, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.CredentialListSid != nil { - data.Set("CredentialListSid", *params.CredentialListSid) -} + + if params != nil && params.CredentialListSid != nil { + data.Set("CredentialListSid", *params.CredentialListSid) + } @@ -100,6 +101,7 @@ func (c *ApiService) DeleteSipAuthCallsCredentialListMapping(DomainSid string, S + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -137,6 +139,7 @@ func (c *ApiService) FetchSipAuthCallsCredentialListMapping(DomainSid string, Si + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -188,9 +191,10 @@ func (c *ApiService) PageSipAuthCallsCredentialListMapping(DomainSid string, par data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) 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 7d8f1d762..cf35956b4 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 @@ -52,9 +52,10 @@ func (c *ApiService) CreateSipAuthCallsIpAccessControlListMapping(DomainSid stri data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.IpAccessControlListSid != nil { - data.Set("IpAccessControlListSid", *params.IpAccessControlListSid) -} + + if params != nil && params.IpAccessControlListSid != nil { + data.Set("IpAccessControlListSid", *params.IpAccessControlListSid) + } @@ -100,6 +101,7 @@ func (c *ApiService) DeleteSipAuthCallsIpAccessControlListMapping(DomainSid stri + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -137,6 +139,7 @@ func (c *ApiService) FetchSipAuthCallsIpAccessControlListMapping(DomainSid strin + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -188,9 +191,10 @@ func (c *ApiService) PageSipAuthCallsIpAccessControlListMapping(DomainSid string data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) 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 474840819..aab828b89 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 @@ -52,9 +52,10 @@ func (c *ApiService) CreateSipAuthRegistrationsCredentialListMapping(DomainSid s data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.CredentialListSid != nil { - data.Set("CredentialListSid", *params.CredentialListSid) -} + + if params != nil && params.CredentialListSid != nil { + data.Set("CredentialListSid", *params.CredentialListSid) + } @@ -100,6 +101,7 @@ func (c *ApiService) DeleteSipAuthRegistrationsCredentialListMapping(DomainSid s + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -137,6 +139,7 @@ func (c *ApiService) FetchSipAuthRegistrationsCredentialListMapping(DomainSid st + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -188,9 +191,10 @@ func (c *ApiService) PageSipAuthRegistrationsCredentialListMapping(DomainSid str data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) 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 250968531..77805d74c 100644 --- a/rest/api/v2010/accounts_sip_domains_credential_list_mappings.go +++ b/rest/api/v2010/accounts_sip_domains_credential_list_mappings.go @@ -52,9 +52,10 @@ func (c *ApiService) CreateSipCredentialListMapping(DomainSid string, params *Cr data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.CredentialListSid != nil { - data.Set("CredentialListSid", *params.CredentialListSid) -} + + if params != nil && params.CredentialListSid != nil { + data.Set("CredentialListSid", *params.CredentialListSid) + } @@ -100,6 +101,7 @@ func (c *ApiService) DeleteSipCredentialListMapping(DomainSid string, Sid string + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -137,6 +139,7 @@ func (c *ApiService) FetchSipCredentialListMapping(DomainSid string, Sid string, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -188,9 +191,10 @@ func (c *ApiService) PageSipCredentialListMapping(DomainSid string, params *List data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) 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 ceef71474..df31ab008 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 @@ -52,9 +52,10 @@ func (c *ApiService) CreateSipIpAccessControlListMapping(DomainSid string, param data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.IpAccessControlListSid != nil { - data.Set("IpAccessControlListSid", *params.IpAccessControlListSid) -} + + if params != nil && params.IpAccessControlListSid != nil { + data.Set("IpAccessControlListSid", *params.IpAccessControlListSid) + } @@ -100,6 +101,7 @@ func (c *ApiService) DeleteSipIpAccessControlListMapping(DomainSid string, Sid s + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -137,6 +139,7 @@ func (c *ApiService) FetchSipIpAccessControlListMapping(DomainSid string, Sid st + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -188,9 +191,10 @@ func (c *ApiService) PageSipIpAccessControlListMapping(DomainSid string, params data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_sipip_access_control_lists.go b/rest/api/v2010/accounts_sipip_access_control_lists.go index 65deea91e..7561d2bff 100644 --- a/rest/api/v2010/accounts_sipip_access_control_lists.go +++ b/rest/api/v2010/accounts_sipip_access_control_lists.go @@ -51,9 +51,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) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } @@ -98,6 +99,7 @@ func (c *ApiService) DeleteSipIpAccessControlList(Sid string, params *DeleteSipI + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -134,6 +136,7 @@ func (c *ApiService) FetchSipIpAccessControlList(Sid string, params *FetchSipIpA + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -184,9 +187,10 @@ func (c *ApiService) PageSipIpAccessControlList(params *ListSipIpAccessControlLi data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -327,9 +331,10 @@ func (c *ApiService) UpdateSipIpAccessControlList(Sid string, params *UpdateSipI data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } 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 15e0bfef1..d75ea129e 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 @@ -64,15 +64,16 @@ func (c *ApiService) CreateSipIpAddress(IpAccessControlListSid string, params *C data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.IpAddress != nil { - data.Set("IpAddress", *params.IpAddress) -} -if params != nil && params.CidrPrefixLength != nil { - data.Set("CidrPrefixLength", fmt.Sprint(*params.CidrPrefixLength)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.IpAddress != nil { + data.Set("IpAddress", *params.IpAddress) + } + if params != nil && params.CidrPrefixLength != nil { + data.Set("CidrPrefixLength", fmt.Sprint(*params.CidrPrefixLength)) + } @@ -118,6 +119,7 @@ func (c *ApiService) DeleteSipIpAddress(IpAccessControlListSid string, Sid strin + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -155,6 +157,7 @@ func (c *ApiService) FetchSipIpAddress(IpAccessControlListSid string, Sid string + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -206,9 +209,10 @@ func (c *ApiService) PageSipIpAddress(IpAccessControlListSid string, params *Lis data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -362,15 +366,16 @@ func (c *ApiService) UpdateSipIpAddress(IpAccessControlListSid string, Sid strin data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.IpAddress != nil { - data.Set("IpAddress", *params.IpAddress) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.CidrPrefixLength != nil { - data.Set("CidrPrefixLength", fmt.Sprint(*params.CidrPrefixLength)) -} + + if params != nil && params.IpAddress != nil { + data.Set("IpAddress", *params.IpAddress) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.CidrPrefixLength != nil { + data.Set("CidrPrefixLength", fmt.Sprint(*params.CidrPrefixLength)) + } diff --git a/rest/api/v2010/accounts_sms_short_codes.go b/rest/api/v2010/accounts_sms_short_codes.go index 9c5cd846b..d446157e7 100644 --- a/rest/api/v2010/accounts_sms_short_codes.go +++ b/rest/api/v2010/accounts_sms_short_codes.go @@ -49,6 +49,7 @@ func (c *ApiService) FetchShortCode(Sid string, params *FetchShortCodeParams) (* + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -111,15 +112,16 @@ func (c *ApiService) PageShortCode(params *ListShortCodeParams, pageToken, pageN data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.ShortCode != nil { - data.Set("ShortCode", *params.ShortCode) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.ShortCode != nil { + data.Set("ShortCode", *params.ShortCode) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -290,24 +292,25 @@ func (c *ApiService) UpdateShortCode(Sid string, params *UpdateShortCodeParams) data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.ApiVersion != nil { - data.Set("ApiVersion", *params.ApiVersion) -} -if params != nil && params.SmsUrl != nil { - data.Set("SmsUrl", *params.SmsUrl) -} -if params != nil && params.SmsMethod != nil { - data.Set("SmsMethod", *params.SmsMethod) -} -if params != nil && params.SmsFallbackUrl != nil { - data.Set("SmsFallbackUrl", *params.SmsFallbackUrl) -} -if params != nil && params.SmsFallbackMethod != nil { - data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.ApiVersion != nil { + data.Set("ApiVersion", *params.ApiVersion) + } + if params != nil && params.SmsUrl != nil { + data.Set("SmsUrl", *params.SmsUrl) + } + if params != nil && params.SmsMethod != nil { + data.Set("SmsMethod", *params.SmsMethod) + } + if params != nil && params.SmsFallbackUrl != nil { + data.Set("SmsFallbackUrl", *params.SmsFallbackUrl) + } + if params != nil && params.SmsFallbackMethod != nil { + data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) + } diff --git a/rest/api/v2010/accounts_tokens.go b/rest/api/v2010/accounts_tokens.go index cbfde44e2..e1dfe4f85 100644 --- a/rest/api/v2010/accounts_tokens.go +++ b/rest/api/v2010/accounts_tokens.go @@ -51,9 +51,10 @@ func (c *ApiService) CreateToken(params *CreateTokenParams) (*ApiV2010Token, err 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.Ttl != nil { + data.Set("Ttl", fmt.Sprint(*params.Ttl)) + } diff --git a/rest/api/v2010/accounts_transcriptions.go b/rest/api/v2010/accounts_transcriptions.go index 9971f23ab..03fb205ef 100644 --- a/rest/api/v2010/accounts_transcriptions.go +++ b/rest/api/v2010/accounts_transcriptions.go @@ -49,6 +49,7 @@ func (c *ApiService) DeleteTranscription(Sid string, params *DeleteTranscription + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -85,6 +86,7 @@ func (c *ApiService) FetchTranscription(Sid string, params *FetchTranscriptionPa + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -135,9 +137,10 @@ func (c *ApiService) PageTranscription(params *ListTranscriptionParams, pageToke data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_usage_records.go b/rest/api/v2010/accounts_usage_records.go index 35a687945..c585da68d 100644 --- a/rest/api/v2010/accounts_usage_records.go +++ b/rest/api/v2010/accounts_usage_records.go @@ -82,21 +82,22 @@ func (c *ApiService) PageUsageRecord(params *ListUsageRecordParams, pageToken, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Category != nil { - data.Set("Category", *params.Category) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) -} -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) -} -if params != nil && params.IncludeSubaccounts != nil { - data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Category != nil { + data.Set("Category", *params.Category) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint(*params.StartDate)) + } + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint(*params.EndDate)) + } + if params != nil && params.IncludeSubaccounts != nil { + data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_usage_records_all_time.go b/rest/api/v2010/accounts_usage_records_all_time.go index 162ff4dc8..3e8e7c63b 100644 --- a/rest/api/v2010/accounts_usage_records_all_time.go +++ b/rest/api/v2010/accounts_usage_records_all_time.go @@ -82,21 +82,22 @@ func (c *ApiService) PageUsageRecordAllTime(params *ListUsageRecordAllTimeParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Category != nil { - data.Set("Category", *params.Category) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) -} -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) -} -if params != nil && params.IncludeSubaccounts != nil { - data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Category != nil { + data.Set("Category", *params.Category) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint(*params.StartDate)) + } + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint(*params.EndDate)) + } + if params != nil && params.IncludeSubaccounts != nil { + data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_usage_records_daily.go b/rest/api/v2010/accounts_usage_records_daily.go index 895d34c48..0625906fd 100644 --- a/rest/api/v2010/accounts_usage_records_daily.go +++ b/rest/api/v2010/accounts_usage_records_daily.go @@ -82,21 +82,22 @@ func (c *ApiService) PageUsageRecordDaily(params *ListUsageRecordDailyParams, pa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Category != nil { - data.Set("Category", *params.Category) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) -} -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) -} -if params != nil && params.IncludeSubaccounts != nil { - data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Category != nil { + data.Set("Category", *params.Category) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint(*params.StartDate)) + } + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint(*params.EndDate)) + } + if params != nil && params.IncludeSubaccounts != nil { + data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_usage_records_last_month.go b/rest/api/v2010/accounts_usage_records_last_month.go index e832817ce..590e06b9e 100644 --- a/rest/api/v2010/accounts_usage_records_last_month.go +++ b/rest/api/v2010/accounts_usage_records_last_month.go @@ -82,21 +82,22 @@ func (c *ApiService) PageUsageRecordLastMonth(params *ListUsageRecordLastMonthPa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Category != nil { - data.Set("Category", *params.Category) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) -} -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) -} -if params != nil && params.IncludeSubaccounts != nil { - data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Category != nil { + data.Set("Category", *params.Category) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint(*params.StartDate)) + } + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint(*params.EndDate)) + } + if params != nil && params.IncludeSubaccounts != nil { + data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_usage_records_monthly.go b/rest/api/v2010/accounts_usage_records_monthly.go index a52ede543..d9fd7570b 100644 --- a/rest/api/v2010/accounts_usage_records_monthly.go +++ b/rest/api/v2010/accounts_usage_records_monthly.go @@ -82,21 +82,22 @@ func (c *ApiService) PageUsageRecordMonthly(params *ListUsageRecordMonthlyParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Category != nil { - data.Set("Category", *params.Category) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) -} -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) -} -if params != nil && params.IncludeSubaccounts != nil { - data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Category != nil { + data.Set("Category", *params.Category) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint(*params.StartDate)) + } + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint(*params.EndDate)) + } + if params != nil && params.IncludeSubaccounts != nil { + data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_usage_records_this_month.go b/rest/api/v2010/accounts_usage_records_this_month.go index 87e25a731..36d262304 100644 --- a/rest/api/v2010/accounts_usage_records_this_month.go +++ b/rest/api/v2010/accounts_usage_records_this_month.go @@ -82,21 +82,22 @@ func (c *ApiService) PageUsageRecordThisMonth(params *ListUsageRecordThisMonthPa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Category != nil { - data.Set("Category", *params.Category) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) -} -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) -} -if params != nil && params.IncludeSubaccounts != nil { - data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Category != nil { + data.Set("Category", *params.Category) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint(*params.StartDate)) + } + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint(*params.EndDate)) + } + if params != nil && params.IncludeSubaccounts != nil { + data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_usage_records_today.go b/rest/api/v2010/accounts_usage_records_today.go index 49d87abd5..5ed169591 100644 --- a/rest/api/v2010/accounts_usage_records_today.go +++ b/rest/api/v2010/accounts_usage_records_today.go @@ -82,21 +82,22 @@ func (c *ApiService) PageUsageRecordToday(params *ListUsageRecordTodayParams, pa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Category != nil { - data.Set("Category", *params.Category) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) -} -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) -} -if params != nil && params.IncludeSubaccounts != nil { - data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Category != nil { + data.Set("Category", *params.Category) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint(*params.StartDate)) + } + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint(*params.EndDate)) + } + if params != nil && params.IncludeSubaccounts != nil { + data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_usage_records_yearly.go b/rest/api/v2010/accounts_usage_records_yearly.go index ce2523499..85886b1cf 100644 --- a/rest/api/v2010/accounts_usage_records_yearly.go +++ b/rest/api/v2010/accounts_usage_records_yearly.go @@ -82,21 +82,22 @@ func (c *ApiService) PageUsageRecordYearly(params *ListUsageRecordYearlyParams, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Category != nil { - data.Set("Category", *params.Category) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) -} -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) -} -if params != nil && params.IncludeSubaccounts != nil { - data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Category != nil { + data.Set("Category", *params.Category) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint(*params.StartDate)) + } + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint(*params.EndDate)) + } + if params != nil && params.IncludeSubaccounts != nil { + data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_usage_records_yesterday.go b/rest/api/v2010/accounts_usage_records_yesterday.go index 8acbc2543..f078a3301 100644 --- a/rest/api/v2010/accounts_usage_records_yesterday.go +++ b/rest/api/v2010/accounts_usage_records_yesterday.go @@ -82,21 +82,22 @@ func (c *ApiService) PageUsageRecordYesterday(params *ListUsageRecordYesterdayPa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Category != nil { - data.Set("Category", *params.Category) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) -} -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) -} -if params != nil && params.IncludeSubaccounts != nil { - data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Category != nil { + data.Set("Category", *params.Category) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint(*params.StartDate)) + } + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint(*params.EndDate)) + } + if params != nil && params.IncludeSubaccounts != nil { + data.Set("IncludeSubaccounts", fmt.Sprint(*params.IncludeSubaccounts)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/api/v2010/accounts_usage_triggers.go b/rest/api/v2010/accounts_usage_triggers.go index 4e16d496a..4708e8093 100644 --- a/rest/api/v2010/accounts_usage_triggers.go +++ b/rest/api/v2010/accounts_usage_triggers.go @@ -87,27 +87,28 @@ func (c *ApiService) CreateUsageTrigger(params *CreateUsageTriggerParams) (*ApiV data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.CallbackUrl != nil { - data.Set("CallbackUrl", *params.CallbackUrl) -} -if params != nil && params.TriggerValue != nil { - data.Set("TriggerValue", *params.TriggerValue) -} -if params != nil && params.UsageCategory != nil { - data.Set("UsageCategory", *params.UsageCategory) -} -if params != nil && params.CallbackMethod != nil { - data.Set("CallbackMethod", *params.CallbackMethod) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Recurring != nil { - data.Set("Recurring", *params.Recurring) -} -if params != nil && params.TriggerBy != nil { - data.Set("TriggerBy", *params.TriggerBy) -} + + if params != nil && params.CallbackUrl != nil { + data.Set("CallbackUrl", *params.CallbackUrl) + } + if params != nil && params.TriggerValue != nil { + data.Set("TriggerValue", *params.TriggerValue) + } + if params != nil && params.UsageCategory != nil { + data.Set("UsageCategory", *params.UsageCategory) + } + if params != nil && params.CallbackMethod != nil { + data.Set("CallbackMethod", *params.CallbackMethod) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Recurring != nil { + data.Set("Recurring", *params.Recurring) + } + if params != nil && params.TriggerBy != nil { + data.Set("TriggerBy", *params.TriggerBy) + } @@ -152,6 +153,7 @@ func (c *ApiService) DeleteUsageTrigger(Sid string, params *DeleteUsageTriggerPa + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -188,6 +190,7 @@ func (c *ApiService) FetchUsageTrigger(Sid string, params *FetchUsageTriggerPara + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -256,18 +259,19 @@ func (c *ApiService) PageUsageTrigger(params *ListUsageTriggerParams, pageToken, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Recurring != nil { - data.Set("Recurring", *params.Recurring) -} -if params != nil && params.TriggerBy != nil { - data.Set("TriggerBy", *params.TriggerBy) -} -if params != nil && params.UsageCategory != nil { - data.Set("UsageCategory", *params.UsageCategory) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Recurring != nil { + data.Set("Recurring", *params.Recurring) + } + if params != nil && params.TriggerBy != nil { + data.Set("TriggerBy", *params.TriggerBy) + } + if params != nil && params.UsageCategory != nil { + data.Set("UsageCategory", *params.UsageCategory) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -420,15 +424,16 @@ func (c *ApiService) UpdateUsageTrigger(Sid string, params *UpdateUsageTriggerPa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.CallbackMethod != nil { - data.Set("CallbackMethod", *params.CallbackMethod) -} -if params != nil && params.CallbackUrl != nil { - data.Set("CallbackUrl", *params.CallbackUrl) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.CallbackMethod != nil { + data.Set("CallbackMethod", *params.CallbackMethod) + } + if params != nil && params.CallbackUrl != nil { + data.Set("CallbackUrl", *params.CallbackUrl) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } diff --git a/rest/api/v2010/safe_list_numbers.go b/rest/api/v2010/safe_list_numbers.go index b25571ede..38637b45e 100644 --- a/rest/api/v2010/safe_list_numbers.go +++ b/rest/api/v2010/safe_list_numbers.go @@ -40,9 +40,10 @@ func (c *ApiService) CreateSafelist(params *CreateSafelistParams) (*ApiV2010Safe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) -} + + if params != nil && params.PhoneNumber != nil { + data.Set("PhoneNumber", *params.PhoneNumber) + } @@ -78,9 +79,10 @@ func (c *ApiService) DeleteSafelist(params *DeleteSafelistParams) (error) { data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) -} + + if params != nil && params.PhoneNumber != nil { + data.Set("PhoneNumber", *params.PhoneNumber) + } @@ -111,9 +113,10 @@ func (c *ApiService) FetchSafelist(params *FetchSafelistParams) (*ApiV2010Safeli data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) -} + + if params != nil && params.PhoneNumber != nil { + data.Set("PhoneNumber", *params.PhoneNumber) + } diff --git a/rest/autopilot/v1/assistants.go b/rest/autopilot/v1/assistants.go index dfba37fef..c6c281c4a 100644 --- a/rest/autopilot/v1/assistants.go +++ b/rest/autopilot/v1/assistants.go @@ -76,39 +76,40 @@ func (c *ApiService) CreateAssistant(params *CreateAssistantParams) (*AutopilotV data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.LogQueries != nil { - data.Set("LogQueries", fmt.Sprint(*params.LogQueries)) -} -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.CallbackUrl != nil { - data.Set("CallbackUrl", *params.CallbackUrl) -} -if params != nil && params.CallbackEvents != nil { - data.Set("CallbackEvents", *params.CallbackEvents) -} -if params != nil && params.StyleSheet != nil { - v, err := json.Marshal(params.StyleSheet) - if err != nil { - return nil, err + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.LogQueries != nil { + data.Set("LogQueries", fmt.Sprint(*params.LogQueries)) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.CallbackUrl != nil { + data.Set("CallbackUrl", *params.CallbackUrl) + } + if params != nil && params.CallbackEvents != nil { + data.Set("CallbackEvents", *params.CallbackEvents) } + if params != nil && params.StyleSheet != nil { + v, err := json.Marshal(params.StyleSheet) - data.Set("StyleSheet", string(v)) -} -if params != nil && params.Defaults != nil { - v, err := json.Marshal(params.Defaults) + if err != nil { + return nil, err + } - if err != nil { - return nil, err + data.Set("StyleSheet", string(v)) } + if params != nil && params.Defaults != nil { + v, err := json.Marshal(params.Defaults) - data.Set("Defaults", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Defaults", string(v)) + } @@ -137,6 +138,7 @@ func (c *ApiService) DeleteAssistant(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -157,6 +159,7 @@ func (c *ApiService) FetchAssistant(Sid string, ) (*AutopilotV1Assistant, error) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -196,9 +199,10 @@ func (c *ApiService) PageAssistant(params *ListAssistantParams, pageToken, pageN data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -370,42 +374,43 @@ func (c *ApiService) UpdateAssistant(Sid string, params *UpdateAssistantParams) data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.LogQueries != nil { - data.Set("LogQueries", fmt.Sprint(*params.LogQueries)) -} -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.CallbackUrl != nil { - data.Set("CallbackUrl", *params.CallbackUrl) -} -if params != nil && params.CallbackEvents != nil { - data.Set("CallbackEvents", *params.CallbackEvents) -} -if params != nil && params.StyleSheet != nil { - v, err := json.Marshal(params.StyleSheet) - if err != nil { - return nil, err + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.LogQueries != nil { + data.Set("LogQueries", fmt.Sprint(*params.LogQueries)) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) } + if params != nil && params.CallbackUrl != nil { + data.Set("CallbackUrl", *params.CallbackUrl) + } + if params != nil && params.CallbackEvents != nil { + data.Set("CallbackEvents", *params.CallbackEvents) + } + if params != nil && params.StyleSheet != nil { + v, err := json.Marshal(params.StyleSheet) - data.Set("StyleSheet", string(v)) -} -if params != nil && params.Defaults != nil { - v, err := json.Marshal(params.Defaults) + if err != nil { + return nil, err + } - if err != nil { - return nil, err + data.Set("StyleSheet", string(v)) } + if params != nil && params.Defaults != nil { + v, err := json.Marshal(params.Defaults) - data.Set("Defaults", string(v)) -} -if params != nil && params.DevelopmentStage != nil { - data.Set("DevelopmentStage", *params.DevelopmentStage) -} + if err != nil { + return nil, err + } + + data.Set("Defaults", string(v)) + } + if params != nil && params.DevelopmentStage != nil { + data.Set("DevelopmentStage", *params.DevelopmentStage) + } diff --git a/rest/autopilot/v1/assistants_defaults.go b/rest/autopilot/v1/assistants_defaults.go index e18ae9f72..e66b95065 100644 --- a/rest/autopilot/v1/assistants_defaults.go +++ b/rest/autopilot/v1/assistants_defaults.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchDefaults(AssistantSid string, ) (*AutopilotV1Defaults, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -66,15 +67,16 @@ func (c *ApiService) UpdateDefaults(AssistantSid string, params *UpdateDefaultsP data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Defaults != nil { - v, err := json.Marshal(params.Defaults) - if err != nil { - return nil, err - } + if params != nil && params.Defaults != nil { + v, err := json.Marshal(params.Defaults) - data.Set("Defaults", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Defaults", string(v)) + } diff --git a/rest/autopilot/v1/assistants_dialogues.go b/rest/autopilot/v1/assistants_dialogues.go index 9a847b858..53be65357 100644 --- a/rest/autopilot/v1/assistants_dialogues.go +++ b/rest/autopilot/v1/assistants_dialogues.go @@ -34,6 +34,7 @@ func (c *ApiService) FetchDialogue(AssistantSid string, Sid string, ) (*Autopilo + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/autopilot/v1/assistants_field_types.go b/rest/autopilot/v1/assistants_field_types.go index 4f43500ca..86765e245 100644 --- a/rest/autopilot/v1/assistants_field_types.go +++ b/rest/autopilot/v1/assistants_field_types.go @@ -47,12 +47,13 @@ func (c *ApiService) CreateFieldType(AssistantSid string, params *CreateFieldTyp data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } @@ -82,6 +83,7 @@ func (c *ApiService) DeleteFieldType(AssistantSid string, Sid string, ) (error) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -103,6 +105,7 @@ func (c *ApiService) FetchFieldType(AssistantSid string, Sid string, ) (*Autopil + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -143,9 +146,10 @@ func (c *ApiService) PageFieldType(AssistantSid string, params *ListFieldTypePar data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -282,12 +286,13 @@ func (c *ApiService) UpdateFieldType(AssistantSid string, Sid string, params *Up 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) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } diff --git a/rest/autopilot/v1/assistants_field_types_field_values.go b/rest/autopilot/v1/assistants_field_types_field_values.go index 88382914d..82309a35d 100644 --- a/rest/autopilot/v1/assistants_field_types_field_values.go +++ b/rest/autopilot/v1/assistants_field_types_field_values.go @@ -54,15 +54,16 @@ func (c *ApiService) CreateFieldValue(AssistantSid string, FieldTypeSid string, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Language != nil { - data.Set("Language", *params.Language) -} -if params != nil && params.Value != nil { - data.Set("Value", *params.Value) -} -if params != nil && params.SynonymOf != nil { - data.Set("SynonymOf", *params.SynonymOf) -} + + if params != nil && params.Language != nil { + data.Set("Language", *params.Language) + } + if params != nil && params.Value != nil { + data.Set("Value", *params.Value) + } + if params != nil && params.SynonymOf != nil { + data.Set("SynonymOf", *params.SynonymOf) + } @@ -93,6 +94,7 @@ func (c *ApiService) DeleteFieldValue(AssistantSid string, FieldTypeSid string, + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -115,6 +117,7 @@ func (c *ApiService) FetchFieldValue(AssistantSid string, FieldTypeSid string, S + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -162,12 +165,13 @@ func (c *ApiService) PageFieldValue(AssistantSid string, FieldTypeSid string, pa 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)) -} + + if params != nil && params.Language != nil { + data.Set("Language", *params.Language) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/autopilot/v1/assistants_model_builds.go b/rest/autopilot/v1/assistants_model_builds.go index 88d3b6eb0..b8c7222e2 100644 --- a/rest/autopilot/v1/assistants_model_builds.go +++ b/rest/autopilot/v1/assistants_model_builds.go @@ -47,12 +47,13 @@ func (c *ApiService) CreateModelBuild(AssistantSid string, params *CreateModelBu 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) -} + + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } @@ -82,6 +83,7 @@ func (c *ApiService) DeleteModelBuild(AssistantSid string, Sid string, ) (error) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -103,6 +105,7 @@ func (c *ApiService) FetchModelBuild(AssistantSid string, Sid string, ) (*Autopi + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -143,9 +146,10 @@ func (c *ApiService) PageModelBuild(AssistantSid string, params *ListModelBuildP data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -276,9 +280,10 @@ func (c *ApiService) UpdateModelBuild(AssistantSid string, Sid string, params *U data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } diff --git a/rest/autopilot/v1/assistants_queries.go b/rest/autopilot/v1/assistants_queries.go index 2c6e26f93..9da9dbe9a 100644 --- a/rest/autopilot/v1/assistants_queries.go +++ b/rest/autopilot/v1/assistants_queries.go @@ -59,18 +59,19 @@ func (c *ApiService) CreateQuery(AssistantSid string, params *CreateQueryParams) data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Language != nil { - data.Set("Language", *params.Language) -} -if params != nil && params.Query != nil { - data.Set("Query", *params.Query) -} -if params != nil && params.Tasks != nil { - data.Set("Tasks", *params.Tasks) -} -if params != nil && params.ModelBuild != nil { - data.Set("ModelBuild", *params.ModelBuild) -} + + if params != nil && params.Language != nil { + data.Set("Language", *params.Language) + } + if params != nil && params.Query != nil { + data.Set("Query", *params.Query) + } + if params != nil && params.Tasks != nil { + data.Set("Tasks", *params.Tasks) + } + if params != nil && params.ModelBuild != nil { + data.Set("ModelBuild", *params.ModelBuild) + } @@ -100,6 +101,7 @@ func (c *ApiService) DeleteQuery(AssistantSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -121,6 +123,7 @@ func (c *ApiService) FetchQuery(AssistantSid string, Sid string, ) (*AutopilotV1 + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -185,21 +188,22 @@ func (c *ApiService) PageQuery(AssistantSid string, params *ListQueryParams, pag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Language != nil { - data.Set("Language", *params.Language) -} -if params != nil && params.ModelBuild != nil { - data.Set("ModelBuild", *params.ModelBuild) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.DialogueSid != nil { - data.Set("DialogueSid", *params.DialogueSid) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Language != nil { + data.Set("Language", *params.Language) + } + if params != nil && params.ModelBuild != nil { + data.Set("ModelBuild", *params.ModelBuild) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.DialogueSid != nil { + data.Set("DialogueSid", *params.DialogueSid) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -336,12 +340,13 @@ func (c *ApiService) UpdateQuery(AssistantSid string, Sid string, params *Update 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) -} + + if params != nil && params.SampleSid != nil { + data.Set("SampleSid", *params.SampleSid) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } diff --git a/rest/autopilot/v1/assistants_restore.go b/rest/autopilot/v1/assistants_restore.go index 029c73e14..071e057f5 100644 --- a/rest/autopilot/v1/assistants_restore.go +++ b/rest/autopilot/v1/assistants_restore.go @@ -40,9 +40,10 @@ func (c *ApiService) UpdateRestoreAssistant(params *UpdateRestoreAssistantParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Assistant != nil { - data.Set("Assistant", *params.Assistant) -} + + if params != nil && params.Assistant != nil { + data.Set("Assistant", *params.Assistant) + } diff --git a/rest/autopilot/v1/assistants_style_sheet.go b/rest/autopilot/v1/assistants_style_sheet.go index 49c05056c..d9663544e 100644 --- a/rest/autopilot/v1/assistants_style_sheet.go +++ b/rest/autopilot/v1/assistants_style_sheet.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchStyleSheet(AssistantSid string, ) (*AutopilotV1StyleSh + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -66,15 +67,16 @@ func (c *ApiService) UpdateStyleSheet(AssistantSid string, params *UpdateStyleSh data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.StyleSheet != nil { - v, err := json.Marshal(params.StyleSheet) - if err != nil { - return nil, err - } + if params != nil && params.StyleSheet != nil { + v, err := json.Marshal(params.StyleSheet) - data.Set("StyleSheet", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("StyleSheet", string(v)) + } diff --git a/rest/autopilot/v1/assistants_tasks.go b/rest/autopilot/v1/assistants_tasks.go index 835c227e2..26b7e54cb 100644 --- a/rest/autopilot/v1/assistants_tasks.go +++ b/rest/autopilot/v1/assistants_tasks.go @@ -59,24 +59,25 @@ func (c *ApiService) CreateTask(AssistantSid string, params *CreateTaskParams) ( data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Actions != nil { - v, err := json.Marshal(params.Actions) - if err != nil { - return nil, err + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Actions != nil { + v, err := json.Marshal(params.Actions) - data.Set("Actions", string(v)) -} -if params != nil && params.ActionsUrl != nil { - data.Set("ActionsUrl", *params.ActionsUrl) -} + if err != nil { + return nil, err + } + + data.Set("Actions", string(v)) + } + if params != nil && params.ActionsUrl != nil { + data.Set("ActionsUrl", *params.ActionsUrl) + } @@ -106,6 +107,7 @@ func (c *ApiService) DeleteTask(AssistantSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -127,6 +129,7 @@ func (c *ApiService) FetchTask(AssistantSid string, Sid string, ) (*AutopilotV1T + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -167,9 +170,10 @@ func (c *ApiService) PageTask(AssistantSid string, params *ListTaskParams, pageT data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -318,24 +322,25 @@ func (c *ApiService) UpdateTask(AssistantSid string, Sid string, params *UpdateT 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) -} -if params != nil && params.Actions != nil { - v, err := json.Marshal(params.Actions) - if err != nil { - return nil, err + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.Actions != nil { + v, err := json.Marshal(params.Actions) - data.Set("Actions", string(v)) -} -if params != nil && params.ActionsUrl != nil { - data.Set("ActionsUrl", *params.ActionsUrl) -} + if err != nil { + return nil, err + } + + data.Set("Actions", string(v)) + } + if params != nil && params.ActionsUrl != nil { + data.Set("ActionsUrl", *params.ActionsUrl) + } diff --git a/rest/autopilot/v1/assistants_tasks_actions.go b/rest/autopilot/v1/assistants_tasks_actions.go index 72b675200..9dcd9b907 100644 --- a/rest/autopilot/v1/assistants_tasks_actions.go +++ b/rest/autopilot/v1/assistants_tasks_actions.go @@ -34,6 +34,7 @@ func (c *ApiService) FetchTaskActions(AssistantSid string, TaskSid string, ) (*A + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -68,15 +69,16 @@ func (c *ApiService) UpdateTaskActions(AssistantSid string, TaskSid string, para data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Actions != nil { - v, err := json.Marshal(params.Actions) - if err != nil { - return nil, err - } + if params != nil && params.Actions != nil { + v, err := json.Marshal(params.Actions) - data.Set("Actions", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Actions", string(v)) + } diff --git a/rest/autopilot/v1/assistants_tasks_fields.go b/rest/autopilot/v1/assistants_tasks_fields.go index 629c219d5..edeaae5fb 100644 --- a/rest/autopilot/v1/assistants_tasks_fields.go +++ b/rest/autopilot/v1/assistants_tasks_fields.go @@ -48,12 +48,13 @@ func (c *ApiService) CreateField(AssistantSid string, TaskSid string, params *Cr 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) -} + + if params != nil && params.FieldType != nil { + data.Set("FieldType", *params.FieldType) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } @@ -84,6 +85,7 @@ func (c *ApiService) DeleteField(AssistantSid string, TaskSid string, Sid string + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -106,6 +108,7 @@ func (c *ApiService) FetchField(AssistantSid string, TaskSid string, Sid string, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -147,9 +150,10 @@ func (c *ApiService) PageField(AssistantSid string, TaskSid string, params *List data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/autopilot/v1/assistants_tasks_samples.go b/rest/autopilot/v1/assistants_tasks_samples.go index 7ad7600dd..f1faa20eb 100644 --- a/rest/autopilot/v1/assistants_tasks_samples.go +++ b/rest/autopilot/v1/assistants_tasks_samples.go @@ -54,15 +54,16 @@ func (c *ApiService) CreateSample(AssistantSid string, TaskSid string, params *C data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Language != nil { - data.Set("Language", *params.Language) -} -if params != nil && params.TaggedText != nil { - data.Set("TaggedText", *params.TaggedText) -} -if params != nil && params.SourceChannel != nil { - data.Set("SourceChannel", *params.SourceChannel) -} + + if params != nil && params.Language != nil { + data.Set("Language", *params.Language) + } + if params != nil && params.TaggedText != nil { + data.Set("TaggedText", *params.TaggedText) + } + if params != nil && params.SourceChannel != nil { + data.Set("SourceChannel", *params.SourceChannel) + } @@ -93,6 +94,7 @@ func (c *ApiService) DeleteSample(AssistantSid string, TaskSid string, Sid strin + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -115,6 +117,7 @@ func (c *ApiService) FetchSample(AssistantSid string, TaskSid string, Sid string + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -162,12 +165,13 @@ func (c *ApiService) PageSample(AssistantSid string, TaskSid string, params *Lis 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)) -} + + if params != nil && params.Language != nil { + data.Set("Language", *params.Language) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -311,15 +315,16 @@ func (c *ApiService) UpdateSample(AssistantSid string, TaskSid string, Sid strin data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Language != nil { - data.Set("Language", *params.Language) -} -if params != nil && params.TaggedText != nil { - data.Set("TaggedText", *params.TaggedText) -} -if params != nil && params.SourceChannel != nil { - data.Set("SourceChannel", *params.SourceChannel) -} + + if params != nil && params.Language != nil { + data.Set("Language", *params.Language) + } + if params != nil && params.TaggedText != nil { + data.Set("TaggedText", *params.TaggedText) + } + if params != nil && params.SourceChannel != nil { + data.Set("SourceChannel", *params.SourceChannel) + } diff --git a/rest/autopilot/v1/assistants_tasks_statistics.go b/rest/autopilot/v1/assistants_tasks_statistics.go index bc66de4cf..29a7a05e6 100644 --- a/rest/autopilot/v1/assistants_tasks_statistics.go +++ b/rest/autopilot/v1/assistants_tasks_statistics.go @@ -34,6 +34,7 @@ func (c *ApiService) FetchTaskStatistics(AssistantSid string, TaskSid string, ) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/autopilot/v1/assistants_webhooks.go b/rest/autopilot/v1/assistants_webhooks.go index 8fcedd537..8054012e1 100644 --- a/rest/autopilot/v1/assistants_webhooks.go +++ b/rest/autopilot/v1/assistants_webhooks.go @@ -59,18 +59,19 @@ func (c *ApiService) CreateWebhook(AssistantSid string, params *CreateWebhookPar data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.Events != nil { - data.Set("Events", *params.Events) -} -if params != nil && params.WebhookUrl != nil { - data.Set("WebhookUrl", *params.WebhookUrl) -} -if params != nil && params.WebhookMethod != nil { - data.Set("WebhookMethod", *params.WebhookMethod) -} + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.Events != nil { + data.Set("Events", *params.Events) + } + if params != nil && params.WebhookUrl != nil { + data.Set("WebhookUrl", *params.WebhookUrl) + } + if params != nil && params.WebhookMethod != nil { + data.Set("WebhookMethod", *params.WebhookMethod) + } @@ -100,6 +101,7 @@ func (c *ApiService) DeleteWebhook(AssistantSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -121,6 +123,7 @@ func (c *ApiService) FetchWebhook(AssistantSid string, Sid string, ) (*Autopilot + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -161,9 +164,10 @@ func (c *ApiService) PageWebhook(AssistantSid string, params *ListWebhookParams, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -312,18 +316,19 @@ func (c *ApiService) UpdateWebhook(AssistantSid string, Sid string, params *Upda data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.Events != nil { - data.Set("Events", *params.Events) -} -if params != nil && params.WebhookUrl != nil { - data.Set("WebhookUrl", *params.WebhookUrl) -} -if params != nil && params.WebhookMethod != nil { - data.Set("WebhookMethod", *params.WebhookMethod) -} + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.Events != nil { + data.Set("Events", *params.Events) + } + if params != nil && params.WebhookUrl != nil { + data.Set("WebhookUrl", *params.WebhookUrl) + } + if params != nil && params.WebhookMethod != nil { + data.Set("WebhookMethod", *params.WebhookMethod) + } diff --git a/rest/bulkexports/v1/exports.go b/rest/bulkexports/v1/exports.go index 77768f8fe..a597f2069 100644 --- a/rest/bulkexports/v1/exports.go +++ b/rest/bulkexports/v1/exports.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchExport(ResourceType string, ) (*BulkexportsV1Export, e + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/bulkexports/v1/exports_configuration.go b/rest/bulkexports/v1/exports_configuration.go index d2fd20fa9..6b27ce5b0 100644 --- a/rest/bulkexports/v1/exports_configuration.go +++ b/rest/bulkexports/v1/exports_configuration.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchExportConfiguration(ResourceType string, ) (*Bulkexpor + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -78,15 +79,16 @@ func (c *ApiService) UpdateExportConfiguration(ResourceType string, params *Upda data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Enabled != nil { - data.Set("Enabled", fmt.Sprint(*params.Enabled)) -} -if params != nil && params.WebhookUrl != nil { - data.Set("WebhookUrl", *params.WebhookUrl) -} -if params != nil && params.WebhookMethod != nil { - data.Set("WebhookMethod", *params.WebhookMethod) -} + + if params != nil && params.Enabled != nil { + data.Set("Enabled", fmt.Sprint(*params.Enabled)) + } + if params != nil && params.WebhookUrl != nil { + data.Set("WebhookUrl", *params.WebhookUrl) + } + if params != nil && params.WebhookMethod != nil { + data.Set("WebhookMethod", *params.WebhookMethod) + } diff --git a/rest/bulkexports/v1/exports_days.go b/rest/bulkexports/v1/exports_days.go index f3593cfc0..edba66dfc 100644 --- a/rest/bulkexports/v1/exports_days.go +++ b/rest/bulkexports/v1/exports_days.go @@ -34,6 +34,7 @@ func (c *ApiService) FetchDay(ResourceType string, Day string, ) (*BulkexportsV1 + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -74,9 +75,10 @@ func (c *ApiService) PageDay(ResourceType string, params *ListDayParams, pageTok data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/bulkexports/v1/exports_jobs.go b/rest/bulkexports/v1/exports_jobs.go index 099e08a29..912f596d7 100644 --- a/rest/bulkexports/v1/exports_jobs.go +++ b/rest/bulkexports/v1/exports_jobs.go @@ -71,24 +71,25 @@ func (c *ApiService) CreateExportCustomJob(ResourceType string, params *CreateEx data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.StartDay != nil { - data.Set("StartDay", *params.StartDay) -} -if params != nil && params.EndDay != nil { - data.Set("EndDay", *params.EndDay) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.WebhookUrl != nil { - data.Set("WebhookUrl", *params.WebhookUrl) -} -if params != nil && params.WebhookMethod != nil { - data.Set("WebhookMethod", *params.WebhookMethod) -} -if params != nil && params.Email != nil { - data.Set("Email", *params.Email) -} + + if params != nil && params.StartDay != nil { + data.Set("StartDay", *params.StartDay) + } + if params != nil && params.EndDay != nil { + data.Set("EndDay", *params.EndDay) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.WebhookUrl != nil { + data.Set("WebhookUrl", *params.WebhookUrl) + } + if params != nil && params.WebhookMethod != nil { + data.Set("WebhookMethod", *params.WebhookMethod) + } + if params != nil && params.Email != nil { + data.Set("Email", *params.Email) + } @@ -117,6 +118,7 @@ func (c *ApiService) DeleteJob(JobSid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -137,6 +139,7 @@ func (c *ApiService) FetchJob(JobSid string, ) (*BulkexportsV1Job, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -177,9 +180,10 @@ func (c *ApiService) PageExportCustomJob(ResourceType string, params *ListExport data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/chat/v1/credentials.go b/rest/chat/v1/credentials.go index bd67c3772..04ab445f2 100644 --- a/rest/chat/v1/credentials.go +++ b/rest/chat/v1/credentials.go @@ -76,27 +76,28 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*ChatV1Cr data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Certificate != nil { - data.Set("Certificate", *params.Certificate) -} -if params != nil && params.PrivateKey != nil { - data.Set("PrivateKey", *params.PrivateKey) -} -if params != nil && params.Sandbox != nil { - data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) -} -if params != nil && params.ApiKey != nil { - data.Set("ApiKey", *params.ApiKey) -} -if params != nil && params.Secret != nil { - data.Set("Secret", *params.Secret) -} + + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Certificate != nil { + data.Set("Certificate", *params.Certificate) + } + if params != nil && params.PrivateKey != nil { + data.Set("PrivateKey", *params.PrivateKey) + } + if params != nil && params.Sandbox != nil { + data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) + } + if params != nil && params.ApiKey != nil { + data.Set("ApiKey", *params.ApiKey) + } + if params != nil && params.Secret != nil { + data.Set("Secret", *params.Secret) + } @@ -125,6 +126,7 @@ func (c *ApiService) DeleteCredential(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -145,6 +147,7 @@ func (c *ApiService) FetchCredential(Sid string, ) (*ChatV1Credential, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -184,9 +187,10 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken, pag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -346,24 +350,25 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Certificate != nil { - data.Set("Certificate", *params.Certificate) -} -if params != nil && params.PrivateKey != nil { - data.Set("PrivateKey", *params.PrivateKey) -} -if params != nil && params.Sandbox != nil { - data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) -} -if params != nil && params.ApiKey != nil { - data.Set("ApiKey", *params.ApiKey) -} -if params != nil && params.Secret != nil { - data.Set("Secret", *params.Secret) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Certificate != nil { + data.Set("Certificate", *params.Certificate) + } + if params != nil && params.PrivateKey != nil { + data.Set("PrivateKey", *params.PrivateKey) + } + if params != nil && params.Sandbox != nil { + data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) + } + if params != nil && params.ApiKey != nil { + data.Set("ApiKey", *params.ApiKey) + } + if params != nil && params.Secret != nil { + data.Set("Secret", *params.Secret) + } diff --git a/rest/chat/v1/services.go b/rest/chat/v1/services.go index 6268c03b7..9c705ba62 100644 --- a/rest/chat/v1/services.go +++ b/rest/chat/v1/services.go @@ -40,9 +40,10 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ChatV1Service, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } @@ -71,6 +72,7 @@ func (c *ApiService) DeleteService(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -91,6 +93,7 @@ func (c *ApiService) FetchService(Sid string, ) (*ChatV1Service, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -130,9 +133,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -580,170 +584,171 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ch data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.DefaultServiceRoleSid != nil { - data.Set("DefaultServiceRoleSid", *params.DefaultServiceRoleSid) -} -if params != nil && params.DefaultChannelRoleSid != nil { - data.Set("DefaultChannelRoleSid", *params.DefaultChannelRoleSid) -} -if params != nil && params.DefaultChannelCreatorRoleSid != nil { - data.Set("DefaultChannelCreatorRoleSid", *params.DefaultChannelCreatorRoleSid) -} -if params != nil && params.ReadStatusEnabled != nil { - data.Set("ReadStatusEnabled", fmt.Sprint(*params.ReadStatusEnabled)) -} -if params != nil && params.ReachabilityEnabled != nil { - data.Set("ReachabilityEnabled", fmt.Sprint(*params.ReachabilityEnabled)) -} -if params != nil && params.TypingIndicatorTimeout != nil { - data.Set("TypingIndicatorTimeout", fmt.Sprint(*params.TypingIndicatorTimeout)) -} -if params != nil && params.ConsumptionReportInterval != nil { - data.Set("ConsumptionReportInterval", fmt.Sprint(*params.ConsumptionReportInterval)) -} -if params != nil && params.NotificationsNewMessageEnabled != nil { - data.Set("Notifications.NewMessage.Enabled", fmt.Sprint(*params.NotificationsNewMessageEnabled)) -} -if params != nil && params.NotificationsNewMessageTemplate != nil { - data.Set("Notifications.NewMessage.Template", *params.NotificationsNewMessageTemplate) -} -if params != nil && params.NotificationsAddedToChannelEnabled != nil { - data.Set("Notifications.AddedToChannel.Enabled", fmt.Sprint(*params.NotificationsAddedToChannelEnabled)) -} -if params != nil && params.NotificationsAddedToChannelTemplate != nil { - data.Set("Notifications.AddedToChannel.Template", *params.NotificationsAddedToChannelTemplate) -} -if params != nil && params.NotificationsRemovedFromChannelEnabled != nil { - data.Set("Notifications.RemovedFromChannel.Enabled", fmt.Sprint(*params.NotificationsRemovedFromChannelEnabled)) -} -if params != nil && params.NotificationsRemovedFromChannelTemplate != nil { - data.Set("Notifications.RemovedFromChannel.Template", *params.NotificationsRemovedFromChannelTemplate) -} -if params != nil && params.NotificationsInvitedToChannelEnabled != nil { - data.Set("Notifications.InvitedToChannel.Enabled", fmt.Sprint(*params.NotificationsInvitedToChannelEnabled)) -} -if params != nil && params.NotificationsInvitedToChannelTemplate != nil { - data.Set("Notifications.InvitedToChannel.Template", *params.NotificationsInvitedToChannelTemplate) -} -if params != nil && params.PreWebhookUrl != nil { - data.Set("PreWebhookUrl", *params.PreWebhookUrl) -} -if params != nil && params.PostWebhookUrl != nil { - data.Set("PostWebhookUrl", *params.PostWebhookUrl) -} -if params != nil && params.WebhookMethod != nil { - data.Set("WebhookMethod", *params.WebhookMethod) -} -if params != nil && params.WebhookFilters != nil { - for _, item := range *params.WebhookFilters { - data.Add("WebhookFilters", item) + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.DefaultServiceRoleSid != nil { + data.Set("DefaultServiceRoleSid", *params.DefaultServiceRoleSid) + } + if params != nil && params.DefaultChannelRoleSid != nil { + data.Set("DefaultChannelRoleSid", *params.DefaultChannelRoleSid) + } + if params != nil && params.DefaultChannelCreatorRoleSid != nil { + data.Set("DefaultChannelCreatorRoleSid", *params.DefaultChannelCreatorRoleSid) + } + if params != nil && params.ReadStatusEnabled != nil { + data.Set("ReadStatusEnabled", fmt.Sprint(*params.ReadStatusEnabled)) + } + if params != nil && params.ReachabilityEnabled != nil { + data.Set("ReachabilityEnabled", fmt.Sprint(*params.ReachabilityEnabled)) + } + if params != nil && params.TypingIndicatorTimeout != nil { + data.Set("TypingIndicatorTimeout", fmt.Sprint(*params.TypingIndicatorTimeout)) + } + if params != nil && params.ConsumptionReportInterval != nil { + data.Set("ConsumptionReportInterval", fmt.Sprint(*params.ConsumptionReportInterval)) + } + if params != nil && params.NotificationsNewMessageEnabled != nil { + data.Set("Notifications.NewMessage.Enabled", fmt.Sprint(*params.NotificationsNewMessageEnabled)) + } + if params != nil && params.NotificationsNewMessageTemplate != nil { + data.Set("Notifications.NewMessage.Template", *params.NotificationsNewMessageTemplate) + } + if params != nil && params.NotificationsAddedToChannelEnabled != nil { + data.Set("Notifications.AddedToChannel.Enabled", fmt.Sprint(*params.NotificationsAddedToChannelEnabled)) + } + if params != nil && params.NotificationsAddedToChannelTemplate != nil { + data.Set("Notifications.AddedToChannel.Template", *params.NotificationsAddedToChannelTemplate) + } + if params != nil && params.NotificationsRemovedFromChannelEnabled != nil { + data.Set("Notifications.RemovedFromChannel.Enabled", fmt.Sprint(*params.NotificationsRemovedFromChannelEnabled)) + } + if params != nil && params.NotificationsRemovedFromChannelTemplate != nil { + data.Set("Notifications.RemovedFromChannel.Template", *params.NotificationsRemovedFromChannelTemplate) + } + if params != nil && params.NotificationsInvitedToChannelEnabled != nil { + data.Set("Notifications.InvitedToChannel.Enabled", fmt.Sprint(*params.NotificationsInvitedToChannelEnabled)) + } + if params != nil && params.NotificationsInvitedToChannelTemplate != nil { + data.Set("Notifications.InvitedToChannel.Template", *params.NotificationsInvitedToChannelTemplate) + } + if params != nil && params.PreWebhookUrl != nil { + data.Set("PreWebhookUrl", *params.PreWebhookUrl) + } + if params != nil && params.PostWebhookUrl != nil { + data.Set("PostWebhookUrl", *params.PostWebhookUrl) + } + if params != nil && params.WebhookMethod != nil { + data.Set("WebhookMethod", *params.WebhookMethod) + } + if params != nil && params.WebhookFilters != nil { + for _, item := range *params.WebhookFilters { + data.Add("WebhookFilters", item) + } + } + if params != nil && params.WebhooksOnMessageSendUrl != nil { + data.Set("Webhooks.OnMessageSend.Url", *params.WebhooksOnMessageSendUrl) + } + if params != nil && params.WebhooksOnMessageSendMethod != nil { + data.Set("Webhooks.OnMessageSend.Method", *params.WebhooksOnMessageSendMethod) + } + if params != nil && params.WebhooksOnMessageUpdateUrl != nil { + data.Set("Webhooks.OnMessageUpdate.Url", *params.WebhooksOnMessageUpdateUrl) + } + if params != nil && params.WebhooksOnMessageUpdateMethod != nil { + data.Set("Webhooks.OnMessageUpdate.Method", *params.WebhooksOnMessageUpdateMethod) + } + if params != nil && params.WebhooksOnMessageRemoveUrl != nil { + data.Set("Webhooks.OnMessageRemove.Url", *params.WebhooksOnMessageRemoveUrl) + } + if params != nil && params.WebhooksOnMessageRemoveMethod != nil { + data.Set("Webhooks.OnMessageRemove.Method", *params.WebhooksOnMessageRemoveMethod) + } + if params != nil && params.WebhooksOnChannelAddUrl != nil { + data.Set("Webhooks.OnChannelAdd.Url", *params.WebhooksOnChannelAddUrl) + } + if params != nil && params.WebhooksOnChannelAddMethod != nil { + data.Set("Webhooks.OnChannelAdd.Method", *params.WebhooksOnChannelAddMethod) + } + if params != nil && params.WebhooksOnChannelDestroyUrl != nil { + data.Set("Webhooks.OnChannelDestroy.Url", *params.WebhooksOnChannelDestroyUrl) + } + if params != nil && params.WebhooksOnChannelDestroyMethod != nil { + data.Set("Webhooks.OnChannelDestroy.Method", *params.WebhooksOnChannelDestroyMethod) + } + if params != nil && params.WebhooksOnChannelUpdateUrl != nil { + data.Set("Webhooks.OnChannelUpdate.Url", *params.WebhooksOnChannelUpdateUrl) + } + if params != nil && params.WebhooksOnChannelUpdateMethod != nil { + data.Set("Webhooks.OnChannelUpdate.Method", *params.WebhooksOnChannelUpdateMethod) + } + if params != nil && params.WebhooksOnMemberAddUrl != nil { + data.Set("Webhooks.OnMemberAdd.Url", *params.WebhooksOnMemberAddUrl) + } + if params != nil && params.WebhooksOnMemberAddMethod != nil { + data.Set("Webhooks.OnMemberAdd.Method", *params.WebhooksOnMemberAddMethod) + } + if params != nil && params.WebhooksOnMemberRemoveUrl != nil { + data.Set("Webhooks.OnMemberRemove.Url", *params.WebhooksOnMemberRemoveUrl) + } + if params != nil && params.WebhooksOnMemberRemoveMethod != nil { + data.Set("Webhooks.OnMemberRemove.Method", *params.WebhooksOnMemberRemoveMethod) + } + if params != nil && params.WebhooksOnMessageSentUrl != nil { + data.Set("Webhooks.OnMessageSent.Url", *params.WebhooksOnMessageSentUrl) + } + if params != nil && params.WebhooksOnMessageSentMethod != nil { + data.Set("Webhooks.OnMessageSent.Method", *params.WebhooksOnMessageSentMethod) + } + if params != nil && params.WebhooksOnMessageUpdatedUrl != nil { + data.Set("Webhooks.OnMessageUpdated.Url", *params.WebhooksOnMessageUpdatedUrl) + } + if params != nil && params.WebhooksOnMessageUpdatedMethod != nil { + data.Set("Webhooks.OnMessageUpdated.Method", *params.WebhooksOnMessageUpdatedMethod) + } + if params != nil && params.WebhooksOnMessageRemovedUrl != nil { + data.Set("Webhooks.OnMessageRemoved.Url", *params.WebhooksOnMessageRemovedUrl) + } + if params != nil && params.WebhooksOnMessageRemovedMethod != nil { + data.Set("Webhooks.OnMessageRemoved.Method", *params.WebhooksOnMessageRemovedMethod) + } + if params != nil && params.WebhooksOnChannelAddedUrl != nil { + data.Set("Webhooks.OnChannelAdded.Url", *params.WebhooksOnChannelAddedUrl) + } + if params != nil && params.WebhooksOnChannelAddedMethod != nil { + data.Set("Webhooks.OnChannelAdded.Method", *params.WebhooksOnChannelAddedMethod) + } + if params != nil && params.WebhooksOnChannelDestroyedUrl != nil { + data.Set("Webhooks.OnChannelDestroyed.Url", *params.WebhooksOnChannelDestroyedUrl) + } + if params != nil && params.WebhooksOnChannelDestroyedMethod != nil { + data.Set("Webhooks.OnChannelDestroyed.Method", *params.WebhooksOnChannelDestroyedMethod) + } + if params != nil && params.WebhooksOnChannelUpdatedUrl != nil { + data.Set("Webhooks.OnChannelUpdated.Url", *params.WebhooksOnChannelUpdatedUrl) + } + if params != nil && params.WebhooksOnChannelUpdatedMethod != nil { + data.Set("Webhooks.OnChannelUpdated.Method", *params.WebhooksOnChannelUpdatedMethod) + } + if params != nil && params.WebhooksOnMemberAddedUrl != nil { + data.Set("Webhooks.OnMemberAdded.Url", *params.WebhooksOnMemberAddedUrl) + } + if params != nil && params.WebhooksOnMemberAddedMethod != nil { + data.Set("Webhooks.OnMemberAdded.Method", *params.WebhooksOnMemberAddedMethod) + } + if params != nil && params.WebhooksOnMemberRemovedUrl != nil { + data.Set("Webhooks.OnMemberRemoved.Url", *params.WebhooksOnMemberRemovedUrl) + } + if params != nil && params.WebhooksOnMemberRemovedMethod != nil { + data.Set("Webhooks.OnMemberRemoved.Method", *params.WebhooksOnMemberRemovedMethod) + } + if params != nil && params.LimitsChannelMembers != nil { + data.Set("Limits.ChannelMembers", fmt.Sprint(*params.LimitsChannelMembers)) + } + if params != nil && params.LimitsUserChannels != nil { + data.Set("Limits.UserChannels", fmt.Sprint(*params.LimitsUserChannels)) } -} -if params != nil && params.WebhooksOnMessageSendUrl != nil { - data.Set("Webhooks.OnMessageSend.Url", *params.WebhooksOnMessageSendUrl) -} -if params != nil && params.WebhooksOnMessageSendMethod != nil { - data.Set("Webhooks.OnMessageSend.Method", *params.WebhooksOnMessageSendMethod) -} -if params != nil && params.WebhooksOnMessageUpdateUrl != nil { - data.Set("Webhooks.OnMessageUpdate.Url", *params.WebhooksOnMessageUpdateUrl) -} -if params != nil && params.WebhooksOnMessageUpdateMethod != nil { - data.Set("Webhooks.OnMessageUpdate.Method", *params.WebhooksOnMessageUpdateMethod) -} -if params != nil && params.WebhooksOnMessageRemoveUrl != nil { - data.Set("Webhooks.OnMessageRemove.Url", *params.WebhooksOnMessageRemoveUrl) -} -if params != nil && params.WebhooksOnMessageRemoveMethod != nil { - data.Set("Webhooks.OnMessageRemove.Method", *params.WebhooksOnMessageRemoveMethod) -} -if params != nil && params.WebhooksOnChannelAddUrl != nil { - data.Set("Webhooks.OnChannelAdd.Url", *params.WebhooksOnChannelAddUrl) -} -if params != nil && params.WebhooksOnChannelAddMethod != nil { - data.Set("Webhooks.OnChannelAdd.Method", *params.WebhooksOnChannelAddMethod) -} -if params != nil && params.WebhooksOnChannelDestroyUrl != nil { - data.Set("Webhooks.OnChannelDestroy.Url", *params.WebhooksOnChannelDestroyUrl) -} -if params != nil && params.WebhooksOnChannelDestroyMethod != nil { - data.Set("Webhooks.OnChannelDestroy.Method", *params.WebhooksOnChannelDestroyMethod) -} -if params != nil && params.WebhooksOnChannelUpdateUrl != nil { - data.Set("Webhooks.OnChannelUpdate.Url", *params.WebhooksOnChannelUpdateUrl) -} -if params != nil && params.WebhooksOnChannelUpdateMethod != nil { - data.Set("Webhooks.OnChannelUpdate.Method", *params.WebhooksOnChannelUpdateMethod) -} -if params != nil && params.WebhooksOnMemberAddUrl != nil { - data.Set("Webhooks.OnMemberAdd.Url", *params.WebhooksOnMemberAddUrl) -} -if params != nil && params.WebhooksOnMemberAddMethod != nil { - data.Set("Webhooks.OnMemberAdd.Method", *params.WebhooksOnMemberAddMethod) -} -if params != nil && params.WebhooksOnMemberRemoveUrl != nil { - data.Set("Webhooks.OnMemberRemove.Url", *params.WebhooksOnMemberRemoveUrl) -} -if params != nil && params.WebhooksOnMemberRemoveMethod != nil { - data.Set("Webhooks.OnMemberRemove.Method", *params.WebhooksOnMemberRemoveMethod) -} -if params != nil && params.WebhooksOnMessageSentUrl != nil { - data.Set("Webhooks.OnMessageSent.Url", *params.WebhooksOnMessageSentUrl) -} -if params != nil && params.WebhooksOnMessageSentMethod != nil { - data.Set("Webhooks.OnMessageSent.Method", *params.WebhooksOnMessageSentMethod) -} -if params != nil && params.WebhooksOnMessageUpdatedUrl != nil { - data.Set("Webhooks.OnMessageUpdated.Url", *params.WebhooksOnMessageUpdatedUrl) -} -if params != nil && params.WebhooksOnMessageUpdatedMethod != nil { - data.Set("Webhooks.OnMessageUpdated.Method", *params.WebhooksOnMessageUpdatedMethod) -} -if params != nil && params.WebhooksOnMessageRemovedUrl != nil { - data.Set("Webhooks.OnMessageRemoved.Url", *params.WebhooksOnMessageRemovedUrl) -} -if params != nil && params.WebhooksOnMessageRemovedMethod != nil { - data.Set("Webhooks.OnMessageRemoved.Method", *params.WebhooksOnMessageRemovedMethod) -} -if params != nil && params.WebhooksOnChannelAddedUrl != nil { - data.Set("Webhooks.OnChannelAdded.Url", *params.WebhooksOnChannelAddedUrl) -} -if params != nil && params.WebhooksOnChannelAddedMethod != nil { - data.Set("Webhooks.OnChannelAdded.Method", *params.WebhooksOnChannelAddedMethod) -} -if params != nil && params.WebhooksOnChannelDestroyedUrl != nil { - data.Set("Webhooks.OnChannelDestroyed.Url", *params.WebhooksOnChannelDestroyedUrl) -} -if params != nil && params.WebhooksOnChannelDestroyedMethod != nil { - data.Set("Webhooks.OnChannelDestroyed.Method", *params.WebhooksOnChannelDestroyedMethod) -} -if params != nil && params.WebhooksOnChannelUpdatedUrl != nil { - data.Set("Webhooks.OnChannelUpdated.Url", *params.WebhooksOnChannelUpdatedUrl) -} -if params != nil && params.WebhooksOnChannelUpdatedMethod != nil { - data.Set("Webhooks.OnChannelUpdated.Method", *params.WebhooksOnChannelUpdatedMethod) -} -if params != nil && params.WebhooksOnMemberAddedUrl != nil { - data.Set("Webhooks.OnMemberAdded.Url", *params.WebhooksOnMemberAddedUrl) -} -if params != nil && params.WebhooksOnMemberAddedMethod != nil { - data.Set("Webhooks.OnMemberAdded.Method", *params.WebhooksOnMemberAddedMethod) -} -if params != nil && params.WebhooksOnMemberRemovedUrl != nil { - data.Set("Webhooks.OnMemberRemoved.Url", *params.WebhooksOnMemberRemovedUrl) -} -if params != nil && params.WebhooksOnMemberRemovedMethod != nil { - data.Set("Webhooks.OnMemberRemoved.Method", *params.WebhooksOnMemberRemovedMethod) -} -if params != nil && params.LimitsChannelMembers != nil { - data.Set("Limits.ChannelMembers", fmt.Sprint(*params.LimitsChannelMembers)) -} -if params != nil && params.LimitsUserChannels != nil { - data.Set("Limits.UserChannels", fmt.Sprint(*params.LimitsUserChannels)) -} diff --git a/rest/chat/v1/services_channels.go b/rest/chat/v1/services_channels.go index b838c60d8..2278099b4 100644 --- a/rest/chat/v1/services_channels.go +++ b/rest/chat/v1/services_channels.go @@ -59,18 +59,19 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam 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) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } @@ -100,6 +101,7 @@ func (c *ApiService) DeleteChannel(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -121,6 +123,7 @@ func (c *ApiService) FetchChannel(ServiceSid string, Sid string, ) (*ChatV1Chann + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -167,14 +170,15 @@ func (c *ApiService) PageChannel(ServiceSid string, params *ListChannelParams, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Type != nil { - for _, item := range *params.Type { - data.Add("Type", item) + + if params != nil && params.Type != nil { + for _, item := range *params.Type { + data.Add("Type", item) + } + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) } -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} if pageToken != "" { data.Set("PageToken", pageToken) @@ -317,15 +321,16 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update 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) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } diff --git a/rest/chat/v1/services_channels_invites.go b/rest/chat/v1/services_channels_invites.go index 214f88081..15c18522e 100644 --- a/rest/chat/v1/services_channels_invites.go +++ b/rest/chat/v1/services_channels_invites.go @@ -48,12 +48,13 @@ func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params * 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) -} + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } @@ -84,6 +85,7 @@ func (c *ApiService) DeleteInvite(ServiceSid string, ChannelSid string, Sid stri + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -106,6 +108,7 @@ func (c *ApiService) FetchInvite(ServiceSid string, ChannelSid string, Sid strin + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -153,14 +156,15 @@ func (c *ApiService) PageInvite(ServiceSid string, ChannelSid string, params *Li data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Identity != nil { - for _, item := range *params.Identity { - data.Add("Identity", item) + + if params != nil && params.Identity != nil { + for _, item := range *params.Identity { + data.Add("Identity", item) + } + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) } -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/chat/v1/services_channels_members.go b/rest/chat/v1/services_channels_members.go index 82b3f1bac..29fa4ad41 100644 --- a/rest/chat/v1/services_channels_members.go +++ b/rest/chat/v1/services_channels_members.go @@ -48,12 +48,13 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * 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) -} + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } @@ -84,6 +85,7 @@ func (c *ApiService) DeleteMember(ServiceSid string, ChannelSid string, Sid stri + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -106,6 +108,7 @@ func (c *ApiService) FetchMember(ServiceSid string, ChannelSid string, Sid strin + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -153,14 +156,15 @@ func (c *ApiService) PageMember(ServiceSid string, ChannelSid string, params *Li data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Identity != nil { - for _, item := range *params.Identity { - data.Add("Identity", item) + + if params != nil && params.Identity != nil { + for _, item := range *params.Identity { + data.Add("Identity", item) + } + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) } -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} if pageToken != "" { data.Set("PageToken", pageToken) @@ -298,12 +302,13 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.RoleSid != nil { - data.Set("RoleSid", *params.RoleSid) -} -if params != nil && params.LastConsumedMessageIndex != nil { - data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) -} + + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } + if params != nil && params.LastConsumedMessageIndex != nil { + data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) + } diff --git a/rest/chat/v1/services_channels_messages.go b/rest/chat/v1/services_channels_messages.go index f5dc96d6c..6b5745a09 100644 --- a/rest/chat/v1/services_channels_messages.go +++ b/rest/chat/v1/services_channels_messages.go @@ -54,15 +54,16 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Body != nil { - data.Set("Body", *params.Body) -} -if params != nil && params.From != nil { - data.Set("From", *params.From) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} + + if params != nil && params.Body != nil { + data.Set("Body", *params.Body) + } + if params != nil && params.From != nil { + data.Set("From", *params.From) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } @@ -93,6 +94,7 @@ func (c *ApiService) DeleteMessage(ServiceSid string, ChannelSid string, Sid str + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -115,6 +117,7 @@ func (c *ApiService) FetchMessage(ServiceSid string, ChannelSid string, Sid stri + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -162,12 +165,13 @@ func (c *ApiService) PageMessage(ServiceSid string, ChannelSid string, params *L 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)) -} + + if params != nil && params.Order != nil { + data.Set("Order", *params.Order) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -305,12 +309,13 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Body != nil { - data.Set("Body", *params.Body) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} + + if params != nil && params.Body != nil { + data.Set("Body", *params.Body) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } diff --git a/rest/chat/v1/services_roles.go b/rest/chat/v1/services_roles.go index 84fbeb977..444c697ee 100644 --- a/rest/chat/v1/services_roles.go +++ b/rest/chat/v1/services_roles.go @@ -53,17 +53,18 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*C data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.Permission != nil { - for _, item := range *params.Permission { - data.Add("Permission", item) + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } + if params != nil && params.Permission != nil { + for _, item := range *params.Permission { + data.Add("Permission", item) + } } -} @@ -93,6 +94,7 @@ func (c *ApiService) DeleteRole(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -114,6 +116,7 @@ func (c *ApiService) FetchRole(ServiceSid string, Sid string, ) (*ChatV1Role, er + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -154,9 +157,10 @@ func (c *ApiService) PageRole(ServiceSid string, params *ListRoleParams, pageTok data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -287,11 +291,12 @@ func (c *ApiService) UpdateRole(ServiceSid string, Sid string, params *UpdateRol data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Permission != nil { - for _, item := range *params.Permission { - data.Add("Permission", item) + + if params != nil && params.Permission != nil { + for _, item := range *params.Permission { + data.Add("Permission", item) + } } -} diff --git a/rest/chat/v1/services_users.go b/rest/chat/v1/services_users.go index 83b74b06f..c3a3cd2f5 100644 --- a/rest/chat/v1/services_users.go +++ b/rest/chat/v1/services_users.go @@ -59,18 +59,19 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*C 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) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } @@ -100,6 +101,7 @@ func (c *ApiService) DeleteUser(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -121,6 +123,7 @@ func (c *ApiService) FetchUser(ServiceSid string, Sid string, ) (*ChatV1User, er + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -161,9 +164,10 @@ func (c *ApiService) PageUser(ServiceSid string, params *ListUserParams, pageTok data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -306,15 +310,16 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.RoleSid != nil { - data.Set("RoleSid", *params.RoleSid) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } diff --git a/rest/chat/v1/services_users_channels.go b/rest/chat/v1/services_users_channels.go index fdc2e2ebc..f7d0772ed 100644 --- a/rest/chat/v1/services_users_channels.go +++ b/rest/chat/v1/services_users_channels.go @@ -49,9 +49,10 @@ func (c *ApiService) PageUserChannel(ServiceSid string, UserSid string, params * data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/chat/v2/credentials.go b/rest/chat/v2/credentials.go index cafd4d4f3..41b3ca872 100644 --- a/rest/chat/v2/credentials.go +++ b/rest/chat/v2/credentials.go @@ -76,27 +76,28 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*ChatV2Cr data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Certificate != nil { - data.Set("Certificate", *params.Certificate) -} -if params != nil && params.PrivateKey != nil { - data.Set("PrivateKey", *params.PrivateKey) -} -if params != nil && params.Sandbox != nil { - data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) -} -if params != nil && params.ApiKey != nil { - data.Set("ApiKey", *params.ApiKey) -} -if params != nil && params.Secret != nil { - data.Set("Secret", *params.Secret) -} + + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Certificate != nil { + data.Set("Certificate", *params.Certificate) + } + if params != nil && params.PrivateKey != nil { + data.Set("PrivateKey", *params.PrivateKey) + } + if params != nil && params.Sandbox != nil { + data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) + } + if params != nil && params.ApiKey != nil { + data.Set("ApiKey", *params.ApiKey) + } + if params != nil && params.Secret != nil { + data.Set("Secret", *params.Secret) + } @@ -125,6 +126,7 @@ func (c *ApiService) DeleteCredential(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -145,6 +147,7 @@ func (c *ApiService) FetchCredential(Sid string, ) (*ChatV2Credential, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -184,9 +187,10 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken, pag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -346,24 +350,25 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Certificate != nil { - data.Set("Certificate", *params.Certificate) -} -if params != nil && params.PrivateKey != nil { - data.Set("PrivateKey", *params.PrivateKey) -} -if params != nil && params.Sandbox != nil { - data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) -} -if params != nil && params.ApiKey != nil { - data.Set("ApiKey", *params.ApiKey) -} -if params != nil && params.Secret != nil { - data.Set("Secret", *params.Secret) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Certificate != nil { + data.Set("Certificate", *params.Certificate) + } + if params != nil && params.PrivateKey != nil { + data.Set("PrivateKey", *params.PrivateKey) + } + if params != nil && params.Sandbox != nil { + data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) + } + if params != nil && params.ApiKey != nil { + data.Set("ApiKey", *params.ApiKey) + } + if params != nil && params.Secret != nil { + data.Set("Secret", *params.Secret) + } diff --git a/rest/chat/v2/services.go b/rest/chat/v2/services.go index a4ad1471b..4aa1b1f54 100644 --- a/rest/chat/v2/services.go +++ b/rest/chat/v2/services.go @@ -40,9 +40,10 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ChatV2Service, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } @@ -71,6 +72,7 @@ func (c *ApiService) DeleteService(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -91,6 +93,7 @@ func (c *ApiService) FetchService(Sid string, ) (*ChatV2Service, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -130,9 +133,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -442,101 +446,102 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ch data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.DefaultServiceRoleSid != nil { - data.Set("DefaultServiceRoleSid", *params.DefaultServiceRoleSid) -} -if params != nil && params.DefaultChannelRoleSid != nil { - data.Set("DefaultChannelRoleSid", *params.DefaultChannelRoleSid) -} -if params != nil && params.DefaultChannelCreatorRoleSid != nil { - data.Set("DefaultChannelCreatorRoleSid", *params.DefaultChannelCreatorRoleSid) -} -if params != nil && params.ReadStatusEnabled != nil { - data.Set("ReadStatusEnabled", fmt.Sprint(*params.ReadStatusEnabled)) -} -if params != nil && params.ReachabilityEnabled != nil { - data.Set("ReachabilityEnabled", fmt.Sprint(*params.ReachabilityEnabled)) -} -if params != nil && params.TypingIndicatorTimeout != nil { - data.Set("TypingIndicatorTimeout", fmt.Sprint(*params.TypingIndicatorTimeout)) -} -if params != nil && params.ConsumptionReportInterval != nil { - data.Set("ConsumptionReportInterval", fmt.Sprint(*params.ConsumptionReportInterval)) -} -if params != nil && params.NotificationsNewMessageEnabled != nil { - data.Set("Notifications.NewMessage.Enabled", fmt.Sprint(*params.NotificationsNewMessageEnabled)) -} -if params != nil && params.NotificationsNewMessageTemplate != nil { - data.Set("Notifications.NewMessage.Template", *params.NotificationsNewMessageTemplate) -} -if params != nil && params.NotificationsNewMessageSound != nil { - data.Set("Notifications.NewMessage.Sound", *params.NotificationsNewMessageSound) -} -if params != nil && params.NotificationsNewMessageBadgeCountEnabled != nil { - data.Set("Notifications.NewMessage.BadgeCountEnabled", fmt.Sprint(*params.NotificationsNewMessageBadgeCountEnabled)) -} -if params != nil && params.NotificationsAddedToChannelEnabled != nil { - data.Set("Notifications.AddedToChannel.Enabled", fmt.Sprint(*params.NotificationsAddedToChannelEnabled)) -} -if params != nil && params.NotificationsAddedToChannelTemplate != nil { - data.Set("Notifications.AddedToChannel.Template", *params.NotificationsAddedToChannelTemplate) -} -if params != nil && params.NotificationsAddedToChannelSound != nil { - data.Set("Notifications.AddedToChannel.Sound", *params.NotificationsAddedToChannelSound) -} -if params != nil && params.NotificationsRemovedFromChannelEnabled != nil { - data.Set("Notifications.RemovedFromChannel.Enabled", fmt.Sprint(*params.NotificationsRemovedFromChannelEnabled)) -} -if params != nil && params.NotificationsRemovedFromChannelTemplate != nil { - data.Set("Notifications.RemovedFromChannel.Template", *params.NotificationsRemovedFromChannelTemplate) -} -if params != nil && params.NotificationsRemovedFromChannelSound != nil { - data.Set("Notifications.RemovedFromChannel.Sound", *params.NotificationsRemovedFromChannelSound) -} -if params != nil && params.NotificationsInvitedToChannelEnabled != nil { - data.Set("Notifications.InvitedToChannel.Enabled", fmt.Sprint(*params.NotificationsInvitedToChannelEnabled)) -} -if params != nil && params.NotificationsInvitedToChannelTemplate != nil { - data.Set("Notifications.InvitedToChannel.Template", *params.NotificationsInvitedToChannelTemplate) -} -if params != nil && params.NotificationsInvitedToChannelSound != nil { - data.Set("Notifications.InvitedToChannel.Sound", *params.NotificationsInvitedToChannelSound) -} -if params != nil && params.PreWebhookUrl != nil { - data.Set("PreWebhookUrl", *params.PreWebhookUrl) -} -if params != nil && params.PostWebhookUrl != nil { - data.Set("PostWebhookUrl", *params.PostWebhookUrl) -} -if params != nil && params.WebhookMethod != nil { - data.Set("WebhookMethod", *params.WebhookMethod) -} -if params != nil && params.WebhookFilters != nil { - for _, item := range *params.WebhookFilters { - data.Add("WebhookFilters", item) + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.DefaultServiceRoleSid != nil { + data.Set("DefaultServiceRoleSid", *params.DefaultServiceRoleSid) + } + if params != nil && params.DefaultChannelRoleSid != nil { + data.Set("DefaultChannelRoleSid", *params.DefaultChannelRoleSid) + } + if params != nil && params.DefaultChannelCreatorRoleSid != nil { + data.Set("DefaultChannelCreatorRoleSid", *params.DefaultChannelCreatorRoleSid) + } + if params != nil && params.ReadStatusEnabled != nil { + data.Set("ReadStatusEnabled", fmt.Sprint(*params.ReadStatusEnabled)) + } + if params != nil && params.ReachabilityEnabled != nil { + data.Set("ReachabilityEnabled", fmt.Sprint(*params.ReachabilityEnabled)) + } + if params != nil && params.TypingIndicatorTimeout != nil { + data.Set("TypingIndicatorTimeout", fmt.Sprint(*params.TypingIndicatorTimeout)) + } + if params != nil && params.ConsumptionReportInterval != nil { + data.Set("ConsumptionReportInterval", fmt.Sprint(*params.ConsumptionReportInterval)) + } + if params != nil && params.NotificationsNewMessageEnabled != nil { + data.Set("Notifications.NewMessage.Enabled", fmt.Sprint(*params.NotificationsNewMessageEnabled)) + } + if params != nil && params.NotificationsNewMessageTemplate != nil { + data.Set("Notifications.NewMessage.Template", *params.NotificationsNewMessageTemplate) + } + if params != nil && params.NotificationsNewMessageSound != nil { + data.Set("Notifications.NewMessage.Sound", *params.NotificationsNewMessageSound) + } + if params != nil && params.NotificationsNewMessageBadgeCountEnabled != nil { + data.Set("Notifications.NewMessage.BadgeCountEnabled", fmt.Sprint(*params.NotificationsNewMessageBadgeCountEnabled)) + } + if params != nil && params.NotificationsAddedToChannelEnabled != nil { + data.Set("Notifications.AddedToChannel.Enabled", fmt.Sprint(*params.NotificationsAddedToChannelEnabled)) + } + if params != nil && params.NotificationsAddedToChannelTemplate != nil { + data.Set("Notifications.AddedToChannel.Template", *params.NotificationsAddedToChannelTemplate) + } + if params != nil && params.NotificationsAddedToChannelSound != nil { + data.Set("Notifications.AddedToChannel.Sound", *params.NotificationsAddedToChannelSound) + } + if params != nil && params.NotificationsRemovedFromChannelEnabled != nil { + data.Set("Notifications.RemovedFromChannel.Enabled", fmt.Sprint(*params.NotificationsRemovedFromChannelEnabled)) + } + if params != nil && params.NotificationsRemovedFromChannelTemplate != nil { + data.Set("Notifications.RemovedFromChannel.Template", *params.NotificationsRemovedFromChannelTemplate) + } + if params != nil && params.NotificationsRemovedFromChannelSound != nil { + data.Set("Notifications.RemovedFromChannel.Sound", *params.NotificationsRemovedFromChannelSound) + } + if params != nil && params.NotificationsInvitedToChannelEnabled != nil { + data.Set("Notifications.InvitedToChannel.Enabled", fmt.Sprint(*params.NotificationsInvitedToChannelEnabled)) + } + if params != nil && params.NotificationsInvitedToChannelTemplate != nil { + data.Set("Notifications.InvitedToChannel.Template", *params.NotificationsInvitedToChannelTemplate) + } + if params != nil && params.NotificationsInvitedToChannelSound != nil { + data.Set("Notifications.InvitedToChannel.Sound", *params.NotificationsInvitedToChannelSound) + } + if params != nil && params.PreWebhookUrl != nil { + data.Set("PreWebhookUrl", *params.PreWebhookUrl) + } + if params != nil && params.PostWebhookUrl != nil { + data.Set("PostWebhookUrl", *params.PostWebhookUrl) + } + if params != nil && params.WebhookMethod != nil { + data.Set("WebhookMethod", *params.WebhookMethod) + } + if params != nil && params.WebhookFilters != nil { + for _, item := range *params.WebhookFilters { + data.Add("WebhookFilters", item) + } + } + if params != nil && params.LimitsChannelMembers != nil { + data.Set("Limits.ChannelMembers", fmt.Sprint(*params.LimitsChannelMembers)) + } + if params != nil && params.LimitsUserChannels != nil { + data.Set("Limits.UserChannels", fmt.Sprint(*params.LimitsUserChannels)) + } + if params != nil && params.MediaCompatibilityMessage != nil { + data.Set("Media.CompatibilityMessage", *params.MediaCompatibilityMessage) + } + if params != nil && params.PreWebhookRetryCount != nil { + data.Set("PreWebhookRetryCount", fmt.Sprint(*params.PreWebhookRetryCount)) + } + if params != nil && params.PostWebhookRetryCount != nil { + data.Set("PostWebhookRetryCount", fmt.Sprint(*params.PostWebhookRetryCount)) + } + if params != nil && params.NotificationsLogEnabled != nil { + data.Set("Notifications.LogEnabled", fmt.Sprint(*params.NotificationsLogEnabled)) } -} -if params != nil && params.LimitsChannelMembers != nil { - data.Set("Limits.ChannelMembers", fmt.Sprint(*params.LimitsChannelMembers)) -} -if params != nil && params.LimitsUserChannels != nil { - data.Set("Limits.UserChannels", fmt.Sprint(*params.LimitsUserChannels)) -} -if params != nil && params.MediaCompatibilityMessage != nil { - data.Set("Media.CompatibilityMessage", *params.MediaCompatibilityMessage) -} -if params != nil && params.PreWebhookRetryCount != nil { - data.Set("PreWebhookRetryCount", fmt.Sprint(*params.PreWebhookRetryCount)) -} -if params != nil && params.PostWebhookRetryCount != nil { - data.Set("PostWebhookRetryCount", fmt.Sprint(*params.PostWebhookRetryCount)) -} -if params != nil && params.NotificationsLogEnabled != nil { - data.Set("Notifications.LogEnabled", fmt.Sprint(*params.NotificationsLogEnabled)) -} diff --git a/rest/chat/v2/services_bindings.go b/rest/chat/v2/services_bindings.go index e153cf45f..114d5a4ea 100644 --- a/rest/chat/v2/services_bindings.go +++ b/rest/chat/v2/services_bindings.go @@ -34,6 +34,7 @@ func (c *ApiService) DeleteBinding(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -55,6 +56,7 @@ func (c *ApiService) FetchBinding(ServiceSid string, Sid string, ) (*ChatV2Bindi + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -107,19 +109,20 @@ func (c *ApiService) PageBinding(ServiceSid string, params *ListBindingParams, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.BindingType != nil { - for _, item := range *params.BindingType { - data.Add("BindingType", item) + + if params != nil && params.BindingType != nil { + for _, item := range *params.BindingType { + data.Add("BindingType", item) } -} -if params != nil && params.Identity != nil { - for _, item := range *params.Identity { - data.Add("Identity", item) } -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + if params != nil && params.Identity != nil { + for _, item := range *params.Identity { + data.Add("Identity", item) + } + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/chat/v2/services_channels.go b/rest/chat/v2/services_channels.go index 08ba16149..df654a479 100644 --- a/rest/chat/v2/services_channels.go +++ b/rest/chat/v2/services_channels.go @@ -83,27 +83,28 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam 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) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.CreatedBy != nil { - data.Set("CreatedBy", *params.CreatedBy) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.CreatedBy != nil { + data.Set("CreatedBy", *params.CreatedBy) + } if params != nil && params.XTwilioWebhookEnabled != nil { @@ -146,6 +147,7 @@ func (c *ApiService) DeleteChannel(ServiceSid string, Sid string, params *Delete headers := make(map[string]interface{}) + if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -171,6 +173,7 @@ func (c *ApiService) FetchChannel(ServiceSid string, Sid string, ) (*ChatV2Chann + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -217,14 +220,15 @@ func (c *ApiService) PageChannel(ServiceSid string, params *ListChannelParams, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Type != nil { - for _, item := range *params.Type { - data.Add("Type", item) + + if params != nil && params.Type != nil { + for _, item := range *params.Type { + data.Add("Type", item) + } + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) } -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} if pageToken != "" { data.Set("PageToken", pageToken) @@ -391,24 +395,25 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update 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) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.CreatedBy != nil { - data.Set("CreatedBy", *params.CreatedBy) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.CreatedBy != nil { + data.Set("CreatedBy", *params.CreatedBy) + } if params != nil && params.XTwilioWebhookEnabled != nil { diff --git a/rest/chat/v2/services_channels_invites.go b/rest/chat/v2/services_channels_invites.go index 61018ec8a..5c6e5a575 100644 --- a/rest/chat/v2/services_channels_invites.go +++ b/rest/chat/v2/services_channels_invites.go @@ -48,12 +48,13 @@ func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params * 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) -} + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } @@ -84,6 +85,7 @@ func (c *ApiService) DeleteInvite(ServiceSid string, ChannelSid string, Sid stri + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -106,6 +108,7 @@ func (c *ApiService) FetchInvite(ServiceSid string, ChannelSid string, Sid strin + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -153,14 +156,15 @@ func (c *ApiService) PageInvite(ServiceSid string, ChannelSid string, params *Li data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Identity != nil { - for _, item := range *params.Identity { - data.Add("Identity", item) + + if params != nil && params.Identity != nil { + for _, item := range *params.Identity { + data.Add("Identity", item) + } + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) } -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/chat/v2/services_channels_members.go b/rest/chat/v2/services_channels_members.go index b81d6535c..62170a13c 100644 --- a/rest/chat/v2/services_channels_members.go +++ b/rest/chat/v2/services_channels_members.go @@ -84,27 +84,28 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * 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) -} -if params != nil && params.LastConsumedMessageIndex != nil { - data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) -} -if params != nil && params.LastConsumptionTimestamp != nil { - data.Set("LastConsumptionTimestamp", fmt.Sprint((*params.LastConsumptionTimestamp).Format(time.RFC3339))) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } + if params != nil && params.LastConsumedMessageIndex != nil { + data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) + } + if params != nil && params.LastConsumptionTimestamp != nil { + data.Set("LastConsumptionTimestamp", fmt.Sprint((*params.LastConsumptionTimestamp).Format(time.RFC3339))) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } if params != nil && params.XTwilioWebhookEnabled != nil { @@ -148,6 +149,7 @@ func (c *ApiService) DeleteMember(ServiceSid string, ChannelSid string, Sid stri headers := make(map[string]interface{}) + if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -174,6 +176,7 @@ func (c *ApiService) FetchMember(ServiceSid string, ChannelSid string, Sid strin + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -221,14 +224,15 @@ func (c *ApiService) PageMember(ServiceSid string, ChannelSid string, params *Li data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Identity != nil { - for _, item := range *params.Identity { - data.Add("Identity", item) + + if params != nil && params.Identity != nil { + for _, item := range *params.Identity { + data.Add("Identity", item) + } + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) } -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} if pageToken != "" { data.Set("PageToken", pageToken) @@ -396,24 +400,25 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.RoleSid != nil { - data.Set("RoleSid", *params.RoleSid) -} -if params != nil && params.LastConsumedMessageIndex != nil { - data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) -} -if params != nil && params.LastConsumptionTimestamp != nil { - data.Set("LastConsumptionTimestamp", fmt.Sprint((*params.LastConsumptionTimestamp).Format(time.RFC3339))) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} + + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } + if params != nil && params.LastConsumedMessageIndex != nil { + data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) + } + if params != nil && params.LastConsumptionTimestamp != nil { + data.Set("LastConsumptionTimestamp", fmt.Sprint((*params.LastConsumptionTimestamp).Format(time.RFC3339))) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } if params != nil && params.XTwilioWebhookEnabled != nil { diff --git a/rest/chat/v2/services_channels_messages.go b/rest/chat/v2/services_channels_messages.go index be5789dca..5fd772d0f 100644 --- a/rest/chat/v2/services_channels_messages.go +++ b/rest/chat/v2/services_channels_messages.go @@ -84,27 +84,28 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.From != nil { - data.Set("From", *params.From) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.LastUpdatedBy != nil { - data.Set("LastUpdatedBy", *params.LastUpdatedBy) -} -if params != nil && params.Body != nil { - data.Set("Body", *params.Body) -} -if params != nil && params.MediaSid != nil { - data.Set("MediaSid", *params.MediaSid) -} + + if params != nil && params.From != nil { + data.Set("From", *params.From) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.LastUpdatedBy != nil { + data.Set("LastUpdatedBy", *params.LastUpdatedBy) + } + if params != nil && params.Body != nil { + data.Set("Body", *params.Body) + } + if params != nil && params.MediaSid != nil { + data.Set("MediaSid", *params.MediaSid) + } if params != nil && params.XTwilioWebhookEnabled != nil { @@ -148,6 +149,7 @@ func (c *ApiService) DeleteMessage(ServiceSid string, ChannelSid string, Sid str headers := make(map[string]interface{}) + if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -174,6 +176,7 @@ func (c *ApiService) FetchMessage(ServiceSid string, ChannelSid string, Sid stri + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -221,12 +224,13 @@ func (c *ApiService) PageMessage(ServiceSid string, ChannelSid string, params *L 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)) -} + + if params != nil && params.Order != nil { + data.Set("Order", *params.Order) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -394,24 +398,25 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Body != nil { - data.Set("Body", *params.Body) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.LastUpdatedBy != nil { - data.Set("LastUpdatedBy", *params.LastUpdatedBy) -} -if params != nil && params.From != nil { - data.Set("From", *params.From) -} + + if params != nil && params.Body != nil { + data.Set("Body", *params.Body) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.LastUpdatedBy != nil { + data.Set("LastUpdatedBy", *params.LastUpdatedBy) + } + if params != nil && params.From != nil { + data.Set("From", *params.From) + } if params != nil && params.XTwilioWebhookEnabled != nil { diff --git a/rest/chat/v2/services_channels_webhooks.go b/rest/chat/v2/services_channels_webhooks.go index 1a206b3fa..1228d90c8 100644 --- a/rest/chat/v2/services_channels_webhooks.go +++ b/rest/chat/v2/services_channels_webhooks.go @@ -78,31 +78,32 @@ func (c *ApiService) CreateChannelWebhook(ServiceSid string, ChannelSid string, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.ConfigurationUrl != nil { - data.Set("Configuration.Url", *params.ConfigurationUrl) -} -if params != nil && params.ConfigurationMethod != nil { - data.Set("Configuration.Method", *params.ConfigurationMethod) -} -if params != nil && params.ConfigurationFilters != nil { - for _, item := range *params.ConfigurationFilters { - data.Add("Configuration.Filters", item) + + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) } -} -if params != nil && params.ConfigurationTriggers != nil { - for _, item := range *params.ConfigurationTriggers { - data.Add("Configuration.Triggers", item) + if params != nil && params.ConfigurationUrl != nil { + data.Set("Configuration.Url", *params.ConfigurationUrl) + } + if params != nil && params.ConfigurationMethod != nil { + data.Set("Configuration.Method", *params.ConfigurationMethod) + } + if params != nil && params.ConfigurationFilters != nil { + for _, item := range *params.ConfigurationFilters { + data.Add("Configuration.Filters", item) + } + } + if params != nil && params.ConfigurationTriggers != nil { + for _, item := range *params.ConfigurationTriggers { + data.Add("Configuration.Triggers", item) + } + } + if params != nil && params.ConfigurationFlowSid != nil { + data.Set("Configuration.FlowSid", *params.ConfigurationFlowSid) + } + if params != nil && params.ConfigurationRetryCount != nil { + data.Set("Configuration.RetryCount", fmt.Sprint(*params.ConfigurationRetryCount)) } -} -if params != nil && params.ConfigurationFlowSid != nil { - data.Set("Configuration.FlowSid", *params.ConfigurationFlowSid) -} -if params != nil && params.ConfigurationRetryCount != nil { - data.Set("Configuration.RetryCount", fmt.Sprint(*params.ConfigurationRetryCount)) -} @@ -133,6 +134,7 @@ func (c *ApiService) DeleteChannelWebhook(ServiceSid string, ChannelSid string, + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -155,6 +157,7 @@ func (c *ApiService) FetchChannelWebhook(ServiceSid string, ChannelSid string, S + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -196,9 +199,10 @@ func (c *ApiService) PageChannelWebhook(ServiceSid string, ChannelSid string, pa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -360,28 +364,29 @@ func (c *ApiService) UpdateChannelWebhook(ServiceSid string, ChannelSid string, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ConfigurationUrl != nil { - data.Set("Configuration.Url", *params.ConfigurationUrl) -} -if params != nil && params.ConfigurationMethod != nil { - data.Set("Configuration.Method", *params.ConfigurationMethod) -} -if params != nil && params.ConfigurationFilters != nil { - for _, item := range *params.ConfigurationFilters { - data.Add("Configuration.Filters", item) + + if params != nil && params.ConfigurationUrl != nil { + data.Set("Configuration.Url", *params.ConfigurationUrl) } -} -if params != nil && params.ConfigurationTriggers != nil { - for _, item := range *params.ConfigurationTriggers { - data.Add("Configuration.Triggers", item) + if params != nil && params.ConfigurationMethod != nil { + data.Set("Configuration.Method", *params.ConfigurationMethod) + } + if params != nil && params.ConfigurationFilters != nil { + for _, item := range *params.ConfigurationFilters { + data.Add("Configuration.Filters", item) + } + } + if params != nil && params.ConfigurationTriggers != nil { + for _, item := range *params.ConfigurationTriggers { + data.Add("Configuration.Triggers", item) + } + } + if params != nil && params.ConfigurationFlowSid != nil { + data.Set("Configuration.FlowSid", *params.ConfigurationFlowSid) + } + if params != nil && params.ConfigurationRetryCount != nil { + data.Set("Configuration.RetryCount", fmt.Sprint(*params.ConfigurationRetryCount)) } -} -if params != nil && params.ConfigurationFlowSid != nil { - data.Set("Configuration.FlowSid", *params.ConfigurationFlowSid) -} -if params != nil && params.ConfigurationRetryCount != nil { - data.Set("Configuration.RetryCount", fmt.Sprint(*params.ConfigurationRetryCount)) -} diff --git a/rest/chat/v2/services_roles.go b/rest/chat/v2/services_roles.go index c161e19cd..8a74cc530 100644 --- a/rest/chat/v2/services_roles.go +++ b/rest/chat/v2/services_roles.go @@ -53,17 +53,18 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*C data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.Permission != nil { - for _, item := range *params.Permission { - data.Add("Permission", item) + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } + if params != nil && params.Permission != nil { + for _, item := range *params.Permission { + data.Add("Permission", item) + } } -} @@ -93,6 +94,7 @@ func (c *ApiService) DeleteRole(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -114,6 +116,7 @@ func (c *ApiService) FetchRole(ServiceSid string, Sid string, ) (*ChatV2Role, er + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -154,9 +157,10 @@ func (c *ApiService) PageRole(ServiceSid string, params *ListRoleParams, pageTok data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -287,11 +291,12 @@ func (c *ApiService) UpdateRole(ServiceSid string, Sid string, params *UpdateRol data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Permission != nil { - for _, item := range *params.Permission { - data.Add("Permission", item) + + if params != nil && params.Permission != nil { + for _, item := range *params.Permission { + data.Add("Permission", item) + } } -} diff --git a/rest/chat/v2/services_users.go b/rest/chat/v2/services_users.go index 44ad919ac..ddce8c3f9 100644 --- a/rest/chat/v2/services_users.go +++ b/rest/chat/v2/services_users.go @@ -65,18 +65,19 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*C 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) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } if params != nil && params.XTwilioWebhookEnabled != nil { @@ -109,6 +110,7 @@ func (c *ApiService) DeleteUser(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -130,6 +132,7 @@ func (c *ApiService) FetchUser(ServiceSid string, Sid string, ) (*ChatV2User, er + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -170,9 +173,10 @@ func (c *ApiService) PageUser(ServiceSid string, params *ListUserParams, pageTok data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -321,15 +325,16 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.RoleSid != nil { - data.Set("RoleSid", *params.RoleSid) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } if params != nil && params.XTwilioWebhookEnabled != nil { diff --git a/rest/chat/v2/services_users_bindings.go b/rest/chat/v2/services_users_bindings.go index eaa626eb9..4caeee8cb 100644 --- a/rest/chat/v2/services_users_bindings.go +++ b/rest/chat/v2/services_users_bindings.go @@ -35,6 +35,7 @@ func (c *ApiService) DeleteUserBinding(ServiceSid string, UserSid string, Sid st + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -57,6 +58,7 @@ func (c *ApiService) FetchUserBinding(ServiceSid string, UserSid string, Sid str + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -104,14 +106,15 @@ func (c *ApiService) PageUserBinding(ServiceSid string, UserSid string, params * data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.BindingType != nil { - for _, item := range *params.BindingType { - data.Add("BindingType", item) + + if params != nil && params.BindingType != nil { + for _, item := range *params.BindingType { + data.Add("BindingType", item) + } + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) } -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/chat/v2/services_users_channels.go b/rest/chat/v2/services_users_channels.go index 2e2285a6f..07be27983 100644 --- a/rest/chat/v2/services_users_channels.go +++ b/rest/chat/v2/services_users_channels.go @@ -45,6 +45,7 @@ func (c *ApiService) DeleteUserChannel(ServiceSid string, UserSid string, Channe headers := make(map[string]interface{}) + if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -71,6 +72,7 @@ func (c *ApiService) FetchUserChannel(ServiceSid string, UserSid string, Channel + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -112,9 +114,10 @@ func (c *ApiService) PageUserChannel(ServiceSid string, UserSid string, params * data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -258,15 +261,16 @@ func (c *ApiService) UpdateUserChannel(ServiceSid string, UserSid string, Channe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.NotificationLevel != nil { - data.Set("NotificationLevel", *params.NotificationLevel) -} -if params != nil && params.LastConsumedMessageIndex != nil { - data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) -} -if params != nil && params.LastConsumptionTimestamp != nil { - data.Set("LastConsumptionTimestamp", fmt.Sprint((*params.LastConsumptionTimestamp).Format(time.RFC3339))) -} + + if params != nil && params.NotificationLevel != nil { + data.Set("NotificationLevel", *params.NotificationLevel) + } + if params != nil && params.LastConsumedMessageIndex != nil { + data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) + } + if params != nil && params.LastConsumptionTimestamp != nil { + data.Set("LastConsumptionTimestamp", fmt.Sprint((*params.LastConsumptionTimestamp).Format(time.RFC3339))) + } diff --git a/rest/chat/v3/services_channels.go b/rest/chat/v3/services_channels.go index 3726d69b9..5e813dfeb 100644 --- a/rest/chat/v3/services_channels.go +++ b/rest/chat/v3/services_channels.go @@ -54,12 +54,13 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.MessagingServiceSid != nil { - data.Set("MessagingServiceSid", *params.MessagingServiceSid) -} + + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } + if params != nil && params.MessagingServiceSid != nil { + data.Set("MessagingServiceSid", *params.MessagingServiceSid) + } if params != nil && params.XTwilioWebhookEnabled != nil { diff --git a/rest/content/v1/content.go b/rest/content/v1/content.go index d82fa438d..6b9a6b9ed 100644 --- a/rest/content/v1/content.go +++ b/rest/content/v1/content.go @@ -33,6 +33,7 @@ func (c *ApiService) DeleteContent(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -53,6 +54,7 @@ func (c *ApiService) FetchContent(Sid string, ) (*ContentV1Content, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -92,9 +94,10 @@ func (c *ApiService) PageContent(params *ListContentParams, pageToken, pageNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/content/v1/content_and_approvals.go b/rest/content/v1/content_and_approvals.go index e9c294dfd..d17204cfc 100644 --- a/rest/content/v1/content_and_approvals.go +++ b/rest/content/v1/content_and_approvals.go @@ -47,9 +47,10 @@ func (c *ApiService) PageContentAndApprovals(params *ListContentAndApprovalsPara data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/content/v1/content_approval_requests.go b/rest/content/v1/content_approval_requests.go index 15c468753..cd9df7aab 100644 --- a/rest/content/v1/content_approval_requests.go +++ b/rest/content/v1/content_approval_requests.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchApprovalFetch(Sid string, ) (*ContentV1ApprovalFetch, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/content/v1/legacy_content.go b/rest/content/v1/legacy_content.go index b1f7ffcc7..3eb6b3027 100644 --- a/rest/content/v1/legacy_content.go +++ b/rest/content/v1/legacy_content.go @@ -47,9 +47,10 @@ func (c *ApiService) PageLegacyContent(params *ListLegacyContentParams, pageToke data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/conversations/v1/configuration.go b/rest/conversations/v1/configuration.go index ce6d633f2..87c831118 100644 --- a/rest/conversations/v1/configuration.go +++ b/rest/conversations/v1/configuration.go @@ -32,6 +32,7 @@ func (c *ApiService) FetchConfiguration() (*ConversationsV1Configuration, error) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -82,18 +83,19 @@ func (c *ApiService) UpdateConfiguration(params *UpdateConfigurationParams) (*Co data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.DefaultChatServiceSid != nil { - data.Set("DefaultChatServiceSid", *params.DefaultChatServiceSid) -} -if params != nil && params.DefaultMessagingServiceSid != nil { - data.Set("DefaultMessagingServiceSid", *params.DefaultMessagingServiceSid) -} -if params != nil && params.DefaultInactiveTimer != nil { - data.Set("DefaultInactiveTimer", *params.DefaultInactiveTimer) -} -if params != nil && params.DefaultClosedTimer != nil { - data.Set("DefaultClosedTimer", *params.DefaultClosedTimer) -} + + if params != nil && params.DefaultChatServiceSid != nil { + data.Set("DefaultChatServiceSid", *params.DefaultChatServiceSid) + } + if params != nil && params.DefaultMessagingServiceSid != nil { + data.Set("DefaultMessagingServiceSid", *params.DefaultMessagingServiceSid) + } + if params != nil && params.DefaultInactiveTimer != nil { + data.Set("DefaultInactiveTimer", *params.DefaultInactiveTimer) + } + if params != nil && params.DefaultClosedTimer != nil { + data.Set("DefaultClosedTimer", *params.DefaultClosedTimer) + } diff --git a/rest/conversations/v1/configuration_addresses.go b/rest/conversations/v1/configuration_addresses.go index 1dfe5441d..5ea8ff765 100644 --- a/rest/conversations/v1/configuration_addresses.go +++ b/rest/conversations/v1/configuration_addresses.go @@ -106,44 +106,45 @@ func (c *ApiService) CreateConfigurationAddress(params *CreateConfigurationAddre data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.Address != nil { - data.Set("Address", *params.Address) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.AutoCreationEnabled != nil { - data.Set("AutoCreation.Enabled", fmt.Sprint(*params.AutoCreationEnabled)) -} -if params != nil && params.AutoCreationType != nil { - data.Set("AutoCreation.Type", *params.AutoCreationType) -} -if params != nil && params.AutoCreationConversationServiceSid != nil { - data.Set("AutoCreation.ConversationServiceSid", *params.AutoCreationConversationServiceSid) -} -if params != nil && params.AutoCreationWebhookUrl != nil { - data.Set("AutoCreation.WebhookUrl", *params.AutoCreationWebhookUrl) -} -if params != nil && params.AutoCreationWebhookMethod != nil { - data.Set("AutoCreation.WebhookMethod", *params.AutoCreationWebhookMethod) -} -if params != nil && params.AutoCreationWebhookFilters != nil { - for _, item := range *params.AutoCreationWebhookFilters { - data.Add("AutoCreation.WebhookFilters", item) + + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } + if params != nil && params.Address != nil { + data.Set("Address", *params.Address) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.AutoCreationEnabled != nil { + data.Set("AutoCreation.Enabled", fmt.Sprint(*params.AutoCreationEnabled)) + } + if params != nil && params.AutoCreationType != nil { + data.Set("AutoCreation.Type", *params.AutoCreationType) + } + if params != nil && params.AutoCreationConversationServiceSid != nil { + data.Set("AutoCreation.ConversationServiceSid", *params.AutoCreationConversationServiceSid) + } + if params != nil && params.AutoCreationWebhookUrl != nil { + data.Set("AutoCreation.WebhookUrl", *params.AutoCreationWebhookUrl) + } + if params != nil && params.AutoCreationWebhookMethod != nil { + data.Set("AutoCreation.WebhookMethod", *params.AutoCreationWebhookMethod) + } + if params != nil && params.AutoCreationWebhookFilters != nil { + for _, item := range *params.AutoCreationWebhookFilters { + data.Add("AutoCreation.WebhookFilters", item) + } + } + if params != nil && params.AutoCreationStudioFlowSid != nil { + data.Set("AutoCreation.StudioFlowSid", *params.AutoCreationStudioFlowSid) + } + if params != nil && params.AutoCreationStudioRetryCount != nil { + data.Set("AutoCreation.StudioRetryCount", fmt.Sprint(*params.AutoCreationStudioRetryCount)) + } + if params != nil && params.AddressCountry != nil { + data.Set("AddressCountry", *params.AddressCountry) } -} -if params != nil && params.AutoCreationStudioFlowSid != nil { - data.Set("AutoCreation.StudioFlowSid", *params.AutoCreationStudioFlowSid) -} -if params != nil && params.AutoCreationStudioRetryCount != nil { - data.Set("AutoCreation.StudioRetryCount", fmt.Sprint(*params.AutoCreationStudioRetryCount)) -} -if params != nil && params.AddressCountry != nil { - data.Set("AddressCountry", *params.AddressCountry) -} @@ -172,6 +173,7 @@ func (c *ApiService) DeleteConfigurationAddress(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -192,6 +194,7 @@ func (c *ApiService) FetchConfigurationAddress(Sid string, ) (*ConversationsV1Co + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -237,12 +240,13 @@ func (c *ApiService) PageConfigurationAddress(params *ListConfigurationAddressPa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -420,35 +424,36 @@ func (c *ApiService) UpdateConfigurationAddress(Sid string, params *UpdateConfig data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.AutoCreationEnabled != nil { - data.Set("AutoCreation.Enabled", fmt.Sprint(*params.AutoCreationEnabled)) -} -if params != nil && params.AutoCreationType != nil { - data.Set("AutoCreation.Type", *params.AutoCreationType) -} -if params != nil && params.AutoCreationConversationServiceSid != nil { - data.Set("AutoCreation.ConversationServiceSid", *params.AutoCreationConversationServiceSid) -} -if params != nil && params.AutoCreationWebhookUrl != nil { - data.Set("AutoCreation.WebhookUrl", *params.AutoCreationWebhookUrl) -} -if params != nil && params.AutoCreationWebhookMethod != nil { - data.Set("AutoCreation.WebhookMethod", *params.AutoCreationWebhookMethod) -} -if params != nil && params.AutoCreationWebhookFilters != nil { - for _, item := range *params.AutoCreationWebhookFilters { - data.Add("AutoCreation.WebhookFilters", item) + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.AutoCreationEnabled != nil { + data.Set("AutoCreation.Enabled", fmt.Sprint(*params.AutoCreationEnabled)) + } + if params != nil && params.AutoCreationType != nil { + data.Set("AutoCreation.Type", *params.AutoCreationType) + } + if params != nil && params.AutoCreationConversationServiceSid != nil { + data.Set("AutoCreation.ConversationServiceSid", *params.AutoCreationConversationServiceSid) + } + if params != nil && params.AutoCreationWebhookUrl != nil { + data.Set("AutoCreation.WebhookUrl", *params.AutoCreationWebhookUrl) + } + if params != nil && params.AutoCreationWebhookMethod != nil { + data.Set("AutoCreation.WebhookMethod", *params.AutoCreationWebhookMethod) + } + if params != nil && params.AutoCreationWebhookFilters != nil { + for _, item := range *params.AutoCreationWebhookFilters { + data.Add("AutoCreation.WebhookFilters", item) + } + } + if params != nil && params.AutoCreationStudioFlowSid != nil { + data.Set("AutoCreation.StudioFlowSid", *params.AutoCreationStudioFlowSid) + } + if params != nil && params.AutoCreationStudioRetryCount != nil { + data.Set("AutoCreation.StudioRetryCount", fmt.Sprint(*params.AutoCreationStudioRetryCount)) } -} -if params != nil && params.AutoCreationStudioFlowSid != nil { - data.Set("AutoCreation.StudioFlowSid", *params.AutoCreationStudioFlowSid) -} -if params != nil && params.AutoCreationStudioRetryCount != nil { - data.Set("AutoCreation.StudioRetryCount", fmt.Sprint(*params.AutoCreationStudioRetryCount)) -} diff --git a/rest/conversations/v1/configuration_webhooks.go b/rest/conversations/v1/configuration_webhooks.go index 30a9b565c..2730221d0 100644 --- a/rest/conversations/v1/configuration_webhooks.go +++ b/rest/conversations/v1/configuration_webhooks.go @@ -32,6 +32,7 @@ func (c *ApiService) FetchConfigurationWebhook() (*ConversationsV1ConfigurationW + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -88,23 +89,24 @@ func (c *ApiService) UpdateConfigurationWebhook(params *UpdateConfigurationWebho data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Method != nil { - data.Set("Method", *params.Method) -} -if params != nil && params.Filters != nil { - for _, item := range *params.Filters { - data.Add("Filters", item) + + if params != nil && params.Method != nil { + data.Set("Method", *params.Method) + } + if params != nil && params.Filters != nil { + for _, item := range *params.Filters { + data.Add("Filters", item) + } + } + if params != nil && params.PreWebhookUrl != nil { + data.Set("PreWebhookUrl", *params.PreWebhookUrl) + } + if params != nil && params.PostWebhookUrl != nil { + data.Set("PostWebhookUrl", *params.PostWebhookUrl) + } + if params != nil && params.Target != nil { + data.Set("Target", *params.Target) } -} -if params != nil && params.PreWebhookUrl != nil { - data.Set("PreWebhookUrl", *params.PreWebhookUrl) -} -if params != nil && params.PostWebhookUrl != nil { - data.Set("PostWebhookUrl", *params.PostWebhookUrl) -} -if params != nil && params.Target != nil { - data.Set("Target", *params.Target) -} diff --git a/rest/conversations/v1/conversations.go b/rest/conversations/v1/conversations.go index 3fb247211..e38c2f6ed 100644 --- a/rest/conversations/v1/conversations.go +++ b/rest/conversations/v1/conversations.go @@ -106,39 +106,40 @@ func (c *ApiService) CreateConversation(params *CreateConversationParams) (*Conv 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) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.MessagingServiceSid != nil { - data.Set("MessagingServiceSid", *params.MessagingServiceSid) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.State != nil { - data.Set("State", *params.State) -} -if params != nil && params.TimersInactive != nil { - data.Set("Timers.Inactive", *params.TimersInactive) -} -if params != nil && params.TimersClosed != nil { - data.Set("Timers.Closed", *params.TimersClosed) -} -if params != nil && params.BindingsEmailAddress != nil { - data.Set("Bindings.Email.Address", *params.BindingsEmailAddress) -} -if params != nil && params.BindingsEmailName != nil { - data.Set("Bindings.Email.Name", *params.BindingsEmailName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.MessagingServiceSid != nil { + data.Set("MessagingServiceSid", *params.MessagingServiceSid) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.State != nil { + data.Set("State", *params.State) + } + if params != nil && params.TimersInactive != nil { + data.Set("Timers.Inactive", *params.TimersInactive) + } + if params != nil && params.TimersClosed != nil { + data.Set("Timers.Closed", *params.TimersClosed) + } + if params != nil && params.BindingsEmailAddress != nil { + data.Set("Bindings.Email.Address", *params.BindingsEmailAddress) + } + if params != nil && params.BindingsEmailName != nil { + data.Set("Bindings.Email.Name", *params.BindingsEmailName) + } if params != nil && params.XTwilioWebhookEnabled != nil { @@ -180,6 +181,7 @@ func (c *ApiService) DeleteConversation(Sid string, params *DeleteConversationPa headers := make(map[string]interface{}) + if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -204,6 +206,7 @@ func (c *ApiService) FetchConversation(Sid string, ) (*ConversationsV1Conversati + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -261,18 +264,19 @@ func (c *ApiService) PageConversation(params *ListConversationParams, pageToken, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.StartDate != nil { - data.Set("StartDate", *params.StartDate) -} -if params != nil && params.EndDate != nil { - data.Set("EndDate", *params.EndDate) -} -if params != nil && params.State != nil { - data.Set("State", *params.State) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.StartDate != nil { + data.Set("StartDate", *params.StartDate) + } + if params != nil && params.EndDate != nil { + data.Set("EndDate", *params.EndDate) + } + if params != nil && params.State != nil { + data.Set("State", *params.State) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -468,39 +472,40 @@ func (c *ApiService) UpdateConversation(Sid string, params *UpdateConversationPa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.MessagingServiceSid != nil { - data.Set("MessagingServiceSid", *params.MessagingServiceSid) -} -if params != nil && params.State != nil { - data.Set("State", *params.State) -} -if params != nil && params.TimersInactive != nil { - data.Set("Timers.Inactive", *params.TimersInactive) -} -if params != nil && params.TimersClosed != nil { - data.Set("Timers.Closed", *params.TimersClosed) -} -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.BindingsEmailAddress != nil { - data.Set("Bindings.Email.Address", *params.BindingsEmailAddress) -} -if params != nil && params.BindingsEmailName != nil { - data.Set("Bindings.Email.Name", *params.BindingsEmailName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.MessagingServiceSid != nil { + data.Set("MessagingServiceSid", *params.MessagingServiceSid) + } + if params != nil && params.State != nil { + data.Set("State", *params.State) + } + if params != nil && params.TimersInactive != nil { + data.Set("Timers.Inactive", *params.TimersInactive) + } + if params != nil && params.TimersClosed != nil { + data.Set("Timers.Closed", *params.TimersClosed) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.BindingsEmailAddress != nil { + data.Set("Bindings.Email.Address", *params.BindingsEmailAddress) + } + if params != nil && params.BindingsEmailName != nil { + data.Set("Bindings.Email.Name", *params.BindingsEmailName) + } if params != nil && params.XTwilioWebhookEnabled != nil { diff --git a/rest/conversations/v1/conversations_messages.go b/rest/conversations/v1/conversations_messages.go index 5b177dece..dfdb3c479 100644 --- a/rest/conversations/v1/conversations_messages.go +++ b/rest/conversations/v1/conversations_messages.go @@ -95,33 +95,34 @@ func (c *ApiService) CreateConversationMessage(ConversationSid string, params *C data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Author != nil { - data.Set("Author", *params.Author) -} -if params != nil && params.Body != nil { - data.Set("Body", *params.Body) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.MediaSid != nil { - data.Set("MediaSid", *params.MediaSid) -} -if params != nil && params.ContentSid != nil { - data.Set("ContentSid", *params.ContentSid) -} -if params != nil && params.ContentVariables != nil { - data.Set("ContentVariables", *params.ContentVariables) -} -if params != nil && params.Subject != nil { - data.Set("Subject", *params.Subject) -} + + if params != nil && params.Author != nil { + data.Set("Author", *params.Author) + } + if params != nil && params.Body != nil { + data.Set("Body", *params.Body) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.MediaSid != nil { + data.Set("MediaSid", *params.MediaSid) + } + if params != nil && params.ContentSid != nil { + data.Set("ContentSid", *params.ContentSid) + } + if params != nil && params.ContentVariables != nil { + data.Set("ContentVariables", *params.ContentVariables) + } + if params != nil && params.Subject != nil { + data.Set("Subject", *params.Subject) + } if params != nil && params.XTwilioWebhookEnabled != nil { @@ -164,6 +165,7 @@ func (c *ApiService) DeleteConversationMessage(ConversationSid string, Sid strin headers := make(map[string]interface{}) + if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -189,6 +191,7 @@ func (c *ApiService) FetchConversationMessage(ConversationSid string, Sid string + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -235,12 +238,13 @@ func (c *ApiService) PageConversationMessage(ConversationSid string, params *Lis 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)) -} + + if params != nil && params.Order != nil { + data.Set("Order", *params.Order) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -407,24 +411,25 @@ func (c *ApiService) UpdateConversationMessage(ConversationSid string, Sid strin data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Author != nil { - data.Set("Author", *params.Author) -} -if params != nil && params.Body != nil { - data.Set("Body", *params.Body) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.Subject != nil { - data.Set("Subject", *params.Subject) -} + + if params != nil && params.Author != nil { + data.Set("Author", *params.Author) + } + if params != nil && params.Body != nil { + data.Set("Body", *params.Body) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.Subject != nil { + data.Set("Subject", *params.Subject) + } if params != nil && params.XTwilioWebhookEnabled != nil { diff --git a/rest/conversations/v1/conversations_messages_receipts.go b/rest/conversations/v1/conversations_messages_receipts.go index 1bf2eb479..2516c22ed 100644 --- a/rest/conversations/v1/conversations_messages_receipts.go +++ b/rest/conversations/v1/conversations_messages_receipts.go @@ -35,6 +35,7 @@ func (c *ApiService) FetchConversationMessageReceipt(ConversationSid string, Mes + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -76,9 +77,10 @@ func (c *ApiService) PageConversationMessageReceipt(ConversationSid string, Mess data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/conversations/v1/conversations_participants.go b/rest/conversations/v1/conversations_participants.go index 19ccdfd4b..570788258 100644 --- a/rest/conversations/v1/conversations_participants.go +++ b/rest/conversations/v1/conversations_participants.go @@ -89,30 +89,31 @@ func (c *ApiService) CreateConversationParticipant(ConversationSid string, param data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Identity != nil { - data.Set("Identity", *params.Identity) -} -if params != nil && params.MessagingBindingAddress != nil { - data.Set("MessagingBinding.Address", *params.MessagingBindingAddress) -} -if params != nil && params.MessagingBindingProxyAddress != nil { - data.Set("MessagingBinding.ProxyAddress", *params.MessagingBindingProxyAddress) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.MessagingBindingProjectedAddress != nil { - data.Set("MessagingBinding.ProjectedAddress", *params.MessagingBindingProjectedAddress) -} -if params != nil && params.RoleSid != nil { - data.Set("RoleSid", *params.RoleSid) -} + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.MessagingBindingAddress != nil { + data.Set("MessagingBinding.Address", *params.MessagingBindingAddress) + } + if params != nil && params.MessagingBindingProxyAddress != nil { + data.Set("MessagingBinding.ProxyAddress", *params.MessagingBindingProxyAddress) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.MessagingBindingProjectedAddress != nil { + data.Set("MessagingBinding.ProjectedAddress", *params.MessagingBindingProjectedAddress) + } + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } if params != nil && params.XTwilioWebhookEnabled != nil { @@ -155,6 +156,7 @@ func (c *ApiService) DeleteConversationParticipant(ConversationSid string, Sid s headers := make(map[string]interface{}) + if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -180,6 +182,7 @@ func (c *ApiService) FetchConversationParticipant(ConversationSid string, Sid st + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -220,9 +223,10 @@ func (c *ApiService) PageConversationParticipant(ConversationSid string, params data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -407,33 +411,34 @@ func (c *ApiService) UpdateConversationParticipant(ConversationSid string, Sid s data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.RoleSid != nil { - data.Set("RoleSid", *params.RoleSid) -} -if params != nil && params.MessagingBindingProxyAddress != nil { - data.Set("MessagingBinding.ProxyAddress", *params.MessagingBindingProxyAddress) -} -if params != nil && params.MessagingBindingProjectedAddress != nil { - data.Set("MessagingBinding.ProjectedAddress", *params.MessagingBindingProjectedAddress) -} -if params != nil && params.Identity != nil { - data.Set("Identity", *params.Identity) -} -if params != nil && params.LastReadMessageIndex != nil { - data.Set("LastReadMessageIndex", fmt.Sprint(*params.LastReadMessageIndex)) -} -if params != nil && params.LastReadTimestamp != nil { - data.Set("LastReadTimestamp", *params.LastReadTimestamp) -} + + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } + if params != nil && params.MessagingBindingProxyAddress != nil { + data.Set("MessagingBinding.ProxyAddress", *params.MessagingBindingProxyAddress) + } + if params != nil && params.MessagingBindingProjectedAddress != nil { + data.Set("MessagingBinding.ProjectedAddress", *params.MessagingBindingProjectedAddress) + } + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.LastReadMessageIndex != nil { + data.Set("LastReadMessageIndex", fmt.Sprint(*params.LastReadMessageIndex)) + } + if params != nil && params.LastReadTimestamp != nil { + data.Set("LastReadTimestamp", *params.LastReadTimestamp) + } if params != nil && params.XTwilioWebhookEnabled != nil { diff --git a/rest/conversations/v1/conversations_webhooks.go b/rest/conversations/v1/conversations_webhooks.go index 5ad223741..4f11109b5 100644 --- a/rest/conversations/v1/conversations_webhooks.go +++ b/rest/conversations/v1/conversations_webhooks.go @@ -77,31 +77,32 @@ func (c *ApiService) CreateConversationScopedWebhook(ConversationSid string, par data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Target != nil { - data.Set("Target", *params.Target) -} -if params != nil && params.ConfigurationUrl != nil { - data.Set("Configuration.Url", *params.ConfigurationUrl) -} -if params != nil && params.ConfigurationMethod != nil { - data.Set("Configuration.Method", *params.ConfigurationMethod) -} -if params != nil && params.ConfigurationFilters != nil { - for _, item := range *params.ConfigurationFilters { - data.Add("Configuration.Filters", item) + + if params != nil && params.Target != nil { + data.Set("Target", *params.Target) } -} -if params != nil && params.ConfigurationTriggers != nil { - for _, item := range *params.ConfigurationTriggers { - data.Add("Configuration.Triggers", item) + if params != nil && params.ConfigurationUrl != nil { + data.Set("Configuration.Url", *params.ConfigurationUrl) + } + if params != nil && params.ConfigurationMethod != nil { + data.Set("Configuration.Method", *params.ConfigurationMethod) + } + if params != nil && params.ConfigurationFilters != nil { + for _, item := range *params.ConfigurationFilters { + data.Add("Configuration.Filters", item) + } + } + if params != nil && params.ConfigurationTriggers != nil { + for _, item := range *params.ConfigurationTriggers { + data.Add("Configuration.Triggers", item) + } + } + if params != nil && params.ConfigurationFlowSid != nil { + data.Set("Configuration.FlowSid", *params.ConfigurationFlowSid) + } + if params != nil && params.ConfigurationReplayAfter != nil { + data.Set("Configuration.ReplayAfter", fmt.Sprint(*params.ConfigurationReplayAfter)) } -} -if params != nil && params.ConfigurationFlowSid != nil { - data.Set("Configuration.FlowSid", *params.ConfigurationFlowSid) -} -if params != nil && params.ConfigurationReplayAfter != nil { - data.Set("Configuration.ReplayAfter", fmt.Sprint(*params.ConfigurationReplayAfter)) -} @@ -131,6 +132,7 @@ func (c *ApiService) DeleteConversationScopedWebhook(ConversationSid string, Sid + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -152,6 +154,7 @@ func (c *ApiService) FetchConversationScopedWebhook(ConversationSid string, Sid + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -192,9 +195,10 @@ func (c *ApiService) PageConversationScopedWebhook(ConversationSid string, param data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -349,25 +353,26 @@ func (c *ApiService) UpdateConversationScopedWebhook(ConversationSid string, Sid data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ConfigurationUrl != nil { - data.Set("Configuration.Url", *params.ConfigurationUrl) -} -if params != nil && params.ConfigurationMethod != nil { - data.Set("Configuration.Method", *params.ConfigurationMethod) -} -if params != nil && params.ConfigurationFilters != nil { - for _, item := range *params.ConfigurationFilters { - data.Add("Configuration.Filters", item) + + if params != nil && params.ConfigurationUrl != nil { + data.Set("Configuration.Url", *params.ConfigurationUrl) } -} -if params != nil && params.ConfigurationTriggers != nil { - for _, item := range *params.ConfigurationTriggers { - data.Add("Configuration.Triggers", item) + if params != nil && params.ConfigurationMethod != nil { + data.Set("Configuration.Method", *params.ConfigurationMethod) + } + if params != nil && params.ConfigurationFilters != nil { + for _, item := range *params.ConfigurationFilters { + data.Add("Configuration.Filters", item) + } + } + if params != nil && params.ConfigurationTriggers != nil { + for _, item := range *params.ConfigurationTriggers { + data.Add("Configuration.Triggers", item) + } + } + if params != nil && params.ConfigurationFlowSid != nil { + data.Set("Configuration.FlowSid", *params.ConfigurationFlowSid) } -} -if params != nil && params.ConfigurationFlowSid != nil { - data.Set("Configuration.FlowSid", *params.ConfigurationFlowSid) -} diff --git a/rest/conversations/v1/credentials.go b/rest/conversations/v1/credentials.go index 013f5df64..5058e881e 100644 --- a/rest/conversations/v1/credentials.go +++ b/rest/conversations/v1/credentials.go @@ -76,27 +76,28 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*Conversa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Certificate != nil { - data.Set("Certificate", *params.Certificate) -} -if params != nil && params.PrivateKey != nil { - data.Set("PrivateKey", *params.PrivateKey) -} -if params != nil && params.Sandbox != nil { - data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) -} -if params != nil && params.ApiKey != nil { - data.Set("ApiKey", *params.ApiKey) -} -if params != nil && params.Secret != nil { - data.Set("Secret", *params.Secret) -} + + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Certificate != nil { + data.Set("Certificate", *params.Certificate) + } + if params != nil && params.PrivateKey != nil { + data.Set("PrivateKey", *params.PrivateKey) + } + if params != nil && params.Sandbox != nil { + data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) + } + if params != nil && params.ApiKey != nil { + data.Set("ApiKey", *params.ApiKey) + } + if params != nil && params.Secret != nil { + data.Set("Secret", *params.Secret) + } @@ -125,6 +126,7 @@ func (c *ApiService) DeleteCredential(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -145,6 +147,7 @@ func (c *ApiService) FetchCredential(Sid string, ) (*ConversationsV1Credential, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -184,9 +187,10 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken, pag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -352,27 +356,28 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Certificate != nil { - data.Set("Certificate", *params.Certificate) -} -if params != nil && params.PrivateKey != nil { - data.Set("PrivateKey", *params.PrivateKey) -} -if params != nil && params.Sandbox != nil { - data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) -} -if params != nil && params.ApiKey != nil { - data.Set("ApiKey", *params.ApiKey) -} -if params != nil && params.Secret != nil { - data.Set("Secret", *params.Secret) -} + + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Certificate != nil { + data.Set("Certificate", *params.Certificate) + } + if params != nil && params.PrivateKey != nil { + data.Set("PrivateKey", *params.PrivateKey) + } + if params != nil && params.Sandbox != nil { + data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) + } + if params != nil && params.ApiKey != nil { + data.Set("ApiKey", *params.ApiKey) + } + if params != nil && params.Secret != nil { + data.Set("Secret", *params.Secret) + } diff --git a/rest/conversations/v1/participant_conversations.go b/rest/conversations/v1/participant_conversations.go index d4f232216..8c5dfc10d 100644 --- a/rest/conversations/v1/participant_conversations.go +++ b/rest/conversations/v1/participant_conversations.go @@ -59,15 +59,16 @@ func (c *ApiService) PageParticipantConversation(params *ListParticipantConversa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Identity != nil { - data.Set("Identity", *params.Identity) -} -if params != nil && params.Address != nil { - data.Set("Address", *params.Address) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.Address != nil { + data.Set("Address", *params.Address) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/conversations/v1/roles.go b/rest/conversations/v1/roles.go index d1a2b46ef..0c67f7b14 100644 --- a/rest/conversations/v1/roles.go +++ b/rest/conversations/v1/roles.go @@ -52,17 +52,18 @@ func (c *ApiService) CreateRole(params *CreateRoleParams) (*ConversationsV1Role, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.Permission != nil { - for _, item := range *params.Permission { - data.Add("Permission", item) + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } + if params != nil && params.Permission != nil { + for _, item := range *params.Permission { + data.Add("Permission", item) + } } -} @@ -91,6 +92,7 @@ func (c *ApiService) DeleteRole(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -111,6 +113,7 @@ func (c *ApiService) FetchRole(Sid string, ) (*ConversationsV1Role, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -150,9 +153,10 @@ func (c *ApiService) PageRole(params *ListRoleParams, pageToken, pageNumber stri data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -282,11 +286,12 @@ func (c *ApiService) UpdateRole(Sid string, params *UpdateRoleParams) (*Conversa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Permission != nil { - for _, item := range *params.Permission { - data.Add("Permission", item) + + if params != nil && params.Permission != nil { + for _, item := range *params.Permission { + data.Add("Permission", item) + } } -} diff --git a/rest/conversations/v1/services.go b/rest/conversations/v1/services.go index 8dfe6b7c2..6134e5da4 100644 --- a/rest/conversations/v1/services.go +++ b/rest/conversations/v1/services.go @@ -40,9 +40,10 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ConversationsV data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } @@ -71,6 +72,7 @@ func (c *ApiService) DeleteService(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -91,6 +93,7 @@ func (c *ApiService) FetchService(Sid string, ) (*ConversationsV1Service, error) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -130,9 +133,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/conversations/v1/services_bindings.go b/rest/conversations/v1/services_bindings.go index 54a7c5d42..04d147bd6 100644 --- a/rest/conversations/v1/services_bindings.go +++ b/rest/conversations/v1/services_bindings.go @@ -34,6 +34,7 @@ func (c *ApiService) DeleteServiceBinding(ChatServiceSid string, Sid string, ) ( + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -55,6 +56,7 @@ func (c *ApiService) FetchServiceBinding(ChatServiceSid string, Sid string, ) (* + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -107,19 +109,20 @@ func (c *ApiService) PageServiceBinding(ChatServiceSid string, params *ListServi data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.BindingType != nil { - for _, item := range *params.BindingType { - data.Add("BindingType", item) + + if params != nil && params.BindingType != nil { + for _, item := range *params.BindingType { + data.Add("BindingType", item) } -} -if params != nil && params.Identity != nil { - for _, item := range *params.Identity { - data.Add("Identity", item) } -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + if params != nil && params.Identity != nil { + for _, item := range *params.Identity { + data.Add("Identity", item) + } + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/conversations/v1/services_configuration.go b/rest/conversations/v1/services_configuration.go index 01fdf5f87..771e5ea89 100644 --- a/rest/conversations/v1/services_configuration.go +++ b/rest/conversations/v1/services_configuration.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchServiceConfiguration(ChatServiceSid string, ) (*Conver + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -84,18 +85,19 @@ func (c *ApiService) UpdateServiceConfiguration(ChatServiceSid string, params *U data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.DefaultConversationCreatorRoleSid != nil { - data.Set("DefaultConversationCreatorRoleSid", *params.DefaultConversationCreatorRoleSid) -} -if params != nil && params.DefaultConversationRoleSid != nil { - data.Set("DefaultConversationRoleSid", *params.DefaultConversationRoleSid) -} -if params != nil && params.DefaultChatServiceRoleSid != nil { - data.Set("DefaultChatServiceRoleSid", *params.DefaultChatServiceRoleSid) -} -if params != nil && params.ReachabilityEnabled != nil { - data.Set("ReachabilityEnabled", fmt.Sprint(*params.ReachabilityEnabled)) -} + + if params != nil && params.DefaultConversationCreatorRoleSid != nil { + data.Set("DefaultConversationCreatorRoleSid", *params.DefaultConversationCreatorRoleSid) + } + if params != nil && params.DefaultConversationRoleSid != nil { + data.Set("DefaultConversationRoleSid", *params.DefaultConversationRoleSid) + } + if params != nil && params.DefaultChatServiceRoleSid != nil { + data.Set("DefaultChatServiceRoleSid", *params.DefaultChatServiceRoleSid) + } + if params != nil && params.ReachabilityEnabled != nil { + data.Set("ReachabilityEnabled", fmt.Sprint(*params.ReachabilityEnabled)) + } diff --git a/rest/conversations/v1/services_configuration_notifications.go b/rest/conversations/v1/services_configuration_notifications.go index ed00ef2f0..5c91a469d 100644 --- a/rest/conversations/v1/services_configuration_notifications.go +++ b/rest/conversations/v1/services_configuration_notifications.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchServiceNotification(ChatServiceSid string, ) (*Convers + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -138,45 +139,46 @@ func (c *ApiService) UpdateServiceNotification(ChatServiceSid string, params *Up data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.LogEnabled != nil { - data.Set("LogEnabled", fmt.Sprint(*params.LogEnabled)) -} -if params != nil && params.NewMessageEnabled != nil { - data.Set("NewMessage.Enabled", fmt.Sprint(*params.NewMessageEnabled)) -} -if params != nil && params.NewMessageTemplate != nil { - data.Set("NewMessage.Template", *params.NewMessageTemplate) -} -if params != nil && params.NewMessageSound != nil { - data.Set("NewMessage.Sound", *params.NewMessageSound) -} -if params != nil && params.NewMessageBadgeCountEnabled != nil { - data.Set("NewMessage.BadgeCountEnabled", fmt.Sprint(*params.NewMessageBadgeCountEnabled)) -} -if params != nil && params.AddedToConversationEnabled != nil { - data.Set("AddedToConversation.Enabled", fmt.Sprint(*params.AddedToConversationEnabled)) -} -if params != nil && params.AddedToConversationTemplate != nil { - data.Set("AddedToConversation.Template", *params.AddedToConversationTemplate) -} -if params != nil && params.AddedToConversationSound != nil { - data.Set("AddedToConversation.Sound", *params.AddedToConversationSound) -} -if params != nil && params.RemovedFromConversationEnabled != nil { - data.Set("RemovedFromConversation.Enabled", fmt.Sprint(*params.RemovedFromConversationEnabled)) -} -if params != nil && params.RemovedFromConversationTemplate != nil { - data.Set("RemovedFromConversation.Template", *params.RemovedFromConversationTemplate) -} -if params != nil && params.RemovedFromConversationSound != nil { - data.Set("RemovedFromConversation.Sound", *params.RemovedFromConversationSound) -} -if params != nil && params.NewMessageWithMediaEnabled != nil { - data.Set("NewMessage.WithMedia.Enabled", fmt.Sprint(*params.NewMessageWithMediaEnabled)) -} -if params != nil && params.NewMessageWithMediaTemplate != nil { - data.Set("NewMessage.WithMedia.Template", *params.NewMessageWithMediaTemplate) -} + + if params != nil && params.LogEnabled != nil { + data.Set("LogEnabled", fmt.Sprint(*params.LogEnabled)) + } + if params != nil && params.NewMessageEnabled != nil { + data.Set("NewMessage.Enabled", fmt.Sprint(*params.NewMessageEnabled)) + } + if params != nil && params.NewMessageTemplate != nil { + data.Set("NewMessage.Template", *params.NewMessageTemplate) + } + if params != nil && params.NewMessageSound != nil { + data.Set("NewMessage.Sound", *params.NewMessageSound) + } + if params != nil && params.NewMessageBadgeCountEnabled != nil { + data.Set("NewMessage.BadgeCountEnabled", fmt.Sprint(*params.NewMessageBadgeCountEnabled)) + } + if params != nil && params.AddedToConversationEnabled != nil { + data.Set("AddedToConversation.Enabled", fmt.Sprint(*params.AddedToConversationEnabled)) + } + if params != nil && params.AddedToConversationTemplate != nil { + data.Set("AddedToConversation.Template", *params.AddedToConversationTemplate) + } + if params != nil && params.AddedToConversationSound != nil { + data.Set("AddedToConversation.Sound", *params.AddedToConversationSound) + } + if params != nil && params.RemovedFromConversationEnabled != nil { + data.Set("RemovedFromConversation.Enabled", fmt.Sprint(*params.RemovedFromConversationEnabled)) + } + if params != nil && params.RemovedFromConversationTemplate != nil { + data.Set("RemovedFromConversation.Template", *params.RemovedFromConversationTemplate) + } + if params != nil && params.RemovedFromConversationSound != nil { + data.Set("RemovedFromConversation.Sound", *params.RemovedFromConversationSound) + } + if params != nil && params.NewMessageWithMediaEnabled != nil { + data.Set("NewMessage.WithMedia.Enabled", fmt.Sprint(*params.NewMessageWithMediaEnabled)) + } + if params != nil && params.NewMessageWithMediaTemplate != nil { + data.Set("NewMessage.WithMedia.Template", *params.NewMessageWithMediaTemplate) + } diff --git a/rest/conversations/v1/services_configuration_webhooks.go b/rest/conversations/v1/services_configuration_webhooks.go index 0e89ec36c..46e982226 100644 --- a/rest/conversations/v1/services_configuration_webhooks.go +++ b/rest/conversations/v1/services_configuration_webhooks.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchServiceWebhookConfiguration(ChatServiceSid string, ) ( + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -84,20 +85,21 @@ func (c *ApiService) UpdateServiceWebhookConfiguration(ChatServiceSid string, pa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PreWebhookUrl != nil { - data.Set("PreWebhookUrl", *params.PreWebhookUrl) -} -if params != nil && params.PostWebhookUrl != nil { - data.Set("PostWebhookUrl", *params.PostWebhookUrl) -} -if params != nil && params.Filters != nil { - for _, item := range *params.Filters { - data.Add("Filters", item) + + if params != nil && params.PreWebhookUrl != nil { + data.Set("PreWebhookUrl", *params.PreWebhookUrl) + } + if params != nil && params.PostWebhookUrl != nil { + data.Set("PostWebhookUrl", *params.PostWebhookUrl) + } + if params != nil && params.Filters != nil { + for _, item := range *params.Filters { + data.Add("Filters", item) + } + } + if params != nil && params.Method != nil { + data.Set("Method", *params.Method) } -} -if params != nil && params.Method != nil { - data.Set("Method", *params.Method) -} diff --git a/rest/conversations/v1/services_conversations.go b/rest/conversations/v1/services_conversations.go index ee0462c9c..8b8e135b4 100644 --- a/rest/conversations/v1/services_conversations.go +++ b/rest/conversations/v1/services_conversations.go @@ -107,39 +107,40 @@ func (c *ApiService) CreateServiceConversation(ChatServiceSid string, params *Cr 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) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.MessagingServiceSid != nil { - data.Set("MessagingServiceSid", *params.MessagingServiceSid) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.State != nil { - data.Set("State", *params.State) -} -if params != nil && params.TimersInactive != nil { - data.Set("Timers.Inactive", *params.TimersInactive) -} -if params != nil && params.TimersClosed != nil { - data.Set("Timers.Closed", *params.TimersClosed) -} -if params != nil && params.BindingsEmailAddress != nil { - data.Set("Bindings.Email.Address", *params.BindingsEmailAddress) -} -if params != nil && params.BindingsEmailName != nil { - data.Set("Bindings.Email.Name", *params.BindingsEmailName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.MessagingServiceSid != nil { + data.Set("MessagingServiceSid", *params.MessagingServiceSid) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.State != nil { + data.Set("State", *params.State) + } + if params != nil && params.TimersInactive != nil { + data.Set("Timers.Inactive", *params.TimersInactive) + } + if params != nil && params.TimersClosed != nil { + data.Set("Timers.Closed", *params.TimersClosed) + } + if params != nil && params.BindingsEmailAddress != nil { + data.Set("Bindings.Email.Address", *params.BindingsEmailAddress) + } + if params != nil && params.BindingsEmailName != nil { + data.Set("Bindings.Email.Name", *params.BindingsEmailName) + } if params != nil && params.XTwilioWebhookEnabled != nil { @@ -182,6 +183,7 @@ func (c *ApiService) DeleteServiceConversation(ChatServiceSid string, Sid string headers := make(map[string]interface{}) + if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -207,6 +209,7 @@ func (c *ApiService) FetchServiceConversation(ChatServiceSid string, Sid string, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -265,18 +268,19 @@ func (c *ApiService) PageServiceConversation(ChatServiceSid string, params *List data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.StartDate != nil { - data.Set("StartDate", *params.StartDate) -} -if params != nil && params.EndDate != nil { - data.Set("EndDate", *params.EndDate) -} -if params != nil && params.State != nil { - data.Set("State", *params.State) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.StartDate != nil { + data.Set("StartDate", *params.StartDate) + } + if params != nil && params.EndDate != nil { + data.Set("EndDate", *params.EndDate) + } + if params != nil && params.State != nil { + data.Set("State", *params.State) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -473,39 +477,40 @@ func (c *ApiService) UpdateServiceConversation(ChatServiceSid string, Sid string data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.MessagingServiceSid != nil { - data.Set("MessagingServiceSid", *params.MessagingServiceSid) -} -if params != nil && params.State != nil { - data.Set("State", *params.State) -} -if params != nil && params.TimersInactive != nil { - data.Set("Timers.Inactive", *params.TimersInactive) -} -if params != nil && params.TimersClosed != nil { - data.Set("Timers.Closed", *params.TimersClosed) -} -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.BindingsEmailAddress != nil { - data.Set("Bindings.Email.Address", *params.BindingsEmailAddress) -} -if params != nil && params.BindingsEmailName != nil { - data.Set("Bindings.Email.Name", *params.BindingsEmailName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.MessagingServiceSid != nil { + data.Set("MessagingServiceSid", *params.MessagingServiceSid) + } + if params != nil && params.State != nil { + data.Set("State", *params.State) + } + if params != nil && params.TimersInactive != nil { + data.Set("Timers.Inactive", *params.TimersInactive) + } + if params != nil && params.TimersClosed != nil { + data.Set("Timers.Closed", *params.TimersClosed) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.BindingsEmailAddress != nil { + data.Set("Bindings.Email.Address", *params.BindingsEmailAddress) + } + if params != nil && params.BindingsEmailName != nil { + data.Set("Bindings.Email.Name", *params.BindingsEmailName) + } if params != nil && params.XTwilioWebhookEnabled != nil { diff --git a/rest/conversations/v1/services_conversations_messages.go b/rest/conversations/v1/services_conversations_messages.go index 86cd1af1b..ebab10504 100644 --- a/rest/conversations/v1/services_conversations_messages.go +++ b/rest/conversations/v1/services_conversations_messages.go @@ -96,33 +96,34 @@ func (c *ApiService) CreateServiceConversationMessage(ChatServiceSid string, Con data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Author != nil { - data.Set("Author", *params.Author) -} -if params != nil && params.Body != nil { - data.Set("Body", *params.Body) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.MediaSid != nil { - data.Set("MediaSid", *params.MediaSid) -} -if params != nil && params.ContentSid != nil { - data.Set("ContentSid", *params.ContentSid) -} -if params != nil && params.ContentVariables != nil { - data.Set("ContentVariables", *params.ContentVariables) -} -if params != nil && params.Subject != nil { - data.Set("Subject", *params.Subject) -} + + if params != nil && params.Author != nil { + data.Set("Author", *params.Author) + } + if params != nil && params.Body != nil { + data.Set("Body", *params.Body) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.MediaSid != nil { + data.Set("MediaSid", *params.MediaSid) + } + if params != nil && params.ContentSid != nil { + data.Set("ContentSid", *params.ContentSid) + } + if params != nil && params.ContentVariables != nil { + data.Set("ContentVariables", *params.ContentVariables) + } + if params != nil && params.Subject != nil { + data.Set("Subject", *params.Subject) + } if params != nil && params.XTwilioWebhookEnabled != nil { @@ -166,6 +167,7 @@ func (c *ApiService) DeleteServiceConversationMessage(ChatServiceSid string, Con headers := make(map[string]interface{}) + if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -192,6 +194,7 @@ func (c *ApiService) FetchServiceConversationMessage(ChatServiceSid string, Conv + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -239,12 +242,13 @@ func (c *ApiService) PageServiceConversationMessage(ChatServiceSid string, Conve 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)) -} + + if params != nil && params.Order != nil { + data.Set("Order", *params.Order) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -412,24 +416,25 @@ func (c *ApiService) UpdateServiceConversationMessage(ChatServiceSid string, Con data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Author != nil { - data.Set("Author", *params.Author) -} -if params != nil && params.Body != nil { - data.Set("Body", *params.Body) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.Subject != nil { - data.Set("Subject", *params.Subject) -} + + if params != nil && params.Author != nil { + data.Set("Author", *params.Author) + } + if params != nil && params.Body != nil { + data.Set("Body", *params.Body) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.Subject != nil { + data.Set("Subject", *params.Subject) + } if params != nil && params.XTwilioWebhookEnabled != nil { diff --git a/rest/conversations/v1/services_conversations_messages_receipts.go b/rest/conversations/v1/services_conversations_messages_receipts.go index 0cc8ed754..cee191f82 100644 --- a/rest/conversations/v1/services_conversations_messages_receipts.go +++ b/rest/conversations/v1/services_conversations_messages_receipts.go @@ -36,6 +36,7 @@ func (c *ApiService) FetchServiceConversationMessageReceipt(ChatServiceSid strin + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -78,9 +79,10 @@ func (c *ApiService) PageServiceConversationMessageReceipt(ChatServiceSid string data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/conversations/v1/services_conversations_participants.go b/rest/conversations/v1/services_conversations_participants.go index 2b2721314..bcfac85af 100644 --- a/rest/conversations/v1/services_conversations_participants.go +++ b/rest/conversations/v1/services_conversations_participants.go @@ -90,30 +90,31 @@ func (c *ApiService) CreateServiceConversationParticipant(ChatServiceSid string, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Identity != nil { - data.Set("Identity", *params.Identity) -} -if params != nil && params.MessagingBindingAddress != nil { - data.Set("MessagingBinding.Address", *params.MessagingBindingAddress) -} -if params != nil && params.MessagingBindingProxyAddress != nil { - data.Set("MessagingBinding.ProxyAddress", *params.MessagingBindingProxyAddress) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.MessagingBindingProjectedAddress != nil { - data.Set("MessagingBinding.ProjectedAddress", *params.MessagingBindingProjectedAddress) -} -if params != nil && params.RoleSid != nil { - data.Set("RoleSid", *params.RoleSid) -} + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.MessagingBindingAddress != nil { + data.Set("MessagingBinding.Address", *params.MessagingBindingAddress) + } + if params != nil && params.MessagingBindingProxyAddress != nil { + data.Set("MessagingBinding.ProxyAddress", *params.MessagingBindingProxyAddress) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.MessagingBindingProjectedAddress != nil { + data.Set("MessagingBinding.ProjectedAddress", *params.MessagingBindingProjectedAddress) + } + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } if params != nil && params.XTwilioWebhookEnabled != nil { @@ -157,6 +158,7 @@ func (c *ApiService) DeleteServiceConversationParticipant(ChatServiceSid string, headers := make(map[string]interface{}) + if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -183,6 +185,7 @@ func (c *ApiService) FetchServiceConversationParticipant(ChatServiceSid string, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -224,9 +227,10 @@ func (c *ApiService) PageServiceConversationParticipant(ChatServiceSid string, C data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -412,33 +416,34 @@ func (c *ApiService) UpdateServiceConversationParticipant(ChatServiceSid string, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.Identity != nil { - data.Set("Identity", *params.Identity) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.RoleSid != nil { - data.Set("RoleSid", *params.RoleSid) -} -if params != nil && params.MessagingBindingProxyAddress != nil { - data.Set("MessagingBinding.ProxyAddress", *params.MessagingBindingProxyAddress) -} -if params != nil && params.MessagingBindingProjectedAddress != nil { - data.Set("MessagingBinding.ProjectedAddress", *params.MessagingBindingProjectedAddress) -} -if params != nil && params.LastReadMessageIndex != nil { - data.Set("LastReadMessageIndex", fmt.Sprint(*params.LastReadMessageIndex)) -} -if params != nil && params.LastReadTimestamp != nil { - data.Set("LastReadTimestamp", *params.LastReadTimestamp) -} + + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } + if params != nil && params.MessagingBindingProxyAddress != nil { + data.Set("MessagingBinding.ProxyAddress", *params.MessagingBindingProxyAddress) + } + if params != nil && params.MessagingBindingProjectedAddress != nil { + data.Set("MessagingBinding.ProjectedAddress", *params.MessagingBindingProjectedAddress) + } + if params != nil && params.LastReadMessageIndex != nil { + data.Set("LastReadMessageIndex", fmt.Sprint(*params.LastReadMessageIndex)) + } + if params != nil && params.LastReadTimestamp != nil { + data.Set("LastReadTimestamp", *params.LastReadTimestamp) + } if params != nil && params.XTwilioWebhookEnabled != nil { diff --git a/rest/conversations/v1/services_conversations_webhooks.go b/rest/conversations/v1/services_conversations_webhooks.go index d9bc498e1..57f549822 100644 --- a/rest/conversations/v1/services_conversations_webhooks.go +++ b/rest/conversations/v1/services_conversations_webhooks.go @@ -78,31 +78,32 @@ func (c *ApiService) CreateServiceConversationScopedWebhook(ChatServiceSid strin data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Target != nil { - data.Set("Target", *params.Target) -} -if params != nil && params.ConfigurationUrl != nil { - data.Set("Configuration.Url", *params.ConfigurationUrl) -} -if params != nil && params.ConfigurationMethod != nil { - data.Set("Configuration.Method", *params.ConfigurationMethod) -} -if params != nil && params.ConfigurationFilters != nil { - for _, item := range *params.ConfigurationFilters { - data.Add("Configuration.Filters", item) + + if params != nil && params.Target != nil { + data.Set("Target", *params.Target) } -} -if params != nil && params.ConfigurationTriggers != nil { - for _, item := range *params.ConfigurationTriggers { - data.Add("Configuration.Triggers", item) + if params != nil && params.ConfigurationUrl != nil { + data.Set("Configuration.Url", *params.ConfigurationUrl) + } + if params != nil && params.ConfigurationMethod != nil { + data.Set("Configuration.Method", *params.ConfigurationMethod) + } + if params != nil && params.ConfigurationFilters != nil { + for _, item := range *params.ConfigurationFilters { + data.Add("Configuration.Filters", item) + } + } + if params != nil && params.ConfigurationTriggers != nil { + for _, item := range *params.ConfigurationTriggers { + data.Add("Configuration.Triggers", item) + } + } + if params != nil && params.ConfigurationFlowSid != nil { + data.Set("Configuration.FlowSid", *params.ConfigurationFlowSid) + } + if params != nil && params.ConfigurationReplayAfter != nil { + data.Set("Configuration.ReplayAfter", fmt.Sprint(*params.ConfigurationReplayAfter)) } -} -if params != nil && params.ConfigurationFlowSid != nil { - data.Set("Configuration.FlowSid", *params.ConfigurationFlowSid) -} -if params != nil && params.ConfigurationReplayAfter != nil { - data.Set("Configuration.ReplayAfter", fmt.Sprint(*params.ConfigurationReplayAfter)) -} @@ -133,6 +134,7 @@ func (c *ApiService) DeleteServiceConversationScopedWebhook(ChatServiceSid strin + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -155,6 +157,7 @@ func (c *ApiService) FetchServiceConversationScopedWebhook(ChatServiceSid string + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -196,9 +199,10 @@ func (c *ApiService) PageServiceConversationScopedWebhook(ChatServiceSid string, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -354,25 +358,26 @@ func (c *ApiService) UpdateServiceConversationScopedWebhook(ChatServiceSid strin data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ConfigurationUrl != nil { - data.Set("Configuration.Url", *params.ConfigurationUrl) -} -if params != nil && params.ConfigurationMethod != nil { - data.Set("Configuration.Method", *params.ConfigurationMethod) -} -if params != nil && params.ConfigurationFilters != nil { - for _, item := range *params.ConfigurationFilters { - data.Add("Configuration.Filters", item) + + if params != nil && params.ConfigurationUrl != nil { + data.Set("Configuration.Url", *params.ConfigurationUrl) } -} -if params != nil && params.ConfigurationTriggers != nil { - for _, item := range *params.ConfigurationTriggers { - data.Add("Configuration.Triggers", item) + if params != nil && params.ConfigurationMethod != nil { + data.Set("Configuration.Method", *params.ConfigurationMethod) + } + if params != nil && params.ConfigurationFilters != nil { + for _, item := range *params.ConfigurationFilters { + data.Add("Configuration.Filters", item) + } + } + if params != nil && params.ConfigurationTriggers != nil { + for _, item := range *params.ConfigurationTriggers { + data.Add("Configuration.Triggers", item) + } + } + if params != nil && params.ConfigurationFlowSid != nil { + data.Set("Configuration.FlowSid", *params.ConfigurationFlowSid) } -} -if params != nil && params.ConfigurationFlowSid != nil { - data.Set("Configuration.FlowSid", *params.ConfigurationFlowSid) -} diff --git a/rest/conversations/v1/services_participant_conversations.go b/rest/conversations/v1/services_participant_conversations.go index 6aba254ed..217e240c4 100644 --- a/rest/conversations/v1/services_participant_conversations.go +++ b/rest/conversations/v1/services_participant_conversations.go @@ -60,15 +60,16 @@ func (c *ApiService) PageServiceParticipantConversation(ChatServiceSid string, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Identity != nil { - data.Set("Identity", *params.Identity) -} -if params != nil && params.Address != nil { - data.Set("Address", *params.Address) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.Address != nil { + data.Set("Address", *params.Address) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/conversations/v1/services_roles.go b/rest/conversations/v1/services_roles.go index 37c396d15..cef897ebc 100644 --- a/rest/conversations/v1/services_roles.go +++ b/rest/conversations/v1/services_roles.go @@ -53,17 +53,18 @@ func (c *ApiService) CreateServiceRole(ChatServiceSid string, params *CreateServ data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.Permission != nil { - for _, item := range *params.Permission { - data.Add("Permission", item) + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } + if params != nil && params.Permission != nil { + for _, item := range *params.Permission { + data.Add("Permission", item) + } } -} @@ -93,6 +94,7 @@ func (c *ApiService) DeleteServiceRole(ChatServiceSid string, Sid string, ) (err + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -114,6 +116,7 @@ func (c *ApiService) FetchServiceRole(ChatServiceSid string, Sid string, ) (*Con + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -154,9 +157,10 @@ func (c *ApiService) PageServiceRole(ChatServiceSid string, params *ListServiceR data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -287,11 +291,12 @@ func (c *ApiService) UpdateServiceRole(ChatServiceSid string, Sid string, params data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Permission != nil { - for _, item := range *params.Permission { - data.Add("Permission", item) + + if params != nil && params.Permission != nil { + for _, item := range *params.Permission { + data.Add("Permission", item) + } } -} diff --git a/rest/conversations/v1/services_users.go b/rest/conversations/v1/services_users.go index b64631c4a..db0c05b0e 100644 --- a/rest/conversations/v1/services_users.go +++ b/rest/conversations/v1/services_users.go @@ -65,18 +65,19 @@ func (c *ApiService) CreateServiceUser(ChatServiceSid string, params *CreateServ data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Identity != nil { - data.Set("Identity", *params.Identity) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.RoleSid != nil { - data.Set("RoleSid", *params.RoleSid) -} + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } if params != nil && params.XTwilioWebhookEnabled != nil { @@ -119,6 +120,7 @@ func (c *ApiService) DeleteServiceUser(ChatServiceSid string, Sid string, params headers := make(map[string]interface{}) + if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -144,6 +146,7 @@ func (c *ApiService) FetchServiceUser(ChatServiceSid string, Sid string, ) (*Con + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -184,9 +187,10 @@ func (c *ApiService) PageServiceUser(ChatServiceSid string, params *ListServiceU data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -335,15 +339,16 @@ func (c *ApiService) UpdateServiceUser(ChatServiceSid string, Sid string, params data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.RoleSid != nil { - data.Set("RoleSid", *params.RoleSid) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } if params != nil && params.XTwilioWebhookEnabled != nil { diff --git a/rest/conversations/v1/services_users_conversations.go b/rest/conversations/v1/services_users_conversations.go index 7c759c83b..0b9d58693 100644 --- a/rest/conversations/v1/services_users_conversations.go +++ b/rest/conversations/v1/services_users_conversations.go @@ -35,6 +35,7 @@ func (c *ApiService) DeleteServiceUserConversation(ChatServiceSid string, UserSi + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -57,6 +58,7 @@ func (c *ApiService) FetchServiceUserConversation(ChatServiceSid string, UserSid + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -98,9 +100,10 @@ func (c *ApiService) PageServiceUserConversation(ChatServiceSid string, UserSid data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -244,15 +247,16 @@ func (c *ApiService) UpdateServiceUserConversation(ChatServiceSid string, UserSi data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.NotificationLevel != nil { - data.Set("NotificationLevel", *params.NotificationLevel) -} -if params != nil && params.LastReadTimestamp != nil { - data.Set("LastReadTimestamp", fmt.Sprint((*params.LastReadTimestamp).Format(time.RFC3339))) -} -if params != nil && params.LastReadMessageIndex != nil { - data.Set("LastReadMessageIndex", fmt.Sprint(*params.LastReadMessageIndex)) -} + + if params != nil && params.NotificationLevel != nil { + data.Set("NotificationLevel", *params.NotificationLevel) + } + if params != nil && params.LastReadTimestamp != nil { + data.Set("LastReadTimestamp", fmt.Sprint((*params.LastReadTimestamp).Format(time.RFC3339))) + } + if params != nil && params.LastReadMessageIndex != nil { + data.Set("LastReadMessageIndex", fmt.Sprint(*params.LastReadMessageIndex)) + } diff --git a/rest/conversations/v1/users.go b/rest/conversations/v1/users.go index a6ba1dc75..240b762e8 100644 --- a/rest/conversations/v1/users.go +++ b/rest/conversations/v1/users.go @@ -64,18 +64,19 @@ func (c *ApiService) CreateUser(params *CreateUserParams) (*ConversationsV1User, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Identity != nil { - data.Set("Identity", *params.Identity) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.RoleSid != nil { - data.Set("RoleSid", *params.RoleSid) -} + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } if params != nil && params.XTwilioWebhookEnabled != nil { @@ -117,6 +118,7 @@ func (c *ApiService) DeleteUser(Sid string, params *DeleteUserParams) (error) { headers := make(map[string]interface{}) + if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -141,6 +143,7 @@ func (c *ApiService) FetchUser(Sid string, ) (*ConversationsV1User, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -180,9 +183,10 @@ func (c *ApiService) PageUser(params *ListUserParams, pageToken, pageNumber stri data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -330,15 +334,16 @@ func (c *ApiService) UpdateUser(Sid string, params *UpdateUserParams) (*Conversa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.RoleSid != nil { - data.Set("RoleSid", *params.RoleSid) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } if params != nil && params.XTwilioWebhookEnabled != nil { diff --git a/rest/conversations/v1/users_conversations.go b/rest/conversations/v1/users_conversations.go index 97cbea596..c93c21539 100644 --- a/rest/conversations/v1/users_conversations.go +++ b/rest/conversations/v1/users_conversations.go @@ -34,6 +34,7 @@ func (c *ApiService) DeleteUserConversation(UserSid string, ConversationSid stri + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -55,6 +56,7 @@ func (c *ApiService) FetchUserConversation(UserSid string, ConversationSid strin + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -95,9 +97,10 @@ func (c *ApiService) PageUserConversation(UserSid string, params *ListUserConver data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -240,15 +243,16 @@ func (c *ApiService) UpdateUserConversation(UserSid string, ConversationSid stri data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.NotificationLevel != nil { - data.Set("NotificationLevel", *params.NotificationLevel) -} -if params != nil && params.LastReadTimestamp != nil { - data.Set("LastReadTimestamp", fmt.Sprint((*params.LastReadTimestamp).Format(time.RFC3339))) -} -if params != nil && params.LastReadMessageIndex != nil { - data.Set("LastReadMessageIndex", fmt.Sprint(*params.LastReadMessageIndex)) -} + + if params != nil && params.NotificationLevel != nil { + data.Set("NotificationLevel", *params.NotificationLevel) + } + if params != nil && params.LastReadTimestamp != nil { + data.Set("LastReadTimestamp", fmt.Sprint((*params.LastReadTimestamp).Format(time.RFC3339))) + } + if params != nil && params.LastReadMessageIndex != nil { + data.Set("LastReadMessageIndex", fmt.Sprint(*params.LastReadMessageIndex)) + } diff --git a/rest/events/v1/schemas.go b/rest/events/v1/schemas.go index 1f98ae5b8..00dc726b7 100644 --- a/rest/events/v1/schemas.go +++ b/rest/events/v1/schemas.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchSchema(Id string, ) (*EventsV1Schema, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/events/v1/schemas_versions.go b/rest/events/v1/schemas_versions.go index c2bdc5cf6..5f775361e 100644 --- a/rest/events/v1/schemas_versions.go +++ b/rest/events/v1/schemas_versions.go @@ -34,6 +34,7 @@ func (c *ApiService) FetchSchemaVersion(Id string, SchemaVersion int, ) (*Events + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -74,9 +75,10 @@ func (c *ApiService) PageSchemaVersion(Id string, params *ListSchemaVersionParam data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/events/v1/sinks.go b/rest/events/v1/sinks.go index fab5264f5..19b789dea 100644 --- a/rest/events/v1/sinks.go +++ b/rest/events/v1/sinks.go @@ -52,21 +52,22 @@ func (c *ApiService) CreateSink(params *CreateSinkParams) (*EventsV1Sink, error) data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Description != nil { - data.Set("Description", *params.Description) -} -if params != nil && params.SinkConfiguration != nil { - v, err := json.Marshal(params.SinkConfiguration) - if err != nil { - return nil, err + if params != nil && params.Description != nil { + data.Set("Description", *params.Description) } + if params != nil && params.SinkConfiguration != nil { + v, err := json.Marshal(params.SinkConfiguration) - data.Set("SinkConfiguration", string(v)) -} -if params != nil && params.SinkType != nil { - data.Set("SinkType", *params.SinkType) -} + if err != nil { + return nil, err + } + + data.Set("SinkConfiguration", string(v)) + } + if params != nil && params.SinkType != nil { + data.Set("SinkType", *params.SinkType) + } @@ -95,6 +96,7 @@ func (c *ApiService) DeleteSink(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -115,6 +117,7 @@ func (c *ApiService) FetchSink(Sid string, ) (*EventsV1Sink, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -166,15 +169,16 @@ func (c *ApiService) PageSink(params *ListSinkParams, pageToken, pageNumber stri data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.InUse != nil { - data.Set("InUse", fmt.Sprint(*params.InUse)) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.InUse != nil { + data.Set("InUse", fmt.Sprint(*params.InUse)) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -304,9 +308,10 @@ func (c *ApiService) UpdateSink(Sid string, params *UpdateSinkParams) (*EventsV1 data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Description != nil { - data.Set("Description", *params.Description) -} + + if params != nil && params.Description != nil { + data.Set("Description", *params.Description) + } diff --git a/rest/events/v1/sinks_test_.go b/rest/events/v1/sinks_test_.go index 443c0f6ff..03a6b4d32 100644 --- a/rest/events/v1/sinks_test_.go +++ b/rest/events/v1/sinks_test_.go @@ -33,6 +33,7 @@ func (c *ApiService) CreateSinkTest(Sid string, ) (*EventsV1SinkTest, error) { + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/events/v1/sinks_validate.go b/rest/events/v1/sinks_validate.go index 6eb5a1777..bc5867449 100644 --- a/rest/events/v1/sinks_validate.go +++ b/rest/events/v1/sinks_validate.go @@ -41,9 +41,10 @@ func (c *ApiService) CreateSinkValidate(Sid string, params *CreateSinkValidatePa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.TestId != nil { - data.Set("TestId", *params.TestId) -} + + if params != nil && params.TestId != nil { + data.Set("TestId", *params.TestId) + } diff --git a/rest/events/v1/subscriptions.go b/rest/events/v1/subscriptions.go index 00b95d539..07ff57af4 100644 --- a/rest/events/v1/subscriptions.go +++ b/rest/events/v1/subscriptions.go @@ -52,23 +52,24 @@ func (c *ApiService) CreateSubscription(params *CreateSubscriptionParams) (*Even 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) -} -if params != nil && params.Types != nil { - for _, item := range *params.Types { - v, err := json.Marshal(item) - if err != nil { - return nil, err - } + if params != nil && params.Description != nil { + data.Set("Description", *params.Description) + } + if params != nil && params.SinkSid != nil { + data.Set("SinkSid", *params.SinkSid) + } + if params != nil && params.Types != nil { + for _, item := range *params.Types { + v, err := json.Marshal(item) + + if err != nil { + return nil, err + } - data.Add("Types", string(v)) + data.Add("Types", string(v)) + } } -} @@ -97,6 +98,7 @@ func (c *ApiService) DeleteSubscription(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -117,6 +119,7 @@ func (c *ApiService) FetchSubscription(Sid string, ) (*EventsV1Subscription, err + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -162,12 +165,13 @@ func (c *ApiService) PageSubscription(params *ListSubscriptionParams, pageToken, 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)) -} + + if params != nil && params.SinkSid != nil { + data.Set("SinkSid", *params.SinkSid) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -303,12 +307,13 @@ func (c *ApiService) UpdateSubscription(Sid string, params *UpdateSubscriptionPa 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) -} + + if params != nil && params.Description != nil { + data.Set("Description", *params.Description) + } + if params != nil && params.SinkSid != nil { + data.Set("SinkSid", *params.SinkSid) + } diff --git a/rest/events/v1/subscriptions_subscribed_events.go b/rest/events/v1/subscriptions_subscribed_events.go index ab50f1905..f32f20df3 100644 --- a/rest/events/v1/subscriptions_subscribed_events.go +++ b/rest/events/v1/subscriptions_subscribed_events.go @@ -47,12 +47,13 @@ func (c *ApiService) CreateSubscribedEvent(SubscriptionSid string, params *Creat data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.SchemaVersion != nil { - data.Set("SchemaVersion", fmt.Sprint(*params.SchemaVersion)) -} + + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } + if params != nil && params.SchemaVersion != nil { + data.Set("SchemaVersion", fmt.Sprint(*params.SchemaVersion)) + } @@ -82,6 +83,7 @@ func (c *ApiService) DeleteSubscribedEvent(SubscriptionSid string, Type string, + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -103,6 +105,7 @@ func (c *ApiService) FetchSubscribedEvent(SubscriptionSid string, Type string, ) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -143,9 +146,10 @@ func (c *ApiService) PageSubscribedEvent(SubscriptionSid string, params *ListSub data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -276,9 +280,10 @@ func (c *ApiService) UpdateSubscribedEvent(SubscriptionSid string, Type string, 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.SchemaVersion != nil { + data.Set("SchemaVersion", fmt.Sprint(*params.SchemaVersion)) + } diff --git a/rest/events/v1/types.go b/rest/events/v1/types.go index 7bcb2417f..7705c5227 100644 --- a/rest/events/v1/types.go +++ b/rest/events/v1/types.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchEventType(Type string, ) (*EventsV1EventType, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -78,12 +79,13 @@ func (c *ApiService) PageEventType(params *ListEventTypeParams, pageToken, pageN 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)) -} + + if params != nil && params.SchemaId != nil { + data.Set("SchemaId", *params.SchemaId) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/flex/v1/channels.go b/rest/flex/v1/channels.go index cc51fa101..95b566c86 100644 --- a/rest/flex/v1/channels.go +++ b/rest/flex/v1/channels.go @@ -94,36 +94,37 @@ func (c *ApiService) CreateChannel(params *CreateChannelParams) (*FlexV1Channel, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FlexFlowSid != nil { - data.Set("FlexFlowSid", *params.FlexFlowSid) -} -if params != nil && params.Identity != nil { - data.Set("Identity", *params.Identity) -} -if params != nil && params.ChatUserFriendlyName != nil { - data.Set("ChatUserFriendlyName", *params.ChatUserFriendlyName) -} -if params != nil && params.ChatFriendlyName != nil { - data.Set("ChatFriendlyName", *params.ChatFriendlyName) -} -if params != nil && params.Target != nil { - data.Set("Target", *params.Target) -} -if params != nil && params.ChatUniqueName != nil { - data.Set("ChatUniqueName", *params.ChatUniqueName) -} -if params != nil && params.PreEngagementData != nil { - data.Set("PreEngagementData", *params.PreEngagementData) -} -if params != nil && params.TaskSid != nil { - data.Set("TaskSid", *params.TaskSid) -} -if params != nil && params.TaskAttributes != nil { - data.Set("TaskAttributes", *params.TaskAttributes) -} -if params != nil && params.LongLived != nil { - data.Set("LongLived", fmt.Sprint(*params.LongLived)) -} + + if params != nil && params.FlexFlowSid != nil { + data.Set("FlexFlowSid", *params.FlexFlowSid) + } + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.ChatUserFriendlyName != nil { + data.Set("ChatUserFriendlyName", *params.ChatUserFriendlyName) + } + if params != nil && params.ChatFriendlyName != nil { + data.Set("ChatFriendlyName", *params.ChatFriendlyName) + } + if params != nil && params.Target != nil { + data.Set("Target", *params.Target) + } + if params != nil && params.ChatUniqueName != nil { + data.Set("ChatUniqueName", *params.ChatUniqueName) + } + if params != nil && params.PreEngagementData != nil { + data.Set("PreEngagementData", *params.PreEngagementData) + } + if params != nil && params.TaskSid != nil { + data.Set("TaskSid", *params.TaskSid) + } + if params != nil && params.TaskAttributes != nil { + data.Set("TaskAttributes", *params.TaskAttributes) + } + if params != nil && params.LongLived != nil { + data.Set("LongLived", fmt.Sprint(*params.LongLived)) + } @@ -152,6 +153,7 @@ func (c *ApiService) DeleteChannel(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -172,6 +174,7 @@ func (c *ApiService) FetchChannel(Sid string, ) (*FlexV1Channel, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -211,9 +214,10 @@ func (c *ApiService) PageChannel(params *ListChannelParams, pageToken, pageNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/flex/v1/configuration.go b/rest/flex/v1/configuration.go index 085214dbb..e30688156 100644 --- a/rest/flex/v1/configuration.go +++ b/rest/flex/v1/configuration.go @@ -40,9 +40,10 @@ func (c *ApiService) FetchConfiguration(params *FetchConfigurationParams) (*Flex data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UiVersion != nil { - data.Set("UiVersion", *params.UiVersion) -} + + if params != nil && params.UiVersion != nil { + data.Set("UiVersion", *params.UiVersion) + } @@ -70,6 +71,7 @@ func (c *ApiService) UpdateConfiguration() (*FlexV1Configuration, error) { + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/flex/v1/flex_flows.go b/rest/flex/v1/flex_flows.go index a5ea09b1d..180363e3d 100644 --- a/rest/flex/v1/flex_flows.go +++ b/rest/flex/v1/flex_flows.go @@ -136,57 +136,58 @@ func (c *ApiService) CreateFlexFlow(params *CreateFlexFlowParams) (*FlexV1FlexFl data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.ChatServiceSid != nil { - data.Set("ChatServiceSid", *params.ChatServiceSid) -} -if params != nil && params.ChannelType != nil { - data.Set("ChannelType", *params.ChannelType) -} -if params != nil && params.ContactIdentity != nil { - data.Set("ContactIdentity", *params.ContactIdentity) -} -if params != nil && params.Enabled != nil { - data.Set("Enabled", fmt.Sprint(*params.Enabled)) -} -if params != nil && params.IntegrationType != nil { - data.Set("IntegrationType", *params.IntegrationType) -} -if params != nil && params.IntegrationFlowSid != nil { - data.Set("Integration.FlowSid", *params.IntegrationFlowSid) -} -if params != nil && params.IntegrationUrl != nil { - data.Set("Integration.Url", *params.IntegrationUrl) -} -if params != nil && params.IntegrationWorkspaceSid != nil { - data.Set("Integration.WorkspaceSid", *params.IntegrationWorkspaceSid) -} -if params != nil && params.IntegrationWorkflowSid != nil { - data.Set("Integration.WorkflowSid", *params.IntegrationWorkflowSid) -} -if params != nil && params.IntegrationChannel != nil { - data.Set("Integration.Channel", *params.IntegrationChannel) -} -if params != nil && params.IntegrationTimeout != nil { - data.Set("Integration.Timeout", fmt.Sprint(*params.IntegrationTimeout)) -} -if params != nil && params.IntegrationPriority != nil { - data.Set("Integration.Priority", fmt.Sprint(*params.IntegrationPriority)) -} -if params != nil && params.IntegrationCreationOnMessage != nil { - data.Set("Integration.CreationOnMessage", fmt.Sprint(*params.IntegrationCreationOnMessage)) -} -if params != nil && params.LongLived != nil { - data.Set("LongLived", fmt.Sprint(*params.LongLived)) -} -if params != nil && params.JanitorEnabled != nil { - data.Set("JanitorEnabled", fmt.Sprint(*params.JanitorEnabled)) -} -if params != nil && params.IntegrationRetryCount != nil { - data.Set("Integration.RetryCount", fmt.Sprint(*params.IntegrationRetryCount)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.ChatServiceSid != nil { + data.Set("ChatServiceSid", *params.ChatServiceSid) + } + if params != nil && params.ChannelType != nil { + data.Set("ChannelType", *params.ChannelType) + } + if params != nil && params.ContactIdentity != nil { + data.Set("ContactIdentity", *params.ContactIdentity) + } + if params != nil && params.Enabled != nil { + data.Set("Enabled", fmt.Sprint(*params.Enabled)) + } + if params != nil && params.IntegrationType != nil { + data.Set("IntegrationType", *params.IntegrationType) + } + if params != nil && params.IntegrationFlowSid != nil { + data.Set("Integration.FlowSid", *params.IntegrationFlowSid) + } + if params != nil && params.IntegrationUrl != nil { + data.Set("Integration.Url", *params.IntegrationUrl) + } + if params != nil && params.IntegrationWorkspaceSid != nil { + data.Set("Integration.WorkspaceSid", *params.IntegrationWorkspaceSid) + } + if params != nil && params.IntegrationWorkflowSid != nil { + data.Set("Integration.WorkflowSid", *params.IntegrationWorkflowSid) + } + if params != nil && params.IntegrationChannel != nil { + data.Set("Integration.Channel", *params.IntegrationChannel) + } + if params != nil && params.IntegrationTimeout != nil { + data.Set("Integration.Timeout", fmt.Sprint(*params.IntegrationTimeout)) + } + if params != nil && params.IntegrationPriority != nil { + data.Set("Integration.Priority", fmt.Sprint(*params.IntegrationPriority)) + } + if params != nil && params.IntegrationCreationOnMessage != nil { + data.Set("Integration.CreationOnMessage", fmt.Sprint(*params.IntegrationCreationOnMessage)) + } + if params != nil && params.LongLived != nil { + data.Set("LongLived", fmt.Sprint(*params.LongLived)) + } + if params != nil && params.JanitorEnabled != nil { + data.Set("JanitorEnabled", fmt.Sprint(*params.JanitorEnabled)) + } + if params != nil && params.IntegrationRetryCount != nil { + data.Set("Integration.RetryCount", fmt.Sprint(*params.IntegrationRetryCount)) + } @@ -215,6 +216,7 @@ func (c *ApiService) DeleteFlexFlow(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -235,6 +237,7 @@ func (c *ApiService) FetchFlexFlow(Sid string, ) (*FlexV1FlexFlow, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -280,12 +283,13 @@ func (c *ApiService) PageFlexFlow(params *ListFlexFlowParams, pageToken, pageNum 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)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -511,57 +515,58 @@ func (c *ApiService) UpdateFlexFlow(Sid string, params *UpdateFlexFlowParams) (* data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.ChatServiceSid != nil { - data.Set("ChatServiceSid", *params.ChatServiceSid) -} -if params != nil && params.ChannelType != nil { - data.Set("ChannelType", *params.ChannelType) -} -if params != nil && params.ContactIdentity != nil { - data.Set("ContactIdentity", *params.ContactIdentity) -} -if params != nil && params.Enabled != nil { - data.Set("Enabled", fmt.Sprint(*params.Enabled)) -} -if params != nil && params.IntegrationType != nil { - data.Set("IntegrationType", *params.IntegrationType) -} -if params != nil && params.IntegrationFlowSid != nil { - data.Set("Integration.FlowSid", *params.IntegrationFlowSid) -} -if params != nil && params.IntegrationUrl != nil { - data.Set("Integration.Url", *params.IntegrationUrl) -} -if params != nil && params.IntegrationWorkspaceSid != nil { - data.Set("Integration.WorkspaceSid", *params.IntegrationWorkspaceSid) -} -if params != nil && params.IntegrationWorkflowSid != nil { - data.Set("Integration.WorkflowSid", *params.IntegrationWorkflowSid) -} -if params != nil && params.IntegrationChannel != nil { - data.Set("Integration.Channel", *params.IntegrationChannel) -} -if params != nil && params.IntegrationTimeout != nil { - data.Set("Integration.Timeout", fmt.Sprint(*params.IntegrationTimeout)) -} -if params != nil && params.IntegrationPriority != nil { - data.Set("Integration.Priority", fmt.Sprint(*params.IntegrationPriority)) -} -if params != nil && params.IntegrationCreationOnMessage != nil { - data.Set("Integration.CreationOnMessage", fmt.Sprint(*params.IntegrationCreationOnMessage)) -} -if params != nil && params.LongLived != nil { - data.Set("LongLived", fmt.Sprint(*params.LongLived)) -} -if params != nil && params.JanitorEnabled != nil { - data.Set("JanitorEnabled", fmt.Sprint(*params.JanitorEnabled)) -} -if params != nil && params.IntegrationRetryCount != nil { - data.Set("Integration.RetryCount", fmt.Sprint(*params.IntegrationRetryCount)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.ChatServiceSid != nil { + data.Set("ChatServiceSid", *params.ChatServiceSid) + } + if params != nil && params.ChannelType != nil { + data.Set("ChannelType", *params.ChannelType) + } + if params != nil && params.ContactIdentity != nil { + data.Set("ContactIdentity", *params.ContactIdentity) + } + if params != nil && params.Enabled != nil { + data.Set("Enabled", fmt.Sprint(*params.Enabled)) + } + if params != nil && params.IntegrationType != nil { + data.Set("IntegrationType", *params.IntegrationType) + } + if params != nil && params.IntegrationFlowSid != nil { + data.Set("Integration.FlowSid", *params.IntegrationFlowSid) + } + if params != nil && params.IntegrationUrl != nil { + data.Set("Integration.Url", *params.IntegrationUrl) + } + if params != nil && params.IntegrationWorkspaceSid != nil { + data.Set("Integration.WorkspaceSid", *params.IntegrationWorkspaceSid) + } + if params != nil && params.IntegrationWorkflowSid != nil { + data.Set("Integration.WorkflowSid", *params.IntegrationWorkflowSid) + } + if params != nil && params.IntegrationChannel != nil { + data.Set("Integration.Channel", *params.IntegrationChannel) + } + if params != nil && params.IntegrationTimeout != nil { + data.Set("Integration.Timeout", fmt.Sprint(*params.IntegrationTimeout)) + } + if params != nil && params.IntegrationPriority != nil { + data.Set("Integration.Priority", fmt.Sprint(*params.IntegrationPriority)) + } + if params != nil && params.IntegrationCreationOnMessage != nil { + data.Set("Integration.CreationOnMessage", fmt.Sprint(*params.IntegrationCreationOnMessage)) + } + if params != nil && params.LongLived != nil { + data.Set("LongLived", fmt.Sprint(*params.LongLived)) + } + if params != nil && params.JanitorEnabled != nil { + data.Set("JanitorEnabled", fmt.Sprint(*params.JanitorEnabled)) + } + if params != nil && params.IntegrationRetryCount != nil { + data.Set("Integration.RetryCount", fmt.Sprint(*params.IntegrationRetryCount)) + } diff --git a/rest/flex/v1/insights_conversations.go b/rest/flex/v1/insights_conversations.go index 29165a037..7f2584ae5 100644 --- a/rest/flex/v1/insights_conversations.go +++ b/rest/flex/v1/insights_conversations.go @@ -59,12 +59,13 @@ func (c *ApiService) PageInsightsConversations(params *ListInsightsConversations data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.SegmentId != nil { - data.Set("SegmentId", *params.SegmentId) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.SegmentId != nil { + data.Set("SegmentId", *params.SegmentId) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/flex/v1/insights_quality_management_assessments.go b/rest/flex/v1/insights_quality_management_assessments.go index 2a9fcff7c..c24627616 100644 --- a/rest/flex/v1/insights_quality_management_assessments.go +++ b/rest/flex/v1/insights_quality_management_assessments.go @@ -100,36 +100,37 @@ func (c *ApiService) CreateInsightsAssessments(params *CreateInsightsAssessments data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.CategorySid != nil { - data.Set("CategorySid", *params.CategorySid) -} -if params != nil && params.CategoryName != nil { - data.Set("CategoryName", *params.CategoryName) -} -if params != nil && params.SegmentId != nil { - data.Set("SegmentId", *params.SegmentId) -} -if params != nil && params.AgentId != nil { - data.Set("AgentId", *params.AgentId) -} -if params != nil && params.Offset != nil { - data.Set("Offset", fmt.Sprint(*params.Offset)) -} -if params != nil && params.MetricId != nil { - data.Set("MetricId", *params.MetricId) -} -if params != nil && params.MetricName != nil { - data.Set("MetricName", *params.MetricName) -} -if params != nil && params.AnswerText != nil { - data.Set("AnswerText", *params.AnswerText) -} -if params != nil && params.AnswerId != nil { - data.Set("AnswerId", *params.AnswerId) -} -if params != nil && params.QuestionnaireSid != nil { - data.Set("QuestionnaireSid", *params.QuestionnaireSid) -} + + if params != nil && params.CategorySid != nil { + data.Set("CategorySid", *params.CategorySid) + } + if params != nil && params.CategoryName != nil { + data.Set("CategoryName", *params.CategoryName) + } + if params != nil && params.SegmentId != nil { + data.Set("SegmentId", *params.SegmentId) + } + if params != nil && params.AgentId != nil { + data.Set("AgentId", *params.AgentId) + } + if params != nil && params.Offset != nil { + data.Set("Offset", fmt.Sprint(*params.Offset)) + } + if params != nil && params.MetricId != nil { + data.Set("MetricId", *params.MetricId) + } + if params != nil && params.MetricName != nil { + data.Set("MetricName", *params.MetricName) + } + if params != nil && params.AnswerText != nil { + data.Set("AnswerText", *params.AnswerText) + } + if params != nil && params.AnswerId != nil { + data.Set("AnswerId", *params.AnswerId) + } + if params != nil && params.QuestionnaireSid != nil { + data.Set("QuestionnaireSid", *params.QuestionnaireSid) + } if params != nil && params.Authorization != nil { @@ -187,12 +188,13 @@ func (c *ApiService) PageInsightsAssessments(params *ListInsightsAssessmentsPara data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.SegmentId != nil { - data.Set("SegmentId", *params.SegmentId) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.SegmentId != nil { + data.Set("SegmentId", *params.SegmentId) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -340,15 +342,16 @@ func (c *ApiService) UpdateInsightsAssessments(AssessmentSid string, params *Upd data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Offset != nil { - data.Set("Offset", fmt.Sprint(*params.Offset)) -} -if params != nil && params.AnswerText != nil { - data.Set("AnswerText", *params.AnswerText) -} -if params != nil && params.AnswerId != nil { - data.Set("AnswerId", *params.AnswerId) -} + + if params != nil && params.Offset != nil { + data.Set("Offset", fmt.Sprint(*params.Offset)) + } + if params != nil && params.AnswerText != nil { + data.Set("AnswerText", *params.AnswerText) + } + if params != nil && params.AnswerId != nil { + data.Set("AnswerId", *params.AnswerId) + } if params != nil && params.Authorization != nil { diff --git a/rest/flex/v1/insights_quality_management_assessments_comments.go b/rest/flex/v1/insights_quality_management_assessments_comments.go index 7ba50f6c4..5f95cfc1b 100644 --- a/rest/flex/v1/insights_quality_management_assessments_comments.go +++ b/rest/flex/v1/insights_quality_management_assessments_comments.go @@ -76,24 +76,25 @@ func (c *ApiService) CreateInsightsAssessmentsComment(params *CreateInsightsAsse data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.CategoryId != nil { - data.Set("CategoryId", *params.CategoryId) -} -if params != nil && params.CategoryName != nil { - data.Set("CategoryName", *params.CategoryName) -} -if params != nil && params.Comment != nil { - data.Set("Comment", *params.Comment) -} -if params != nil && params.SegmentId != nil { - data.Set("SegmentId", *params.SegmentId) -} -if params != nil && params.AgentId != nil { - data.Set("AgentId", *params.AgentId) -} -if params != nil && params.Offset != nil { - data.Set("Offset", fmt.Sprint(*params.Offset)) -} + + if params != nil && params.CategoryId != nil { + data.Set("CategoryId", *params.CategoryId) + } + if params != nil && params.CategoryName != nil { + data.Set("CategoryName", *params.CategoryName) + } + if params != nil && params.Comment != nil { + data.Set("Comment", *params.Comment) + } + if params != nil && params.SegmentId != nil { + data.Set("SegmentId", *params.SegmentId) + } + if params != nil && params.AgentId != nil { + data.Set("AgentId", *params.AgentId) + } + if params != nil && params.Offset != nil { + data.Set("Offset", fmt.Sprint(*params.Offset)) + } if params != nil && params.Authorization != nil { @@ -157,15 +158,16 @@ func (c *ApiService) PageInsightsAssessmentsComment(params *ListInsightsAssessme data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.SegmentId != nil { - data.Set("SegmentId", *params.SegmentId) -} -if params != nil && params.AgentId != nil { - data.Set("AgentId", *params.AgentId) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.SegmentId != nil { + data.Set("SegmentId", *params.SegmentId) + } + if params != nil && params.AgentId != nil { + data.Set("AgentId", *params.AgentId) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/flex/v1/insights_quality_management_categories.go b/rest/flex/v1/insights_quality_management_categories.go index 0e7019f1b..503acc4a3 100644 --- a/rest/flex/v1/insights_quality_management_categories.go +++ b/rest/flex/v1/insights_quality_management_categories.go @@ -46,9 +46,10 @@ func (c *ApiService) CreateInsightsQuestionnairesCategory(params *CreateInsights data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Name != nil { - data.Set("Name", *params.Name) -} + + if params != nil && params.Name != nil { + data.Set("Name", *params.Name) + } if params != nil && params.Authorization != nil { @@ -90,6 +91,7 @@ func (c *ApiService) DeleteInsightsQuestionnairesCategory(CategorySid string, pa headers := make(map[string]interface{}) + if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } @@ -134,9 +136,10 @@ func (c *ApiService) PageInsightsQuestionnairesCategory(params *ListInsightsQues data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -272,9 +275,10 @@ func (c *ApiService) UpdateInsightsQuestionnairesCategory(CategorySid string, pa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Name != nil { - data.Set("Name", *params.Name) -} + + if params != nil && params.Name != nil { + data.Set("Name", *params.Name) + } if params != nil && params.Authorization != nil { diff --git a/rest/flex/v1/insights_quality_management_questionnaires.go b/rest/flex/v1/insights_quality_management_questionnaires.go index 5ce861c2f..6821cb211 100644 --- a/rest/flex/v1/insights_quality_management_questionnaires.go +++ b/rest/flex/v1/insights_quality_management_questionnaires.go @@ -64,20 +64,21 @@ func (c *ApiService) CreateInsightsQuestionnaires(params *CreateInsightsQuestion data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Name != nil { - data.Set("Name", *params.Name) -} -if params != nil && params.Description != nil { - data.Set("Description", *params.Description) -} -if params != nil && params.Active != nil { - data.Set("Active", fmt.Sprint(*params.Active)) -} -if params != nil && params.QuestionSids != nil { - for _, item := range *params.QuestionSids { - data.Add("QuestionSids", item) + + if params != nil && params.Name != nil { + data.Set("Name", *params.Name) + } + if params != nil && params.Description != nil { + data.Set("Description", *params.Description) + } + if params != nil && params.Active != nil { + data.Set("Active", fmt.Sprint(*params.Active)) + } + if params != nil && params.QuestionSids != nil { + for _, item := range *params.QuestionSids { + data.Add("QuestionSids", item) + } } -} if params != nil && params.Authorization != nil { @@ -119,6 +120,7 @@ func (c *ApiService) DeleteInsightsQuestionnaires(QuestionnaireSid string, param headers := make(map[string]interface{}) + if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } @@ -153,6 +155,7 @@ func (c *ApiService) FetchInsightsQuestionnaires(QuestionnaireSid string, params headers := make(map[string]interface{}) + if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } @@ -208,12 +211,13 @@ func (c *ApiService) PageInsightsQuestionnaires(params *ListInsightsQuestionnair data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.IncludeInactive != nil { - data.Set("IncludeInactive", fmt.Sprint(*params.IncludeInactive)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.IncludeInactive != nil { + data.Set("IncludeInactive", fmt.Sprint(*params.IncludeInactive)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -367,20 +371,21 @@ func (c *ApiService) UpdateInsightsQuestionnaires(QuestionnaireSid string, param data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Active != nil { - data.Set("Active", fmt.Sprint(*params.Active)) -} -if params != nil && params.Name != nil { - data.Set("Name", *params.Name) -} -if params != nil && params.Description != nil { - data.Set("Description", *params.Description) -} -if params != nil && params.QuestionSids != nil { - for _, item := range *params.QuestionSids { - data.Add("QuestionSids", item) + + if params != nil && params.Active != nil { + data.Set("Active", fmt.Sprint(*params.Active)) + } + if params != nil && params.Name != nil { + data.Set("Name", *params.Name) + } + if params != nil && params.Description != nil { + data.Set("Description", *params.Description) + } + if params != nil && params.QuestionSids != nil { + for _, item := range *params.QuestionSids { + data.Add("QuestionSids", item) + } } -} if params != nil && params.Authorization != nil { diff --git a/rest/flex/v1/insights_quality_management_questions.go b/rest/flex/v1/insights_quality_management_questions.go index 6e8c90222..ff9f68721 100644 --- a/rest/flex/v1/insights_quality_management_questions.go +++ b/rest/flex/v1/insights_quality_management_questions.go @@ -70,21 +70,22 @@ func (c *ApiService) CreateInsightsQuestionnairesQuestion(params *CreateInsights data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.CategorySid != nil { - data.Set("CategorySid", *params.CategorySid) -} -if params != nil && params.Question != nil { - data.Set("Question", *params.Question) -} -if params != nil && params.AnswerSetId != nil { - data.Set("AnswerSetId", *params.AnswerSetId) -} -if params != nil && params.AllowNa != nil { - data.Set("AllowNa", fmt.Sprint(*params.AllowNa)) -} -if params != nil && params.Description != nil { - data.Set("Description", *params.Description) -} + + if params != nil && params.CategorySid != nil { + data.Set("CategorySid", *params.CategorySid) + } + if params != nil && params.Question != nil { + data.Set("Question", *params.Question) + } + if params != nil && params.AnswerSetId != nil { + data.Set("AnswerSetId", *params.AnswerSetId) + } + if params != nil && params.AllowNa != nil { + data.Set("AllowNa", fmt.Sprint(*params.AllowNa)) + } + if params != nil && params.Description != nil { + data.Set("Description", *params.Description) + } if params != nil && params.Authorization != nil { @@ -126,6 +127,7 @@ func (c *ApiService) DeleteInsightsQuestionnairesQuestion(QuestionSid string, pa headers := make(map[string]interface{}) + if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } @@ -176,14 +178,15 @@ func (c *ApiService) PageInsightsQuestionnairesQuestion(params *ListInsightsQues data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.CategorySid != nil { - for _, item := range *params.CategorySid { - data.Add("CategorySid", item) + + if params != nil && params.CategorySid != nil { + for _, item := range *params.CategorySid { + data.Add("CategorySid", item) + } + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) } -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} if pageToken != "" { data.Set("PageToken", pageToken) @@ -343,21 +346,22 @@ func (c *ApiService) UpdateInsightsQuestionnairesQuestion(QuestionSid string, pa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.AllowNa != nil { - data.Set("AllowNa", fmt.Sprint(*params.AllowNa)) -} -if params != nil && params.CategorySid != nil { - data.Set("CategorySid", *params.CategorySid) -} -if params != nil && params.Question != nil { - data.Set("Question", *params.Question) -} -if params != nil && params.Description != nil { - data.Set("Description", *params.Description) -} -if params != nil && params.AnswerSetId != nil { - data.Set("AnswerSetId", *params.AnswerSetId) -} + + if params != nil && params.AllowNa != nil { + data.Set("AllowNa", fmt.Sprint(*params.AllowNa)) + } + if params != nil && params.CategorySid != nil { + data.Set("CategorySid", *params.CategorySid) + } + if params != nil && params.Question != nil { + data.Set("Question", *params.Question) + } + if params != nil && params.Description != nil { + data.Set("Description", *params.Description) + } + if params != nil && params.AnswerSetId != nil { + data.Set("AnswerSetId", *params.AnswerSetId) + } if params != nil && params.Authorization != nil { diff --git a/rest/flex/v1/insights_quality_management_settings_answer_sets.go b/rest/flex/v1/insights_quality_management_settings_answer_sets.go index 38d924bdd..eda0d4585 100644 --- a/rest/flex/v1/insights_quality_management_settings_answer_sets.go +++ b/rest/flex/v1/insights_quality_management_settings_answer_sets.go @@ -42,6 +42,7 @@ func (c *ApiService) FetchInsightsSettingsAnswersets(params *FetchInsightsSettin headers := make(map[string]interface{}) + if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } diff --git a/rest/flex/v1/insights_quality_management_settings_comment_tags.go b/rest/flex/v1/insights_quality_management_settings_comment_tags.go index 467416a54..c7a68d208 100644 --- a/rest/flex/v1/insights_quality_management_settings_comment_tags.go +++ b/rest/flex/v1/insights_quality_management_settings_comment_tags.go @@ -42,6 +42,7 @@ func (c *ApiService) FetchInsightsSettingsComment(params *FetchInsightsSettingsC headers := make(map[string]interface{}) + if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } diff --git a/rest/flex/v1/insights_segments.go b/rest/flex/v1/insights_segments.go index 9aadbae17..736fa10dd 100644 --- a/rest/flex/v1/insights_segments.go +++ b/rest/flex/v1/insights_segments.go @@ -65,17 +65,18 @@ func (c *ApiService) PageInsightsSegments(params *ListInsightsSegmentsParams, pa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.SegmentId != nil { - data.Set("SegmentId", *params.SegmentId) -} -if params != nil && params.ReservationId != nil { - for _, item := range *params.ReservationId { - data.Add("ReservationId", item) + + if params != nil && params.SegmentId != nil { + data.Set("SegmentId", *params.SegmentId) + } + if params != nil && params.ReservationId != nil { + for _, item := range *params.ReservationId { + data.Add("ReservationId", item) + } + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) } -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/flex/v1/insights_session.go b/rest/flex/v1/insights_session.go index fd12dc604..37ef59a70 100644 --- a/rest/flex/v1/insights_session.go +++ b/rest/flex/v1/insights_session.go @@ -42,6 +42,7 @@ func (c *ApiService) CreateInsightsSession(params *CreateInsightsSessionParams) headers := make(map[string]interface{}) + if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } diff --git a/rest/flex/v1/insights_user_roles.go b/rest/flex/v1/insights_user_roles.go index d94ae30d6..9a1dc064c 100644 --- a/rest/flex/v1/insights_user_roles.go +++ b/rest/flex/v1/insights_user_roles.go @@ -42,6 +42,7 @@ func (c *ApiService) FetchInsightsUserRoles(params *FetchInsightsUserRolesParams headers := make(map[string]interface{}) + if params != nil && params.Authorization != nil { headers["Authorization"] = *params.Authorization } diff --git a/rest/flex/v1/interactions.go b/rest/flex/v1/interactions.go index 819c4448d..b1f1fa89a 100644 --- a/rest/flex/v1/interactions.go +++ b/rest/flex/v1/interactions.go @@ -52,27 +52,28 @@ func (c *ApiService) CreateInteraction(params *CreateInteractionParams) (*FlexV1 data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Channel != nil { - v, err := json.Marshal(params.Channel) - if err != nil { - return nil, err - } + if params != nil && params.Channel != nil { + v, err := json.Marshal(params.Channel) - data.Set("Channel", string(v)) -} -if params != nil && params.Routing != nil { - v, err := json.Marshal(params.Routing) + if err != nil { + return nil, err + } - if err != nil { - return nil, err + data.Set("Channel", string(v)) } + if params != nil && params.Routing != nil { + v, err := json.Marshal(params.Routing) - data.Set("Routing", string(v)) -} -if params != nil && params.InteractionContextSid != nil { - data.Set("InteractionContextSid", *params.InteractionContextSid) -} + if err != nil { + return nil, err + } + + data.Set("Routing", string(v)) + } + if params != nil && params.InteractionContextSid != nil { + data.Set("InteractionContextSid", *params.InteractionContextSid) + } @@ -101,6 +102,7 @@ func (c *ApiService) FetchInteraction(Sid string, ) (*FlexV1Interaction, error) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/flex/v1/interactions_channels.go b/rest/flex/v1/interactions_channels.go index a986b7025..3345e3f38 100644 --- a/rest/flex/v1/interactions_channels.go +++ b/rest/flex/v1/interactions_channels.go @@ -34,6 +34,7 @@ func (c *ApiService) FetchInteractionChannel(InteractionSid string, Sid string, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -74,9 +75,10 @@ func (c *ApiService) PageInteractionChannel(InteractionSid string, params *ListI data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -213,18 +215,19 @@ func (c *ApiService) UpdateInteractionChannel(InteractionSid string, Sid string, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.Routing != nil { - v, err := json.Marshal(params.Routing) - if err != nil { - return nil, err + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) } + if params != nil && params.Routing != nil { + v, err := json.Marshal(params.Routing) - data.Set("Routing", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Routing", string(v)) + } diff --git a/rest/flex/v1/interactions_channels_invites.go b/rest/flex/v1/interactions_channels_invites.go index 76f89b1d2..4a1176ce0 100644 --- a/rest/flex/v1/interactions_channels_invites.go +++ b/rest/flex/v1/interactions_channels_invites.go @@ -42,15 +42,16 @@ func (c *ApiService) CreateInteractionChannelInvite(InteractionSid string, Chann data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Routing != nil { - v, err := json.Marshal(params.Routing) - if err != nil { - return nil, err - } + if params != nil && params.Routing != nil { + v, err := json.Marshal(params.Routing) - data.Set("Routing", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Routing", string(v)) + } @@ -95,9 +96,10 @@ func (c *ApiService) PageInteractionChannelInvite(InteractionSid string, Channel data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/flex/v1/interactions_channels_participants.go b/rest/flex/v1/interactions_channels_participants.go index a823458fb..48299a52a 100644 --- a/rest/flex/v1/interactions_channels_participants.go +++ b/rest/flex/v1/interactions_channels_participants.go @@ -48,18 +48,19 @@ func (c *ApiService) CreateInteractionChannelParticipant(InteractionSid string, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.MediaProperties != nil { - v, err := json.Marshal(params.MediaProperties) - if err != nil { - return nil, err + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) } + if params != nil && params.MediaProperties != nil { + v, err := json.Marshal(params.MediaProperties) - data.Set("MediaProperties", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("MediaProperties", string(v)) + } @@ -104,9 +105,10 @@ func (c *ApiService) PageInteractionChannelParticipant(InteractionSid string, Ch data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -238,9 +240,10 @@ func (c *ApiService) UpdateInteractionChannelParticipant(InteractionSid string, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } diff --git a/rest/flex/v1/web_channels.go b/rest/flex/v1/web_channels.go index 0e7c49f26..8e049021c 100644 --- a/rest/flex/v1/web_channels.go +++ b/rest/flex/v1/web_channels.go @@ -70,24 +70,25 @@ func (c *ApiService) CreateWebChannel(params *CreateWebChannelParams) (*FlexV1We data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FlexFlowSid != nil { - data.Set("FlexFlowSid", *params.FlexFlowSid) -} -if params != nil && params.Identity != nil { - data.Set("Identity", *params.Identity) -} -if params != nil && params.CustomerFriendlyName != nil { - data.Set("CustomerFriendlyName", *params.CustomerFriendlyName) -} -if params != nil && params.ChatFriendlyName != nil { - data.Set("ChatFriendlyName", *params.ChatFriendlyName) -} -if params != nil && params.ChatUniqueName != nil { - data.Set("ChatUniqueName", *params.ChatUniqueName) -} -if params != nil && params.PreEngagementData != nil { - data.Set("PreEngagementData", *params.PreEngagementData) -} + + if params != nil && params.FlexFlowSid != nil { + data.Set("FlexFlowSid", *params.FlexFlowSid) + } + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.CustomerFriendlyName != nil { + data.Set("CustomerFriendlyName", *params.CustomerFriendlyName) + } + if params != nil && params.ChatFriendlyName != nil { + data.Set("ChatFriendlyName", *params.ChatFriendlyName) + } + if params != nil && params.ChatUniqueName != nil { + data.Set("ChatUniqueName", *params.ChatUniqueName) + } + if params != nil && params.PreEngagementData != nil { + data.Set("PreEngagementData", *params.PreEngagementData) + } @@ -116,6 +117,7 @@ func (c *ApiService) DeleteWebChannel(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -136,6 +138,7 @@ func (c *ApiService) FetchWebChannel(Sid string, ) (*FlexV1WebChannel, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -175,9 +178,10 @@ func (c *ApiService) PageWebChannel(params *ListWebChannelParams, pageToken, pag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -313,12 +317,13 @@ func (c *ApiService) UpdateWebChannel(Sid string, params *UpdateWebChannelParams 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) -} + + if params != nil && params.ChatStatus != nil { + data.Set("ChatStatus", *params.ChatStatus) + } + if params != nil && params.PostEngagementData != nil { + data.Set("PostEngagementData", *params.PostEngagementData) + } diff --git a/rest/flex/v2/web_chats.go b/rest/flex/v2/web_chats.go index 38114ce2f..fb8812aa3 100644 --- a/rest/flex/v2/web_chats.go +++ b/rest/flex/v2/web_chats.go @@ -58,18 +58,19 @@ func (c *ApiService) CreateWebChannel(params *CreateWebChannelParams) (*FlexV2We data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.AddressSid != nil { - data.Set("AddressSid", *params.AddressSid) -} -if params != nil && params.ChatFriendlyName != nil { - data.Set("ChatFriendlyName", *params.ChatFriendlyName) -} -if params != nil && params.CustomerFriendlyName != nil { - data.Set("CustomerFriendlyName", *params.CustomerFriendlyName) -} -if params != nil && params.PreEngagementData != nil { - data.Set("PreEngagementData", *params.PreEngagementData) -} + + if params != nil && params.AddressSid != nil { + data.Set("AddressSid", *params.AddressSid) + } + if params != nil && params.ChatFriendlyName != nil { + data.Set("ChatFriendlyName", *params.ChatFriendlyName) + } + if params != nil && params.CustomerFriendlyName != nil { + data.Set("CustomerFriendlyName", *params.CustomerFriendlyName) + } + if params != nil && params.PreEngagementData != nil { + data.Set("PreEngagementData", *params.PreEngagementData) + } diff --git a/rest/frontline/v1/users.go b/rest/frontline/v1/users.go index bb6f0893b..cafe68217 100644 --- a/rest/frontline/v1/users.go +++ b/rest/frontline/v1/users.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchUser(Sid string, ) (*FrontlineV1User, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -84,18 +85,19 @@ func (c *ApiService) UpdateUser(Sid string, params *UpdateUserParams) (*Frontlin data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Avatar != nil { - data.Set("Avatar", *params.Avatar) -} -if params != nil && params.State != nil { - data.Set("State", *params.State) -} -if params != nil && params.IsAvailable != nil { - data.Set("IsAvailable", fmt.Sprint(*params.IsAvailable)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Avatar != nil { + data.Set("Avatar", *params.Avatar) + } + if params != nil && params.State != nil { + data.Set("State", *params.State) + } + if params != nil && params.IsAvailable != nil { + data.Set("IsAvailable", fmt.Sprint(*params.IsAvailable)) + } diff --git a/rest/insights/v1/conferences.go b/rest/insights/v1/conferences.go index e8d6230a7..1520ad4fa 100644 --- a/rest/insights/v1/conferences.go +++ b/rest/insights/v1/conferences.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchConference(ConferenceSid string, ) (*InsightsV1Confere + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -132,39 +133,40 @@ func (c *ApiService) PageConference(params *ListConferenceParams, pageToken, pag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ConferenceSid != nil { - data.Set("ConferenceSid", *params.ConferenceSid) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.CreatedAfter != nil { - data.Set("CreatedAfter", *params.CreatedAfter) -} -if params != nil && params.CreatedBefore != nil { - data.Set("CreatedBefore", *params.CreatedBefore) -} -if params != nil && params.MixerRegion != nil { - data.Set("MixerRegion", *params.MixerRegion) -} -if params != nil && params.Tags != nil { - data.Set("Tags", *params.Tags) -} -if params != nil && params.Subaccount != nil { - data.Set("Subaccount", *params.Subaccount) -} -if params != nil && params.DetectedIssues != nil { - data.Set("DetectedIssues", *params.DetectedIssues) -} -if params != nil && params.EndReason != nil { - data.Set("EndReason", *params.EndReason) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.ConferenceSid != nil { + data.Set("ConferenceSid", *params.ConferenceSid) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.CreatedAfter != nil { + data.Set("CreatedAfter", *params.CreatedAfter) + } + if params != nil && params.CreatedBefore != nil { + data.Set("CreatedBefore", *params.CreatedBefore) + } + if params != nil && params.MixerRegion != nil { + data.Set("MixerRegion", *params.MixerRegion) + } + if params != nil && params.Tags != nil { + data.Set("Tags", *params.Tags) + } + if params != nil && params.Subaccount != nil { + data.Set("Subaccount", *params.Subaccount) + } + if params != nil && params.DetectedIssues != nil { + data.Set("DetectedIssues", *params.DetectedIssues) + } + if params != nil && params.EndReason != nil { + data.Set("EndReason", *params.EndReason) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/insights/v1/conferences_participants.go b/rest/insights/v1/conferences_participants.go index ec083aad9..f44fbd06e 100644 --- a/rest/insights/v1/conferences_participants.go +++ b/rest/insights/v1/conferences_participants.go @@ -48,12 +48,13 @@ func (c *ApiService) FetchConferenceParticipant(ConferenceSid string, Participan data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Events != nil { - data.Set("Events", *params.Events) -} -if params != nil && params.Metrics != nil { - data.Set("Metrics", *params.Metrics) -} + + if params != nil && params.Events != nil { + data.Set("Events", *params.Events) + } + if params != nil && params.Metrics != nil { + data.Set("Metrics", *params.Metrics) + } @@ -115,18 +116,19 @@ func (c *ApiService) PageConferenceParticipant(ConferenceSid string, params *Lis data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ParticipantSid != nil { - data.Set("ParticipantSid", *params.ParticipantSid) -} -if params != nil && params.Label != nil { - data.Set("Label", *params.Label) -} -if params != nil && params.Events != nil { - data.Set("Events", *params.Events) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.ParticipantSid != nil { + data.Set("ParticipantSid", *params.ParticipantSid) + } + if params != nil && params.Label != nil { + data.Set("Label", *params.Label) + } + if params != nil && params.Events != nil { + data.Set("Events", *params.Events) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/insights/v1/video_rooms.go b/rest/insights/v1/video_rooms.go index eba8b535a..635cf5a3d 100644 --- a/rest/insights/v1/video_rooms.go +++ b/rest/insights/v1/video_rooms.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchVideoRoomSummary(RoomSid string, ) (*InsightsV1VideoRo + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -102,28 +103,29 @@ func (c *ApiService) PageVideoRoomSummary(params *ListVideoRoomSummaryParams, pa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.RoomType != nil { - for _, item := range *params.RoomType { - data.Add("RoomType", item) + + if params != nil && params.RoomType != nil { + for _, item := range *params.RoomType { + data.Add("RoomType", item) } -} -if params != nil && params.Codec != nil { - for _, item := range *params.Codec { - data.Add("Codec", item) } -} -if params != nil && params.RoomName != nil { - data.Set("RoomName", *params.RoomName) -} -if params != nil && params.CreatedAfter != nil { - data.Set("CreatedAfter", fmt.Sprint((*params.CreatedAfter).Format(time.RFC3339))) -} -if params != nil && params.CreatedBefore != nil { - data.Set("CreatedBefore", fmt.Sprint((*params.CreatedBefore).Format(time.RFC3339))) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + if params != nil && params.Codec != nil { + for _, item := range *params.Codec { + data.Add("Codec", item) + } + } + if params != nil && params.RoomName != nil { + data.Set("RoomName", *params.RoomName) + } + if params != nil && params.CreatedAfter != nil { + data.Set("CreatedAfter", fmt.Sprint((*params.CreatedAfter).Format(time.RFC3339))) + } + if params != nil && params.CreatedBefore != nil { + data.Set("CreatedBefore", fmt.Sprint((*params.CreatedBefore).Format(time.RFC3339))) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/insights/v1/video_rooms_participants.go b/rest/insights/v1/video_rooms_participants.go index 12a5138f1..fa0d11044 100644 --- a/rest/insights/v1/video_rooms_participants.go +++ b/rest/insights/v1/video_rooms_participants.go @@ -34,6 +34,7 @@ func (c *ApiService) FetchVideoParticipantSummary(RoomSid string, ParticipantSid + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -74,9 +75,10 @@ func (c *ApiService) PageVideoParticipantSummary(RoomSid string, params *ListVid data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/insights/v1/voice.go b/rest/insights/v1/voice.go index 5a1f960f4..2d5490130 100644 --- a/rest/insights/v1/voice.go +++ b/rest/insights/v1/voice.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchCall(Sid string, ) (*InsightsV1Call, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/insights/v1/voice_annotation.go b/rest/insights/v1/voice_annotation.go index 055d2ad48..da9aaaa9d 100644 --- a/rest/insights/v1/voice_annotation.go +++ b/rest/insights/v1/voice_annotation.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchAnnotation(CallSid string, ) (*InsightsV1Annotation, e + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -102,27 +103,28 @@ func (c *ApiService) UpdateAnnotation(CallSid string, params *UpdateAnnotationPa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.AnsweredBy != nil { - data.Set("AnsweredBy", *params.AnsweredBy) -} -if params != nil && params.ConnectivityIssue != nil { - data.Set("ConnectivityIssue", *params.ConnectivityIssue) -} -if params != nil && params.QualityIssues != nil { - data.Set("QualityIssues", *params.QualityIssues) -} -if params != nil && params.Spam != nil { - data.Set("Spam", fmt.Sprint(*params.Spam)) -} -if params != nil && params.CallScore != nil { - data.Set("CallScore", fmt.Sprint(*params.CallScore)) -} -if params != nil && params.Comment != nil { - data.Set("Comment", *params.Comment) -} -if params != nil && params.Incident != nil { - data.Set("Incident", *params.Incident) -} + + if params != nil && params.AnsweredBy != nil { + data.Set("AnsweredBy", *params.AnsweredBy) + } + if params != nil && params.ConnectivityIssue != nil { + data.Set("ConnectivityIssue", *params.ConnectivityIssue) + } + if params != nil && params.QualityIssues != nil { + data.Set("QualityIssues", *params.QualityIssues) + } + if params != nil && params.Spam != nil { + data.Set("Spam", fmt.Sprint(*params.Spam)) + } + if params != nil && params.CallScore != nil { + data.Set("CallScore", fmt.Sprint(*params.CallScore)) + } + if params != nil && params.Comment != nil { + data.Set("Comment", *params.Comment) + } + if params != nil && params.Incident != nil { + data.Set("Incident", *params.Incident) + } diff --git a/rest/insights/v1/voice_events.go b/rest/insights/v1/voice_events.go index 880599574..c1aca48e2 100644 --- a/rest/insights/v1/voice_events.go +++ b/rest/insights/v1/voice_events.go @@ -54,12 +54,13 @@ func (c *ApiService) PageEvent(CallSid string, params *ListEventParams, pageToke 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)) -} + + if params != nil && params.Edge != nil { + data.Set("Edge", *params.Edge) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/insights/v1/voice_metrics.go b/rest/insights/v1/voice_metrics.go index 817b3add8..f89fce873 100644 --- a/rest/insights/v1/voice_metrics.go +++ b/rest/insights/v1/voice_metrics.go @@ -60,15 +60,16 @@ func (c *ApiService) PageMetric(CallSid string, params *ListMetricParams, pageTo data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Edge != nil { - data.Set("Edge", *params.Edge) -} -if params != nil && params.Direction != nil { - data.Set("Direction", *params.Direction) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Edge != nil { + data.Set("Edge", *params.Edge) + } + if params != nil && params.Direction != nil { + data.Set("Direction", *params.Direction) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/insights/v1/voice_settings.go b/rest/insights/v1/voice_settings.go index cc9d0437e..3bdc6b6aa 100644 --- a/rest/insights/v1/voice_settings.go +++ b/rest/insights/v1/voice_settings.go @@ -40,9 +40,10 @@ func (c *ApiService) FetchAccountSettings(params *FetchAccountSettingsParams) (* data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.SubaccountSid != nil { - data.Set("SubaccountSid", *params.SubaccountSid) -} + + if params != nil && params.SubaccountSid != nil { + data.Set("SubaccountSid", *params.SubaccountSid) + } @@ -90,15 +91,16 @@ func (c *ApiService) UpdateAccountSettings(params *UpdateAccountSettingsParams) data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.AdvancedFeatures != nil { - data.Set("AdvancedFeatures", fmt.Sprint(*params.AdvancedFeatures)) -} -if params != nil && params.VoiceTrace != nil { - data.Set("VoiceTrace", fmt.Sprint(*params.VoiceTrace)) -} -if params != nil && params.SubaccountSid != nil { - data.Set("SubaccountSid", *params.SubaccountSid) -} + + if params != nil && params.AdvancedFeatures != nil { + data.Set("AdvancedFeatures", fmt.Sprint(*params.AdvancedFeatures)) + } + if params != nil && params.VoiceTrace != nil { + data.Set("VoiceTrace", fmt.Sprint(*params.VoiceTrace)) + } + if params != nil && params.SubaccountSid != nil { + data.Set("SubaccountSid", *params.SubaccountSid) + } diff --git a/rest/insights/v1/voice_summaries.go b/rest/insights/v1/voice_summaries.go index 198b27798..977c1575b 100644 --- a/rest/insights/v1/voice_summaries.go +++ b/rest/insights/v1/voice_summaries.go @@ -191,81 +191,82 @@ func (c *ApiService) PageCallSummaries(params *ListCallSummariesParams, pageToke data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.From != nil { - data.Set("From", *params.From) -} -if params != nil && params.To != nil { - data.Set("To", *params.To) -} -if params != nil && params.FromCarrier != nil { - data.Set("FromCarrier", *params.FromCarrier) -} -if params != nil && params.ToCarrier != nil { - data.Set("ToCarrier", *params.ToCarrier) -} -if params != nil && params.FromCountryCode != nil { - data.Set("FromCountryCode", *params.FromCountryCode) -} -if params != nil && params.ToCountryCode != nil { - data.Set("ToCountryCode", *params.ToCountryCode) -} -if params != nil && params.Branded != nil { - data.Set("Branded", fmt.Sprint(*params.Branded)) -} -if params != nil && params.VerifiedCaller != nil { - data.Set("VerifiedCaller", fmt.Sprint(*params.VerifiedCaller)) -} -if params != nil && params.HasTag != nil { - data.Set("HasTag", fmt.Sprint(*params.HasTag)) -} -if params != nil && params.StartTime != nil { - data.Set("StartTime", *params.StartTime) -} -if params != nil && params.EndTime != nil { - data.Set("EndTime", *params.EndTime) -} -if params != nil && params.CallType != nil { - data.Set("CallType", *params.CallType) -} -if params != nil && params.CallState != nil { - data.Set("CallState", *params.CallState) -} -if params != nil && params.Direction != nil { - data.Set("Direction", *params.Direction) -} -if params != nil && params.ProcessingState != nil { - data.Set("ProcessingState", *params.ProcessingState) -} -if params != nil && params.SortBy != nil { - data.Set("SortBy", *params.SortBy) -} -if params != nil && params.Subaccount != nil { - data.Set("Subaccount", *params.Subaccount) -} -if params != nil && params.AbnormalSession != nil { - data.Set("AbnormalSession", fmt.Sprint(*params.AbnormalSession)) -} -if params != nil && params.AnsweredBy != nil { - data.Set("AnsweredBy", *params.AnsweredBy) -} -if params != nil && params.AnsweredByAnnotation != nil { - data.Set("AnsweredByAnnotation", *params.AnsweredByAnnotation) -} -if params != nil && params.ConnectivityIssueAnnotation != nil { - data.Set("ConnectivityIssueAnnotation", *params.ConnectivityIssueAnnotation) -} -if params != nil && params.QualityIssueAnnotation != nil { - data.Set("QualityIssueAnnotation", *params.QualityIssueAnnotation) -} -if params != nil && params.SpamAnnotation != nil { - data.Set("SpamAnnotation", fmt.Sprint(*params.SpamAnnotation)) -} -if params != nil && params.CallScoreAnnotation != nil { - data.Set("CallScoreAnnotation", *params.CallScoreAnnotation) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.From != nil { + data.Set("From", *params.From) + } + if params != nil && params.To != nil { + data.Set("To", *params.To) + } + if params != nil && params.FromCarrier != nil { + data.Set("FromCarrier", *params.FromCarrier) + } + if params != nil && params.ToCarrier != nil { + data.Set("ToCarrier", *params.ToCarrier) + } + if params != nil && params.FromCountryCode != nil { + data.Set("FromCountryCode", *params.FromCountryCode) + } + if params != nil && params.ToCountryCode != nil { + data.Set("ToCountryCode", *params.ToCountryCode) + } + if params != nil && params.Branded != nil { + data.Set("Branded", fmt.Sprint(*params.Branded)) + } + if params != nil && params.VerifiedCaller != nil { + data.Set("VerifiedCaller", fmt.Sprint(*params.VerifiedCaller)) + } + if params != nil && params.HasTag != nil { + data.Set("HasTag", fmt.Sprint(*params.HasTag)) + } + if params != nil && params.StartTime != nil { + data.Set("StartTime", *params.StartTime) + } + if params != nil && params.EndTime != nil { + data.Set("EndTime", *params.EndTime) + } + if params != nil && params.CallType != nil { + data.Set("CallType", *params.CallType) + } + if params != nil && params.CallState != nil { + data.Set("CallState", *params.CallState) + } + if params != nil && params.Direction != nil { + data.Set("Direction", *params.Direction) + } + if params != nil && params.ProcessingState != nil { + data.Set("ProcessingState", *params.ProcessingState) + } + if params != nil && params.SortBy != nil { + data.Set("SortBy", *params.SortBy) + } + if params != nil && params.Subaccount != nil { + data.Set("Subaccount", *params.Subaccount) + } + if params != nil && params.AbnormalSession != nil { + data.Set("AbnormalSession", fmt.Sprint(*params.AbnormalSession)) + } + if params != nil && params.AnsweredBy != nil { + data.Set("AnsweredBy", *params.AnsweredBy) + } + if params != nil && params.AnsweredByAnnotation != nil { + data.Set("AnsweredByAnnotation", *params.AnsweredByAnnotation) + } + if params != nil && params.ConnectivityIssueAnnotation != nil { + data.Set("ConnectivityIssueAnnotation", *params.ConnectivityIssueAnnotation) + } + if params != nil && params.QualityIssueAnnotation != nil { + data.Set("QualityIssueAnnotation", *params.QualityIssueAnnotation) + } + if params != nil && params.SpamAnnotation != nil { + data.Set("SpamAnnotation", fmt.Sprint(*params.SpamAnnotation)) + } + if params != nil && params.CallScoreAnnotation != nil { + data.Set("CallScoreAnnotation", *params.CallScoreAnnotation) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/insights/v1/voice_summary.go b/rest/insights/v1/voice_summary.go index 1e48a20e3..090c5caa3 100644 --- a/rest/insights/v1/voice_summary.go +++ b/rest/insights/v1/voice_summary.go @@ -41,9 +41,10 @@ func (c *ApiService) FetchSummary(CallSid string, params *FetchSummaryParams) (* data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ProcessingState != nil { - data.Set("ProcessingState", *params.ProcessingState) -} + + if params != nil && params.ProcessingState != nil { + data.Set("ProcessingState", *params.ProcessingState) + } diff --git a/rest/intelligence/v2/services.go b/rest/intelligence/v2/services.go index d1906c41d..0826fc819 100644 --- a/rest/intelligence/v2/services.go +++ b/rest/intelligence/v2/services.go @@ -88,33 +88,34 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*IntelligenceV2 data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.AutoTranscribe != nil { - data.Set("AutoTranscribe", fmt.Sprint(*params.AutoTranscribe)) -} -if params != nil && params.DataLogging != nil { - data.Set("DataLogging", fmt.Sprint(*params.DataLogging)) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.LanguageCode != nil { - data.Set("LanguageCode", *params.LanguageCode) -} -if params != nil && params.AutoRedaction != nil { - data.Set("AutoRedaction", fmt.Sprint(*params.AutoRedaction)) -} -if params != nil && params.MediaRedaction != nil { - data.Set("MediaRedaction", fmt.Sprint(*params.MediaRedaction)) -} -if params != nil && params.WebhookUrl != nil { - data.Set("WebhookUrl", *params.WebhookUrl) -} -if params != nil && params.WebhookHttpMethod != nil { - data.Set("WebhookHttpMethod", *params.WebhookHttpMethod) -} + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.AutoTranscribe != nil { + data.Set("AutoTranscribe", fmt.Sprint(*params.AutoTranscribe)) + } + if params != nil && params.DataLogging != nil { + data.Set("DataLogging", fmt.Sprint(*params.DataLogging)) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.LanguageCode != nil { + data.Set("LanguageCode", *params.LanguageCode) + } + if params != nil && params.AutoRedaction != nil { + data.Set("AutoRedaction", fmt.Sprint(*params.AutoRedaction)) + } + if params != nil && params.MediaRedaction != nil { + data.Set("MediaRedaction", fmt.Sprint(*params.MediaRedaction)) + } + if params != nil && params.WebhookUrl != nil { + data.Set("WebhookUrl", *params.WebhookUrl) + } + if params != nil && params.WebhookHttpMethod != nil { + data.Set("WebhookHttpMethod", *params.WebhookHttpMethod) + } @@ -143,6 +144,7 @@ func (c *ApiService) DeleteService(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -163,6 +165,7 @@ func (c *ApiService) FetchService(Sid string, ) (*IntelligenceV2Service, error) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -202,9 +205,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -388,33 +392,34 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*In data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.AutoTranscribe != nil { - data.Set("AutoTranscribe", fmt.Sprint(*params.AutoTranscribe)) -} -if params != nil && params.DataLogging != nil { - data.Set("DataLogging", fmt.Sprint(*params.DataLogging)) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.LanguageCode != nil { - data.Set("LanguageCode", *params.LanguageCode) -} -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.AutoRedaction != nil { - data.Set("AutoRedaction", fmt.Sprint(*params.AutoRedaction)) -} -if params != nil && params.MediaRedaction != nil { - data.Set("MediaRedaction", fmt.Sprint(*params.MediaRedaction)) -} -if params != nil && params.WebhookUrl != nil { - data.Set("WebhookUrl", *params.WebhookUrl) -} -if params != nil && params.WebhookHttpMethod != nil { - data.Set("WebhookHttpMethod", *params.WebhookHttpMethod) -} + + if params != nil && params.AutoTranscribe != nil { + data.Set("AutoTranscribe", fmt.Sprint(*params.AutoTranscribe)) + } + if params != nil && params.DataLogging != nil { + data.Set("DataLogging", fmt.Sprint(*params.DataLogging)) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.LanguageCode != nil { + data.Set("LanguageCode", *params.LanguageCode) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.AutoRedaction != nil { + data.Set("AutoRedaction", fmt.Sprint(*params.AutoRedaction)) + } + if params != nil && params.MediaRedaction != nil { + data.Set("MediaRedaction", fmt.Sprint(*params.MediaRedaction)) + } + if params != nil && params.WebhookUrl != nil { + data.Set("WebhookUrl", *params.WebhookUrl) + } + if params != nil && params.WebhookHttpMethod != nil { + data.Set("WebhookHttpMethod", *params.WebhookHttpMethod) + } if params != nil && params.IfMatch != nil { diff --git a/rest/intelligence/v2/transcripts.go b/rest/intelligence/v2/transcripts.go index 2b74652bd..44ef30072 100644 --- a/rest/intelligence/v2/transcripts.go +++ b/rest/intelligence/v2/transcripts.go @@ -58,24 +58,25 @@ func (c *ApiService) CreateTranscript(params *CreateTranscriptParams) (*Intellig data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ServiceSid != nil { - data.Set("ServiceSid", *params.ServiceSid) -} -if params != nil && params.Channel != nil { - v, err := json.Marshal(params.Channel) - if err != nil { - return nil, err + if params != nil && params.ServiceSid != nil { + data.Set("ServiceSid", *params.ServiceSid) } + if params != nil && params.Channel != nil { + v, err := json.Marshal(params.Channel) - data.Set("Channel", string(v)) -} -if params != nil && params.CustomerKey != nil { - data.Set("CustomerKey", *params.CustomerKey) -} -if params != nil && params.MediaStartTime != nil { - data.Set("MediaStartTime", fmt.Sprint((*params.MediaStartTime).Format(time.RFC3339))) -} + if err != nil { + return nil, err + } + + data.Set("Channel", string(v)) + } + if params != nil && params.CustomerKey != nil { + data.Set("CustomerKey", *params.CustomerKey) + } + if params != nil && params.MediaStartTime != nil { + data.Set("MediaStartTime", fmt.Sprint((*params.MediaStartTime).Format(time.RFC3339))) + } @@ -104,6 +105,7 @@ func (c *ApiService) DeleteTranscript(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -132,9 +134,10 @@ func (c *ApiService) FetchTranscript(Sid string, params *FetchTranscriptParams) data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Redacted != nil { - data.Set("Redacted", fmt.Sprint(*params.Redacted)) -} + + if params != nil && params.Redacted != nil { + data.Set("Redacted", fmt.Sprint(*params.Redacted)) + } @@ -225,33 +228,34 @@ func (c *ApiService) PageTranscript(params *ListTranscriptParams, pageToken, pag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ServiceSid != nil { - data.Set("ServiceSid", *params.ServiceSid) -} -if params != nil && params.BeforeStartTime != nil { - data.Set("BeforeStartTime", *params.BeforeStartTime) -} -if params != nil && params.AfterStartTime != nil { - data.Set("AfterStartTime", *params.AfterStartTime) -} -if params != nil && params.BeforeDateCreated != nil { - data.Set("BeforeDateCreated", *params.BeforeDateCreated) -} -if params != nil && params.AfterDateCreated != nil { - data.Set("AfterDateCreated", *params.AfterDateCreated) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.LanguageCode != nil { - data.Set("LanguageCode", *params.LanguageCode) -} -if params != nil && params.SourceSid != nil { - data.Set("SourceSid", *params.SourceSid) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.ServiceSid != nil { + data.Set("ServiceSid", *params.ServiceSid) + } + if params != nil && params.BeforeStartTime != nil { + data.Set("BeforeStartTime", *params.BeforeStartTime) + } + if params != nil && params.AfterStartTime != nil { + data.Set("AfterStartTime", *params.AfterStartTime) + } + if params != nil && params.BeforeDateCreated != nil { + data.Set("BeforeDateCreated", *params.BeforeDateCreated) + } + if params != nil && params.AfterDateCreated != nil { + data.Set("AfterDateCreated", *params.AfterDateCreated) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.LanguageCode != nil { + data.Set("LanguageCode", *params.LanguageCode) + } + if params != nil && params.SourceSid != nil { + data.Set("SourceSid", *params.SourceSid) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/intelligence/v2/transcripts_media.go b/rest/intelligence/v2/transcripts_media.go index 4df8d8b92..86f2a4a50 100644 --- a/rest/intelligence/v2/transcripts_media.go +++ b/rest/intelligence/v2/transcripts_media.go @@ -41,9 +41,10 @@ func (c *ApiService) FetchMedia(Sid string, params *FetchMediaParams) (*Intellig data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Redacted != nil { - data.Set("Redacted", fmt.Sprint(*params.Redacted)) -} + + if params != nil && params.Redacted != nil { + data.Set("Redacted", fmt.Sprint(*params.Redacted)) + } diff --git a/rest/intelligence/v2/transcripts_operator_results.go b/rest/intelligence/v2/transcripts_operator_results.go index b457ea125..96b0a79d2 100644 --- a/rest/intelligence/v2/transcripts_operator_results.go +++ b/rest/intelligence/v2/transcripts_operator_results.go @@ -42,9 +42,10 @@ func (c *ApiService) FetchOperatorResult(TranscriptSid string, OperatorSid strin data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Redacted != nil { - data.Set("Redacted", fmt.Sprint(*params.Redacted)) -} + + if params != nil && params.Redacted != nil { + data.Set("Redacted", fmt.Sprint(*params.Redacted)) + } @@ -94,12 +95,13 @@ func (c *ApiService) PageOperatorResult(TranscriptSid string, params *ListOperat data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Redacted != nil { - data.Set("Redacted", fmt.Sprint(*params.Redacted)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Redacted != nil { + data.Set("Redacted", fmt.Sprint(*params.Redacted)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/intelligence/v2/transcripts_sentences.go b/rest/intelligence/v2/transcripts_sentences.go index 18dd408d8..78df36197 100644 --- a/rest/intelligence/v2/transcripts_sentences.go +++ b/rest/intelligence/v2/transcripts_sentences.go @@ -54,12 +54,13 @@ func (c *ApiService) PageSentence(TranscriptSid string, params *ListSentencePara data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Redacted != nil { - data.Set("Redacted", fmt.Sprint(*params.Redacted)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Redacted != nil { + data.Set("Redacted", fmt.Sprint(*params.Redacted)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/ip_messaging/v1/credentials.go b/rest/ip_messaging/v1/credentials.go index 61ebef0ef..48f50bef3 100644 --- a/rest/ip_messaging/v1/credentials.go +++ b/rest/ip_messaging/v1/credentials.go @@ -76,27 +76,28 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*IpMessag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Certificate != nil { - data.Set("Certificate", *params.Certificate) -} -if params != nil && params.PrivateKey != nil { - data.Set("PrivateKey", *params.PrivateKey) -} -if params != nil && params.Sandbox != nil { - data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) -} -if params != nil && params.ApiKey != nil { - data.Set("ApiKey", *params.ApiKey) -} -if params != nil && params.Secret != nil { - data.Set("Secret", *params.Secret) -} + + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Certificate != nil { + data.Set("Certificate", *params.Certificate) + } + if params != nil && params.PrivateKey != nil { + data.Set("PrivateKey", *params.PrivateKey) + } + if params != nil && params.Sandbox != nil { + data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) + } + if params != nil && params.ApiKey != nil { + data.Set("ApiKey", *params.ApiKey) + } + if params != nil && params.Secret != nil { + data.Set("Secret", *params.Secret) + } @@ -125,6 +126,7 @@ func (c *ApiService) DeleteCredential(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -145,6 +147,7 @@ func (c *ApiService) FetchCredential(Sid string, ) (*IpMessagingV1Credential, er + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -184,9 +187,10 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken, pag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -346,24 +350,25 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Certificate != nil { - data.Set("Certificate", *params.Certificate) -} -if params != nil && params.PrivateKey != nil { - data.Set("PrivateKey", *params.PrivateKey) -} -if params != nil && params.Sandbox != nil { - data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) -} -if params != nil && params.ApiKey != nil { - data.Set("ApiKey", *params.ApiKey) -} -if params != nil && params.Secret != nil { - data.Set("Secret", *params.Secret) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Certificate != nil { + data.Set("Certificate", *params.Certificate) + } + if params != nil && params.PrivateKey != nil { + data.Set("PrivateKey", *params.PrivateKey) + } + if params != nil && params.Sandbox != nil { + data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) + } + if params != nil && params.ApiKey != nil { + data.Set("ApiKey", *params.ApiKey) + } + if params != nil && params.Secret != nil { + data.Set("Secret", *params.Secret) + } diff --git a/rest/ip_messaging/v1/services.go b/rest/ip_messaging/v1/services.go index 07ff680f1..2af14aeff 100644 --- a/rest/ip_messaging/v1/services.go +++ b/rest/ip_messaging/v1/services.go @@ -40,9 +40,10 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*IpMessagingV1S data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } @@ -71,6 +72,7 @@ func (c *ApiService) DeleteService(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -91,6 +93,7 @@ func (c *ApiService) FetchService(Sid string, ) (*IpMessagingV1Service, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -130,9 +133,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -580,170 +584,171 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ip data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.DefaultServiceRoleSid != nil { - data.Set("DefaultServiceRoleSid", *params.DefaultServiceRoleSid) -} -if params != nil && params.DefaultChannelRoleSid != nil { - data.Set("DefaultChannelRoleSid", *params.DefaultChannelRoleSid) -} -if params != nil && params.DefaultChannelCreatorRoleSid != nil { - data.Set("DefaultChannelCreatorRoleSid", *params.DefaultChannelCreatorRoleSid) -} -if params != nil && params.ReadStatusEnabled != nil { - data.Set("ReadStatusEnabled", fmt.Sprint(*params.ReadStatusEnabled)) -} -if params != nil && params.ReachabilityEnabled != nil { - data.Set("ReachabilityEnabled", fmt.Sprint(*params.ReachabilityEnabled)) -} -if params != nil && params.TypingIndicatorTimeout != nil { - data.Set("TypingIndicatorTimeout", fmt.Sprint(*params.TypingIndicatorTimeout)) -} -if params != nil && params.ConsumptionReportInterval != nil { - data.Set("ConsumptionReportInterval", fmt.Sprint(*params.ConsumptionReportInterval)) -} -if params != nil && params.NotificationsNewMessageEnabled != nil { - data.Set("Notifications.NewMessage.Enabled", fmt.Sprint(*params.NotificationsNewMessageEnabled)) -} -if params != nil && params.NotificationsNewMessageTemplate != nil { - data.Set("Notifications.NewMessage.Template", *params.NotificationsNewMessageTemplate) -} -if params != nil && params.NotificationsAddedToChannelEnabled != nil { - data.Set("Notifications.AddedToChannel.Enabled", fmt.Sprint(*params.NotificationsAddedToChannelEnabled)) -} -if params != nil && params.NotificationsAddedToChannelTemplate != nil { - data.Set("Notifications.AddedToChannel.Template", *params.NotificationsAddedToChannelTemplate) -} -if params != nil && params.NotificationsRemovedFromChannelEnabled != nil { - data.Set("Notifications.RemovedFromChannel.Enabled", fmt.Sprint(*params.NotificationsRemovedFromChannelEnabled)) -} -if params != nil && params.NotificationsRemovedFromChannelTemplate != nil { - data.Set("Notifications.RemovedFromChannel.Template", *params.NotificationsRemovedFromChannelTemplate) -} -if params != nil && params.NotificationsInvitedToChannelEnabled != nil { - data.Set("Notifications.InvitedToChannel.Enabled", fmt.Sprint(*params.NotificationsInvitedToChannelEnabled)) -} -if params != nil && params.NotificationsInvitedToChannelTemplate != nil { - data.Set("Notifications.InvitedToChannel.Template", *params.NotificationsInvitedToChannelTemplate) -} -if params != nil && params.PreWebhookUrl != nil { - data.Set("PreWebhookUrl", *params.PreWebhookUrl) -} -if params != nil && params.PostWebhookUrl != nil { - data.Set("PostWebhookUrl", *params.PostWebhookUrl) -} -if params != nil && params.WebhookMethod != nil { - data.Set("WebhookMethod", *params.WebhookMethod) -} -if params != nil && params.WebhookFilters != nil { - for _, item := range *params.WebhookFilters { - data.Add("WebhookFilters", item) + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.DefaultServiceRoleSid != nil { + data.Set("DefaultServiceRoleSid", *params.DefaultServiceRoleSid) + } + if params != nil && params.DefaultChannelRoleSid != nil { + data.Set("DefaultChannelRoleSid", *params.DefaultChannelRoleSid) + } + if params != nil && params.DefaultChannelCreatorRoleSid != nil { + data.Set("DefaultChannelCreatorRoleSid", *params.DefaultChannelCreatorRoleSid) + } + if params != nil && params.ReadStatusEnabled != nil { + data.Set("ReadStatusEnabled", fmt.Sprint(*params.ReadStatusEnabled)) + } + if params != nil && params.ReachabilityEnabled != nil { + data.Set("ReachabilityEnabled", fmt.Sprint(*params.ReachabilityEnabled)) + } + if params != nil && params.TypingIndicatorTimeout != nil { + data.Set("TypingIndicatorTimeout", fmt.Sprint(*params.TypingIndicatorTimeout)) + } + if params != nil && params.ConsumptionReportInterval != nil { + data.Set("ConsumptionReportInterval", fmt.Sprint(*params.ConsumptionReportInterval)) + } + if params != nil && params.NotificationsNewMessageEnabled != nil { + data.Set("Notifications.NewMessage.Enabled", fmt.Sprint(*params.NotificationsNewMessageEnabled)) + } + if params != nil && params.NotificationsNewMessageTemplate != nil { + data.Set("Notifications.NewMessage.Template", *params.NotificationsNewMessageTemplate) + } + if params != nil && params.NotificationsAddedToChannelEnabled != nil { + data.Set("Notifications.AddedToChannel.Enabled", fmt.Sprint(*params.NotificationsAddedToChannelEnabled)) + } + if params != nil && params.NotificationsAddedToChannelTemplate != nil { + data.Set("Notifications.AddedToChannel.Template", *params.NotificationsAddedToChannelTemplate) + } + if params != nil && params.NotificationsRemovedFromChannelEnabled != nil { + data.Set("Notifications.RemovedFromChannel.Enabled", fmt.Sprint(*params.NotificationsRemovedFromChannelEnabled)) + } + if params != nil && params.NotificationsRemovedFromChannelTemplate != nil { + data.Set("Notifications.RemovedFromChannel.Template", *params.NotificationsRemovedFromChannelTemplate) + } + if params != nil && params.NotificationsInvitedToChannelEnabled != nil { + data.Set("Notifications.InvitedToChannel.Enabled", fmt.Sprint(*params.NotificationsInvitedToChannelEnabled)) + } + if params != nil && params.NotificationsInvitedToChannelTemplate != nil { + data.Set("Notifications.InvitedToChannel.Template", *params.NotificationsInvitedToChannelTemplate) + } + if params != nil && params.PreWebhookUrl != nil { + data.Set("PreWebhookUrl", *params.PreWebhookUrl) + } + if params != nil && params.PostWebhookUrl != nil { + data.Set("PostWebhookUrl", *params.PostWebhookUrl) + } + if params != nil && params.WebhookMethod != nil { + data.Set("WebhookMethod", *params.WebhookMethod) + } + if params != nil && params.WebhookFilters != nil { + for _, item := range *params.WebhookFilters { + data.Add("WebhookFilters", item) + } + } + if params != nil && params.WebhooksOnMessageSendUrl != nil { + data.Set("Webhooks.OnMessageSend.Url", *params.WebhooksOnMessageSendUrl) + } + if params != nil && params.WebhooksOnMessageSendMethod != nil { + data.Set("Webhooks.OnMessageSend.Method", *params.WebhooksOnMessageSendMethod) + } + if params != nil && params.WebhooksOnMessageUpdateUrl != nil { + data.Set("Webhooks.OnMessageUpdate.Url", *params.WebhooksOnMessageUpdateUrl) + } + if params != nil && params.WebhooksOnMessageUpdateMethod != nil { + data.Set("Webhooks.OnMessageUpdate.Method", *params.WebhooksOnMessageUpdateMethod) + } + if params != nil && params.WebhooksOnMessageRemoveUrl != nil { + data.Set("Webhooks.OnMessageRemove.Url", *params.WebhooksOnMessageRemoveUrl) + } + if params != nil && params.WebhooksOnMessageRemoveMethod != nil { + data.Set("Webhooks.OnMessageRemove.Method", *params.WebhooksOnMessageRemoveMethod) + } + if params != nil && params.WebhooksOnChannelAddUrl != nil { + data.Set("Webhooks.OnChannelAdd.Url", *params.WebhooksOnChannelAddUrl) + } + if params != nil && params.WebhooksOnChannelAddMethod != nil { + data.Set("Webhooks.OnChannelAdd.Method", *params.WebhooksOnChannelAddMethod) + } + if params != nil && params.WebhooksOnChannelDestroyUrl != nil { + data.Set("Webhooks.OnChannelDestroy.Url", *params.WebhooksOnChannelDestroyUrl) + } + if params != nil && params.WebhooksOnChannelDestroyMethod != nil { + data.Set("Webhooks.OnChannelDestroy.Method", *params.WebhooksOnChannelDestroyMethod) + } + if params != nil && params.WebhooksOnChannelUpdateUrl != nil { + data.Set("Webhooks.OnChannelUpdate.Url", *params.WebhooksOnChannelUpdateUrl) + } + if params != nil && params.WebhooksOnChannelUpdateMethod != nil { + data.Set("Webhooks.OnChannelUpdate.Method", *params.WebhooksOnChannelUpdateMethod) + } + if params != nil && params.WebhooksOnMemberAddUrl != nil { + data.Set("Webhooks.OnMemberAdd.Url", *params.WebhooksOnMemberAddUrl) + } + if params != nil && params.WebhooksOnMemberAddMethod != nil { + data.Set("Webhooks.OnMemberAdd.Method", *params.WebhooksOnMemberAddMethod) + } + if params != nil && params.WebhooksOnMemberRemoveUrl != nil { + data.Set("Webhooks.OnMemberRemove.Url", *params.WebhooksOnMemberRemoveUrl) + } + if params != nil && params.WebhooksOnMemberRemoveMethod != nil { + data.Set("Webhooks.OnMemberRemove.Method", *params.WebhooksOnMemberRemoveMethod) + } + if params != nil && params.WebhooksOnMessageSentUrl != nil { + data.Set("Webhooks.OnMessageSent.Url", *params.WebhooksOnMessageSentUrl) + } + if params != nil && params.WebhooksOnMessageSentMethod != nil { + data.Set("Webhooks.OnMessageSent.Method", *params.WebhooksOnMessageSentMethod) + } + if params != nil && params.WebhooksOnMessageUpdatedUrl != nil { + data.Set("Webhooks.OnMessageUpdated.Url", *params.WebhooksOnMessageUpdatedUrl) + } + if params != nil && params.WebhooksOnMessageUpdatedMethod != nil { + data.Set("Webhooks.OnMessageUpdated.Method", *params.WebhooksOnMessageUpdatedMethod) + } + if params != nil && params.WebhooksOnMessageRemovedUrl != nil { + data.Set("Webhooks.OnMessageRemoved.Url", *params.WebhooksOnMessageRemovedUrl) + } + if params != nil && params.WebhooksOnMessageRemovedMethod != nil { + data.Set("Webhooks.OnMessageRemoved.Method", *params.WebhooksOnMessageRemovedMethod) + } + if params != nil && params.WebhooksOnChannelAddedUrl != nil { + data.Set("Webhooks.OnChannelAdded.Url", *params.WebhooksOnChannelAddedUrl) + } + if params != nil && params.WebhooksOnChannelAddedMethod != nil { + data.Set("Webhooks.OnChannelAdded.Method", *params.WebhooksOnChannelAddedMethod) + } + if params != nil && params.WebhooksOnChannelDestroyedUrl != nil { + data.Set("Webhooks.OnChannelDestroyed.Url", *params.WebhooksOnChannelDestroyedUrl) + } + if params != nil && params.WebhooksOnChannelDestroyedMethod != nil { + data.Set("Webhooks.OnChannelDestroyed.Method", *params.WebhooksOnChannelDestroyedMethod) + } + if params != nil && params.WebhooksOnChannelUpdatedUrl != nil { + data.Set("Webhooks.OnChannelUpdated.Url", *params.WebhooksOnChannelUpdatedUrl) + } + if params != nil && params.WebhooksOnChannelUpdatedMethod != nil { + data.Set("Webhooks.OnChannelUpdated.Method", *params.WebhooksOnChannelUpdatedMethod) + } + if params != nil && params.WebhooksOnMemberAddedUrl != nil { + data.Set("Webhooks.OnMemberAdded.Url", *params.WebhooksOnMemberAddedUrl) + } + if params != nil && params.WebhooksOnMemberAddedMethod != nil { + data.Set("Webhooks.OnMemberAdded.Method", *params.WebhooksOnMemberAddedMethod) + } + if params != nil && params.WebhooksOnMemberRemovedUrl != nil { + data.Set("Webhooks.OnMemberRemoved.Url", *params.WebhooksOnMemberRemovedUrl) + } + if params != nil && params.WebhooksOnMemberRemovedMethod != nil { + data.Set("Webhooks.OnMemberRemoved.Method", *params.WebhooksOnMemberRemovedMethod) + } + if params != nil && params.LimitsChannelMembers != nil { + data.Set("Limits.ChannelMembers", fmt.Sprint(*params.LimitsChannelMembers)) + } + if params != nil && params.LimitsUserChannels != nil { + data.Set("Limits.UserChannels", fmt.Sprint(*params.LimitsUserChannels)) } -} -if params != nil && params.WebhooksOnMessageSendUrl != nil { - data.Set("Webhooks.OnMessageSend.Url", *params.WebhooksOnMessageSendUrl) -} -if params != nil && params.WebhooksOnMessageSendMethod != nil { - data.Set("Webhooks.OnMessageSend.Method", *params.WebhooksOnMessageSendMethod) -} -if params != nil && params.WebhooksOnMessageUpdateUrl != nil { - data.Set("Webhooks.OnMessageUpdate.Url", *params.WebhooksOnMessageUpdateUrl) -} -if params != nil && params.WebhooksOnMessageUpdateMethod != nil { - data.Set("Webhooks.OnMessageUpdate.Method", *params.WebhooksOnMessageUpdateMethod) -} -if params != nil && params.WebhooksOnMessageRemoveUrl != nil { - data.Set("Webhooks.OnMessageRemove.Url", *params.WebhooksOnMessageRemoveUrl) -} -if params != nil && params.WebhooksOnMessageRemoveMethod != nil { - data.Set("Webhooks.OnMessageRemove.Method", *params.WebhooksOnMessageRemoveMethod) -} -if params != nil && params.WebhooksOnChannelAddUrl != nil { - data.Set("Webhooks.OnChannelAdd.Url", *params.WebhooksOnChannelAddUrl) -} -if params != nil && params.WebhooksOnChannelAddMethod != nil { - data.Set("Webhooks.OnChannelAdd.Method", *params.WebhooksOnChannelAddMethod) -} -if params != nil && params.WebhooksOnChannelDestroyUrl != nil { - data.Set("Webhooks.OnChannelDestroy.Url", *params.WebhooksOnChannelDestroyUrl) -} -if params != nil && params.WebhooksOnChannelDestroyMethod != nil { - data.Set("Webhooks.OnChannelDestroy.Method", *params.WebhooksOnChannelDestroyMethod) -} -if params != nil && params.WebhooksOnChannelUpdateUrl != nil { - data.Set("Webhooks.OnChannelUpdate.Url", *params.WebhooksOnChannelUpdateUrl) -} -if params != nil && params.WebhooksOnChannelUpdateMethod != nil { - data.Set("Webhooks.OnChannelUpdate.Method", *params.WebhooksOnChannelUpdateMethod) -} -if params != nil && params.WebhooksOnMemberAddUrl != nil { - data.Set("Webhooks.OnMemberAdd.Url", *params.WebhooksOnMemberAddUrl) -} -if params != nil && params.WebhooksOnMemberAddMethod != nil { - data.Set("Webhooks.OnMemberAdd.Method", *params.WebhooksOnMemberAddMethod) -} -if params != nil && params.WebhooksOnMemberRemoveUrl != nil { - data.Set("Webhooks.OnMemberRemove.Url", *params.WebhooksOnMemberRemoveUrl) -} -if params != nil && params.WebhooksOnMemberRemoveMethod != nil { - data.Set("Webhooks.OnMemberRemove.Method", *params.WebhooksOnMemberRemoveMethod) -} -if params != nil && params.WebhooksOnMessageSentUrl != nil { - data.Set("Webhooks.OnMessageSent.Url", *params.WebhooksOnMessageSentUrl) -} -if params != nil && params.WebhooksOnMessageSentMethod != nil { - data.Set("Webhooks.OnMessageSent.Method", *params.WebhooksOnMessageSentMethod) -} -if params != nil && params.WebhooksOnMessageUpdatedUrl != nil { - data.Set("Webhooks.OnMessageUpdated.Url", *params.WebhooksOnMessageUpdatedUrl) -} -if params != nil && params.WebhooksOnMessageUpdatedMethod != nil { - data.Set("Webhooks.OnMessageUpdated.Method", *params.WebhooksOnMessageUpdatedMethod) -} -if params != nil && params.WebhooksOnMessageRemovedUrl != nil { - data.Set("Webhooks.OnMessageRemoved.Url", *params.WebhooksOnMessageRemovedUrl) -} -if params != nil && params.WebhooksOnMessageRemovedMethod != nil { - data.Set("Webhooks.OnMessageRemoved.Method", *params.WebhooksOnMessageRemovedMethod) -} -if params != nil && params.WebhooksOnChannelAddedUrl != nil { - data.Set("Webhooks.OnChannelAdded.Url", *params.WebhooksOnChannelAddedUrl) -} -if params != nil && params.WebhooksOnChannelAddedMethod != nil { - data.Set("Webhooks.OnChannelAdded.Method", *params.WebhooksOnChannelAddedMethod) -} -if params != nil && params.WebhooksOnChannelDestroyedUrl != nil { - data.Set("Webhooks.OnChannelDestroyed.Url", *params.WebhooksOnChannelDestroyedUrl) -} -if params != nil && params.WebhooksOnChannelDestroyedMethod != nil { - data.Set("Webhooks.OnChannelDestroyed.Method", *params.WebhooksOnChannelDestroyedMethod) -} -if params != nil && params.WebhooksOnChannelUpdatedUrl != nil { - data.Set("Webhooks.OnChannelUpdated.Url", *params.WebhooksOnChannelUpdatedUrl) -} -if params != nil && params.WebhooksOnChannelUpdatedMethod != nil { - data.Set("Webhooks.OnChannelUpdated.Method", *params.WebhooksOnChannelUpdatedMethod) -} -if params != nil && params.WebhooksOnMemberAddedUrl != nil { - data.Set("Webhooks.OnMemberAdded.Url", *params.WebhooksOnMemberAddedUrl) -} -if params != nil && params.WebhooksOnMemberAddedMethod != nil { - data.Set("Webhooks.OnMemberAdded.Method", *params.WebhooksOnMemberAddedMethod) -} -if params != nil && params.WebhooksOnMemberRemovedUrl != nil { - data.Set("Webhooks.OnMemberRemoved.Url", *params.WebhooksOnMemberRemovedUrl) -} -if params != nil && params.WebhooksOnMemberRemovedMethod != nil { - data.Set("Webhooks.OnMemberRemoved.Method", *params.WebhooksOnMemberRemovedMethod) -} -if params != nil && params.LimitsChannelMembers != nil { - data.Set("Limits.ChannelMembers", fmt.Sprint(*params.LimitsChannelMembers)) -} -if params != nil && params.LimitsUserChannels != nil { - data.Set("Limits.UserChannels", fmt.Sprint(*params.LimitsUserChannels)) -} diff --git a/rest/ip_messaging/v1/services_channels.go b/rest/ip_messaging/v1/services_channels.go index c67e61504..a9c61d662 100644 --- a/rest/ip_messaging/v1/services_channels.go +++ b/rest/ip_messaging/v1/services_channels.go @@ -59,18 +59,19 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam 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) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } @@ -100,6 +101,7 @@ func (c *ApiService) DeleteChannel(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -121,6 +123,7 @@ func (c *ApiService) FetchChannel(ServiceSid string, Sid string, ) (*IpMessaging + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -167,14 +170,15 @@ func (c *ApiService) PageChannel(ServiceSid string, params *ListChannelParams, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Type != nil { - for _, item := range *params.Type { - data.Add("Type", item) + + if params != nil && params.Type != nil { + for _, item := range *params.Type { + data.Add("Type", item) + } + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) } -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} if pageToken != "" { data.Set("PageToken", pageToken) @@ -317,15 +321,16 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update 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) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } diff --git a/rest/ip_messaging/v1/services_channels_invites.go b/rest/ip_messaging/v1/services_channels_invites.go index 890da5199..0e3630f9b 100644 --- a/rest/ip_messaging/v1/services_channels_invites.go +++ b/rest/ip_messaging/v1/services_channels_invites.go @@ -48,12 +48,13 @@ func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params * 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) -} + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } @@ -84,6 +85,7 @@ func (c *ApiService) DeleteInvite(ServiceSid string, ChannelSid string, Sid stri + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -106,6 +108,7 @@ func (c *ApiService) FetchInvite(ServiceSid string, ChannelSid string, Sid strin + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -153,14 +156,15 @@ func (c *ApiService) PageInvite(ServiceSid string, ChannelSid string, params *Li data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Identity != nil { - for _, item := range *params.Identity { - data.Add("Identity", item) + + if params != nil && params.Identity != nil { + for _, item := range *params.Identity { + data.Add("Identity", item) + } + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) } -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/ip_messaging/v1/services_channels_members.go b/rest/ip_messaging/v1/services_channels_members.go index 0aa2811a1..13f1ee719 100644 --- a/rest/ip_messaging/v1/services_channels_members.go +++ b/rest/ip_messaging/v1/services_channels_members.go @@ -48,12 +48,13 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * 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) -} + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } @@ -84,6 +85,7 @@ func (c *ApiService) DeleteMember(ServiceSid string, ChannelSid string, Sid stri + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -106,6 +108,7 @@ func (c *ApiService) FetchMember(ServiceSid string, ChannelSid string, Sid strin + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -153,14 +156,15 @@ func (c *ApiService) PageMember(ServiceSid string, ChannelSid string, params *Li data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Identity != nil { - for _, item := range *params.Identity { - data.Add("Identity", item) + + if params != nil && params.Identity != nil { + for _, item := range *params.Identity { + data.Add("Identity", item) + } + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) } -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} if pageToken != "" { data.Set("PageToken", pageToken) @@ -298,12 +302,13 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.RoleSid != nil { - data.Set("RoleSid", *params.RoleSid) -} -if params != nil && params.LastConsumedMessageIndex != nil { - data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) -} + + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } + if params != nil && params.LastConsumedMessageIndex != nil { + data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) + } diff --git a/rest/ip_messaging/v1/services_channels_messages.go b/rest/ip_messaging/v1/services_channels_messages.go index 8a141a909..7b9994477 100644 --- a/rest/ip_messaging/v1/services_channels_messages.go +++ b/rest/ip_messaging/v1/services_channels_messages.go @@ -54,15 +54,16 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Body != nil { - data.Set("Body", *params.Body) -} -if params != nil && params.From != nil { - data.Set("From", *params.From) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} + + if params != nil && params.Body != nil { + data.Set("Body", *params.Body) + } + if params != nil && params.From != nil { + data.Set("From", *params.From) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } @@ -93,6 +94,7 @@ func (c *ApiService) DeleteMessage(ServiceSid string, ChannelSid string, Sid str + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -115,6 +117,7 @@ func (c *ApiService) FetchMessage(ServiceSid string, ChannelSid string, Sid stri + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -162,12 +165,13 @@ func (c *ApiService) PageMessage(ServiceSid string, ChannelSid string, params *L 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)) -} + + if params != nil && params.Order != nil { + data.Set("Order", *params.Order) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -305,12 +309,13 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Body != nil { - data.Set("Body", *params.Body) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} + + if params != nil && params.Body != nil { + data.Set("Body", *params.Body) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } diff --git a/rest/ip_messaging/v1/services_roles.go b/rest/ip_messaging/v1/services_roles.go index 5271aaa83..7b7547bbb 100644 --- a/rest/ip_messaging/v1/services_roles.go +++ b/rest/ip_messaging/v1/services_roles.go @@ -53,17 +53,18 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*I data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.Permission != nil { - for _, item := range *params.Permission { - data.Add("Permission", item) + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } + if params != nil && params.Permission != nil { + for _, item := range *params.Permission { + data.Add("Permission", item) + } } -} @@ -93,6 +94,7 @@ func (c *ApiService) DeleteRole(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -114,6 +116,7 @@ func (c *ApiService) FetchRole(ServiceSid string, Sid string, ) (*IpMessagingV1R + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -154,9 +157,10 @@ func (c *ApiService) PageRole(ServiceSid string, params *ListRoleParams, pageTok data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -287,11 +291,12 @@ func (c *ApiService) UpdateRole(ServiceSid string, Sid string, params *UpdateRol data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Permission != nil { - for _, item := range *params.Permission { - data.Add("Permission", item) + + if params != nil && params.Permission != nil { + for _, item := range *params.Permission { + data.Add("Permission", item) + } } -} diff --git a/rest/ip_messaging/v1/services_users.go b/rest/ip_messaging/v1/services_users.go index f82f106ee..be2d3a3e1 100644 --- a/rest/ip_messaging/v1/services_users.go +++ b/rest/ip_messaging/v1/services_users.go @@ -59,18 +59,19 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*I 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) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } @@ -100,6 +101,7 @@ func (c *ApiService) DeleteUser(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -121,6 +123,7 @@ func (c *ApiService) FetchUser(ServiceSid string, Sid string, ) (*IpMessagingV1U + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -161,9 +164,10 @@ func (c *ApiService) PageUser(ServiceSid string, params *ListUserParams, pageTok data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -306,15 +310,16 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.RoleSid != nil { - data.Set("RoleSid", *params.RoleSid) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } diff --git a/rest/ip_messaging/v1/services_users_channels.go b/rest/ip_messaging/v1/services_users_channels.go index 4b26b26c4..9cc8db2af 100644 --- a/rest/ip_messaging/v1/services_users_channels.go +++ b/rest/ip_messaging/v1/services_users_channels.go @@ -49,9 +49,10 @@ func (c *ApiService) PageUserChannel(ServiceSid string, UserSid string, params * data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/ip_messaging/v2/credentials.go b/rest/ip_messaging/v2/credentials.go index 0a7291aef..b09eb19cb 100644 --- a/rest/ip_messaging/v2/credentials.go +++ b/rest/ip_messaging/v2/credentials.go @@ -76,27 +76,28 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*IpMessag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Certificate != nil { - data.Set("Certificate", *params.Certificate) -} -if params != nil && params.PrivateKey != nil { - data.Set("PrivateKey", *params.PrivateKey) -} -if params != nil && params.Sandbox != nil { - data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) -} -if params != nil && params.ApiKey != nil { - data.Set("ApiKey", *params.ApiKey) -} -if params != nil && params.Secret != nil { - data.Set("Secret", *params.Secret) -} + + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Certificate != nil { + data.Set("Certificate", *params.Certificate) + } + if params != nil && params.PrivateKey != nil { + data.Set("PrivateKey", *params.PrivateKey) + } + if params != nil && params.Sandbox != nil { + data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) + } + if params != nil && params.ApiKey != nil { + data.Set("ApiKey", *params.ApiKey) + } + if params != nil && params.Secret != nil { + data.Set("Secret", *params.Secret) + } @@ -125,6 +126,7 @@ func (c *ApiService) DeleteCredential(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -145,6 +147,7 @@ func (c *ApiService) FetchCredential(Sid string, ) (*IpMessagingV2Credential, er + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -184,9 +187,10 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken, pag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -346,24 +350,25 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Certificate != nil { - data.Set("Certificate", *params.Certificate) -} -if params != nil && params.PrivateKey != nil { - data.Set("PrivateKey", *params.PrivateKey) -} -if params != nil && params.Sandbox != nil { - data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) -} -if params != nil && params.ApiKey != nil { - data.Set("ApiKey", *params.ApiKey) -} -if params != nil && params.Secret != nil { - data.Set("Secret", *params.Secret) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Certificate != nil { + data.Set("Certificate", *params.Certificate) + } + if params != nil && params.PrivateKey != nil { + data.Set("PrivateKey", *params.PrivateKey) + } + if params != nil && params.Sandbox != nil { + data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) + } + if params != nil && params.ApiKey != nil { + data.Set("ApiKey", *params.ApiKey) + } + if params != nil && params.Secret != nil { + data.Set("Secret", *params.Secret) + } diff --git a/rest/ip_messaging/v2/services.go b/rest/ip_messaging/v2/services.go index d9dc34999..678fd5601 100644 --- a/rest/ip_messaging/v2/services.go +++ b/rest/ip_messaging/v2/services.go @@ -40,9 +40,10 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*IpMessagingV2S data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } @@ -71,6 +72,7 @@ func (c *ApiService) DeleteService(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -91,6 +93,7 @@ func (c *ApiService) FetchService(Sid string, ) (*IpMessagingV2Service, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -130,9 +133,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -442,101 +446,102 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ip data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.DefaultServiceRoleSid != nil { - data.Set("DefaultServiceRoleSid", *params.DefaultServiceRoleSid) -} -if params != nil && params.DefaultChannelRoleSid != nil { - data.Set("DefaultChannelRoleSid", *params.DefaultChannelRoleSid) -} -if params != nil && params.DefaultChannelCreatorRoleSid != nil { - data.Set("DefaultChannelCreatorRoleSid", *params.DefaultChannelCreatorRoleSid) -} -if params != nil && params.ReadStatusEnabled != nil { - data.Set("ReadStatusEnabled", fmt.Sprint(*params.ReadStatusEnabled)) -} -if params != nil && params.ReachabilityEnabled != nil { - data.Set("ReachabilityEnabled", fmt.Sprint(*params.ReachabilityEnabled)) -} -if params != nil && params.TypingIndicatorTimeout != nil { - data.Set("TypingIndicatorTimeout", fmt.Sprint(*params.TypingIndicatorTimeout)) -} -if params != nil && params.ConsumptionReportInterval != nil { - data.Set("ConsumptionReportInterval", fmt.Sprint(*params.ConsumptionReportInterval)) -} -if params != nil && params.NotificationsNewMessageEnabled != nil { - data.Set("Notifications.NewMessage.Enabled", fmt.Sprint(*params.NotificationsNewMessageEnabled)) -} -if params != nil && params.NotificationsNewMessageTemplate != nil { - data.Set("Notifications.NewMessage.Template", *params.NotificationsNewMessageTemplate) -} -if params != nil && params.NotificationsNewMessageSound != nil { - data.Set("Notifications.NewMessage.Sound", *params.NotificationsNewMessageSound) -} -if params != nil && params.NotificationsNewMessageBadgeCountEnabled != nil { - data.Set("Notifications.NewMessage.BadgeCountEnabled", fmt.Sprint(*params.NotificationsNewMessageBadgeCountEnabled)) -} -if params != nil && params.NotificationsAddedToChannelEnabled != nil { - data.Set("Notifications.AddedToChannel.Enabled", fmt.Sprint(*params.NotificationsAddedToChannelEnabled)) -} -if params != nil && params.NotificationsAddedToChannelTemplate != nil { - data.Set("Notifications.AddedToChannel.Template", *params.NotificationsAddedToChannelTemplate) -} -if params != nil && params.NotificationsAddedToChannelSound != nil { - data.Set("Notifications.AddedToChannel.Sound", *params.NotificationsAddedToChannelSound) -} -if params != nil && params.NotificationsRemovedFromChannelEnabled != nil { - data.Set("Notifications.RemovedFromChannel.Enabled", fmt.Sprint(*params.NotificationsRemovedFromChannelEnabled)) -} -if params != nil && params.NotificationsRemovedFromChannelTemplate != nil { - data.Set("Notifications.RemovedFromChannel.Template", *params.NotificationsRemovedFromChannelTemplate) -} -if params != nil && params.NotificationsRemovedFromChannelSound != nil { - data.Set("Notifications.RemovedFromChannel.Sound", *params.NotificationsRemovedFromChannelSound) -} -if params != nil && params.NotificationsInvitedToChannelEnabled != nil { - data.Set("Notifications.InvitedToChannel.Enabled", fmt.Sprint(*params.NotificationsInvitedToChannelEnabled)) -} -if params != nil && params.NotificationsInvitedToChannelTemplate != nil { - data.Set("Notifications.InvitedToChannel.Template", *params.NotificationsInvitedToChannelTemplate) -} -if params != nil && params.NotificationsInvitedToChannelSound != nil { - data.Set("Notifications.InvitedToChannel.Sound", *params.NotificationsInvitedToChannelSound) -} -if params != nil && params.PreWebhookUrl != nil { - data.Set("PreWebhookUrl", *params.PreWebhookUrl) -} -if params != nil && params.PostWebhookUrl != nil { - data.Set("PostWebhookUrl", *params.PostWebhookUrl) -} -if params != nil && params.WebhookMethod != nil { - data.Set("WebhookMethod", *params.WebhookMethod) -} -if params != nil && params.WebhookFilters != nil { - for _, item := range *params.WebhookFilters { - data.Add("WebhookFilters", item) + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.DefaultServiceRoleSid != nil { + data.Set("DefaultServiceRoleSid", *params.DefaultServiceRoleSid) + } + if params != nil && params.DefaultChannelRoleSid != nil { + data.Set("DefaultChannelRoleSid", *params.DefaultChannelRoleSid) + } + if params != nil && params.DefaultChannelCreatorRoleSid != nil { + data.Set("DefaultChannelCreatorRoleSid", *params.DefaultChannelCreatorRoleSid) + } + if params != nil && params.ReadStatusEnabled != nil { + data.Set("ReadStatusEnabled", fmt.Sprint(*params.ReadStatusEnabled)) + } + if params != nil && params.ReachabilityEnabled != nil { + data.Set("ReachabilityEnabled", fmt.Sprint(*params.ReachabilityEnabled)) + } + if params != nil && params.TypingIndicatorTimeout != nil { + data.Set("TypingIndicatorTimeout", fmt.Sprint(*params.TypingIndicatorTimeout)) + } + if params != nil && params.ConsumptionReportInterval != nil { + data.Set("ConsumptionReportInterval", fmt.Sprint(*params.ConsumptionReportInterval)) + } + if params != nil && params.NotificationsNewMessageEnabled != nil { + data.Set("Notifications.NewMessage.Enabled", fmt.Sprint(*params.NotificationsNewMessageEnabled)) + } + if params != nil && params.NotificationsNewMessageTemplate != nil { + data.Set("Notifications.NewMessage.Template", *params.NotificationsNewMessageTemplate) + } + if params != nil && params.NotificationsNewMessageSound != nil { + data.Set("Notifications.NewMessage.Sound", *params.NotificationsNewMessageSound) + } + if params != nil && params.NotificationsNewMessageBadgeCountEnabled != nil { + data.Set("Notifications.NewMessage.BadgeCountEnabled", fmt.Sprint(*params.NotificationsNewMessageBadgeCountEnabled)) + } + if params != nil && params.NotificationsAddedToChannelEnabled != nil { + data.Set("Notifications.AddedToChannel.Enabled", fmt.Sprint(*params.NotificationsAddedToChannelEnabled)) + } + if params != nil && params.NotificationsAddedToChannelTemplate != nil { + data.Set("Notifications.AddedToChannel.Template", *params.NotificationsAddedToChannelTemplate) + } + if params != nil && params.NotificationsAddedToChannelSound != nil { + data.Set("Notifications.AddedToChannel.Sound", *params.NotificationsAddedToChannelSound) + } + if params != nil && params.NotificationsRemovedFromChannelEnabled != nil { + data.Set("Notifications.RemovedFromChannel.Enabled", fmt.Sprint(*params.NotificationsRemovedFromChannelEnabled)) + } + if params != nil && params.NotificationsRemovedFromChannelTemplate != nil { + data.Set("Notifications.RemovedFromChannel.Template", *params.NotificationsRemovedFromChannelTemplate) + } + if params != nil && params.NotificationsRemovedFromChannelSound != nil { + data.Set("Notifications.RemovedFromChannel.Sound", *params.NotificationsRemovedFromChannelSound) + } + if params != nil && params.NotificationsInvitedToChannelEnabled != nil { + data.Set("Notifications.InvitedToChannel.Enabled", fmt.Sprint(*params.NotificationsInvitedToChannelEnabled)) + } + if params != nil && params.NotificationsInvitedToChannelTemplate != nil { + data.Set("Notifications.InvitedToChannel.Template", *params.NotificationsInvitedToChannelTemplate) + } + if params != nil && params.NotificationsInvitedToChannelSound != nil { + data.Set("Notifications.InvitedToChannel.Sound", *params.NotificationsInvitedToChannelSound) + } + if params != nil && params.PreWebhookUrl != nil { + data.Set("PreWebhookUrl", *params.PreWebhookUrl) + } + if params != nil && params.PostWebhookUrl != nil { + data.Set("PostWebhookUrl", *params.PostWebhookUrl) + } + if params != nil && params.WebhookMethod != nil { + data.Set("WebhookMethod", *params.WebhookMethod) + } + if params != nil && params.WebhookFilters != nil { + for _, item := range *params.WebhookFilters { + data.Add("WebhookFilters", item) + } + } + if params != nil && params.LimitsChannelMembers != nil { + data.Set("Limits.ChannelMembers", fmt.Sprint(*params.LimitsChannelMembers)) + } + if params != nil && params.LimitsUserChannels != nil { + data.Set("Limits.UserChannels", fmt.Sprint(*params.LimitsUserChannels)) + } + if params != nil && params.MediaCompatibilityMessage != nil { + data.Set("Media.CompatibilityMessage", *params.MediaCompatibilityMessage) + } + if params != nil && params.PreWebhookRetryCount != nil { + data.Set("PreWebhookRetryCount", fmt.Sprint(*params.PreWebhookRetryCount)) + } + if params != nil && params.PostWebhookRetryCount != nil { + data.Set("PostWebhookRetryCount", fmt.Sprint(*params.PostWebhookRetryCount)) + } + if params != nil && params.NotificationsLogEnabled != nil { + data.Set("Notifications.LogEnabled", fmt.Sprint(*params.NotificationsLogEnabled)) } -} -if params != nil && params.LimitsChannelMembers != nil { - data.Set("Limits.ChannelMembers", fmt.Sprint(*params.LimitsChannelMembers)) -} -if params != nil && params.LimitsUserChannels != nil { - data.Set("Limits.UserChannels", fmt.Sprint(*params.LimitsUserChannels)) -} -if params != nil && params.MediaCompatibilityMessage != nil { - data.Set("Media.CompatibilityMessage", *params.MediaCompatibilityMessage) -} -if params != nil && params.PreWebhookRetryCount != nil { - data.Set("PreWebhookRetryCount", fmt.Sprint(*params.PreWebhookRetryCount)) -} -if params != nil && params.PostWebhookRetryCount != nil { - data.Set("PostWebhookRetryCount", fmt.Sprint(*params.PostWebhookRetryCount)) -} -if params != nil && params.NotificationsLogEnabled != nil { - data.Set("Notifications.LogEnabled", fmt.Sprint(*params.NotificationsLogEnabled)) -} diff --git a/rest/ip_messaging/v2/services_bindings.go b/rest/ip_messaging/v2/services_bindings.go index 0a1253759..7e3db6e04 100644 --- a/rest/ip_messaging/v2/services_bindings.go +++ b/rest/ip_messaging/v2/services_bindings.go @@ -34,6 +34,7 @@ func (c *ApiService) DeleteBinding(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -55,6 +56,7 @@ func (c *ApiService) FetchBinding(ServiceSid string, Sid string, ) (*IpMessaging + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -107,19 +109,20 @@ func (c *ApiService) PageBinding(ServiceSid string, params *ListBindingParams, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.BindingType != nil { - for _, item := range *params.BindingType { - data.Add("BindingType", item) + + if params != nil && params.BindingType != nil { + for _, item := range *params.BindingType { + data.Add("BindingType", item) } -} -if params != nil && params.Identity != nil { - for _, item := range *params.Identity { - data.Add("Identity", item) } -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + if params != nil && params.Identity != nil { + for _, item := range *params.Identity { + data.Add("Identity", item) + } + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/ip_messaging/v2/services_channels.go b/rest/ip_messaging/v2/services_channels.go index d322585af..2d13f79f3 100644 --- a/rest/ip_messaging/v2/services_channels.go +++ b/rest/ip_messaging/v2/services_channels.go @@ -83,27 +83,28 @@ func (c *ApiService) CreateChannel(ServiceSid string, params *CreateChannelParam 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) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.CreatedBy != nil { - data.Set("CreatedBy", *params.CreatedBy) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.CreatedBy != nil { + data.Set("CreatedBy", *params.CreatedBy) + } if params != nil && params.XTwilioWebhookEnabled != nil { @@ -146,6 +147,7 @@ func (c *ApiService) DeleteChannel(ServiceSid string, Sid string, params *Delete headers := make(map[string]interface{}) + if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -171,6 +173,7 @@ func (c *ApiService) FetchChannel(ServiceSid string, Sid string, ) (*IpMessaging + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -217,14 +220,15 @@ func (c *ApiService) PageChannel(ServiceSid string, params *ListChannelParams, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Type != nil { - for _, item := range *params.Type { - data.Add("Type", item) + + if params != nil && params.Type != nil { + for _, item := range *params.Type { + data.Add("Type", item) + } + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) } -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} if pageToken != "" { data.Set("PageToken", pageToken) @@ -391,24 +395,25 @@ func (c *ApiService) UpdateChannel(ServiceSid string, Sid string, params *Update 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) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.CreatedBy != nil { - data.Set("CreatedBy", *params.CreatedBy) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.CreatedBy != nil { + data.Set("CreatedBy", *params.CreatedBy) + } if params != nil && params.XTwilioWebhookEnabled != nil { diff --git a/rest/ip_messaging/v2/services_channels_invites.go b/rest/ip_messaging/v2/services_channels_invites.go index 879820613..3ea3df8d7 100644 --- a/rest/ip_messaging/v2/services_channels_invites.go +++ b/rest/ip_messaging/v2/services_channels_invites.go @@ -48,12 +48,13 @@ func (c *ApiService) CreateInvite(ServiceSid string, ChannelSid string, params * 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) -} + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } @@ -84,6 +85,7 @@ func (c *ApiService) DeleteInvite(ServiceSid string, ChannelSid string, Sid stri + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -106,6 +108,7 @@ func (c *ApiService) FetchInvite(ServiceSid string, ChannelSid string, Sid strin + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -153,14 +156,15 @@ func (c *ApiService) PageInvite(ServiceSid string, ChannelSid string, params *Li data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Identity != nil { - for _, item := range *params.Identity { - data.Add("Identity", item) + + if params != nil && params.Identity != nil { + for _, item := range *params.Identity { + data.Add("Identity", item) + } + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) } -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/ip_messaging/v2/services_channels_members.go b/rest/ip_messaging/v2/services_channels_members.go index f724a9889..199835399 100644 --- a/rest/ip_messaging/v2/services_channels_members.go +++ b/rest/ip_messaging/v2/services_channels_members.go @@ -84,27 +84,28 @@ func (c *ApiService) CreateMember(ServiceSid string, ChannelSid string, params * 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) -} -if params != nil && params.LastConsumedMessageIndex != nil { - data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) -} -if params != nil && params.LastConsumptionTimestamp != nil { - data.Set("LastConsumptionTimestamp", fmt.Sprint((*params.LastConsumptionTimestamp).Format(time.RFC3339))) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } + if params != nil && params.LastConsumedMessageIndex != nil { + data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) + } + if params != nil && params.LastConsumptionTimestamp != nil { + data.Set("LastConsumptionTimestamp", fmt.Sprint((*params.LastConsumptionTimestamp).Format(time.RFC3339))) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } if params != nil && params.XTwilioWebhookEnabled != nil { @@ -148,6 +149,7 @@ func (c *ApiService) DeleteMember(ServiceSid string, ChannelSid string, Sid stri headers := make(map[string]interface{}) + if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -174,6 +176,7 @@ func (c *ApiService) FetchMember(ServiceSid string, ChannelSid string, Sid strin + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -221,14 +224,15 @@ func (c *ApiService) PageMember(ServiceSid string, ChannelSid string, params *Li data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Identity != nil { - for _, item := range *params.Identity { - data.Add("Identity", item) + + if params != nil && params.Identity != nil { + for _, item := range *params.Identity { + data.Add("Identity", item) + } + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) } -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} if pageToken != "" { data.Set("PageToken", pageToken) @@ -396,24 +400,25 @@ func (c *ApiService) UpdateMember(ServiceSid string, ChannelSid string, Sid stri data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.RoleSid != nil { - data.Set("RoleSid", *params.RoleSid) -} -if params != nil && params.LastConsumedMessageIndex != nil { - data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) -} -if params != nil && params.LastConsumptionTimestamp != nil { - data.Set("LastConsumptionTimestamp", fmt.Sprint((*params.LastConsumptionTimestamp).Format(time.RFC3339))) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} + + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } + if params != nil && params.LastConsumedMessageIndex != nil { + data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) + } + if params != nil && params.LastConsumptionTimestamp != nil { + data.Set("LastConsumptionTimestamp", fmt.Sprint((*params.LastConsumptionTimestamp).Format(time.RFC3339))) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } if params != nil && params.XTwilioWebhookEnabled != nil { diff --git a/rest/ip_messaging/v2/services_channels_messages.go b/rest/ip_messaging/v2/services_channels_messages.go index e7beddff9..3196e4397 100644 --- a/rest/ip_messaging/v2/services_channels_messages.go +++ b/rest/ip_messaging/v2/services_channels_messages.go @@ -84,27 +84,28 @@ func (c *ApiService) CreateMessage(ServiceSid string, ChannelSid string, params data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.From != nil { - data.Set("From", *params.From) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.LastUpdatedBy != nil { - data.Set("LastUpdatedBy", *params.LastUpdatedBy) -} -if params != nil && params.Body != nil { - data.Set("Body", *params.Body) -} -if params != nil && params.MediaSid != nil { - data.Set("MediaSid", *params.MediaSid) -} + + if params != nil && params.From != nil { + data.Set("From", *params.From) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.LastUpdatedBy != nil { + data.Set("LastUpdatedBy", *params.LastUpdatedBy) + } + if params != nil && params.Body != nil { + data.Set("Body", *params.Body) + } + if params != nil && params.MediaSid != nil { + data.Set("MediaSid", *params.MediaSid) + } if params != nil && params.XTwilioWebhookEnabled != nil { @@ -148,6 +149,7 @@ func (c *ApiService) DeleteMessage(ServiceSid string, ChannelSid string, Sid str headers := make(map[string]interface{}) + if params != nil && params.XTwilioWebhookEnabled != nil { headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled } @@ -174,6 +176,7 @@ func (c *ApiService) FetchMessage(ServiceSid string, ChannelSid string, Sid stri + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -221,12 +224,13 @@ func (c *ApiService) PageMessage(ServiceSid string, ChannelSid string, params *L 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)) -} + + if params != nil && params.Order != nil { + data.Set("Order", *params.Order) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -394,24 +398,25 @@ func (c *ApiService) UpdateMessage(ServiceSid string, ChannelSid string, Sid str data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Body != nil { - data.Set("Body", *params.Body) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.DateCreated != nil { - data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) -} -if params != nil && params.DateUpdated != nil { - data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) -} -if params != nil && params.LastUpdatedBy != nil { - data.Set("LastUpdatedBy", *params.LastUpdatedBy) -} -if params != nil && params.From != nil { - data.Set("From", *params.From) -} + + if params != nil && params.Body != nil { + data.Set("Body", *params.Body) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.DateCreated != nil { + data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339))) + } + if params != nil && params.DateUpdated != nil { + data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339))) + } + if params != nil && params.LastUpdatedBy != nil { + data.Set("LastUpdatedBy", *params.LastUpdatedBy) + } + if params != nil && params.From != nil { + data.Set("From", *params.From) + } if params != nil && params.XTwilioWebhookEnabled != nil { diff --git a/rest/ip_messaging/v2/services_channels_webhooks.go b/rest/ip_messaging/v2/services_channels_webhooks.go index ad610a027..330d7b8d2 100644 --- a/rest/ip_messaging/v2/services_channels_webhooks.go +++ b/rest/ip_messaging/v2/services_channels_webhooks.go @@ -78,31 +78,32 @@ func (c *ApiService) CreateChannelWebhook(ServiceSid string, ChannelSid string, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.ConfigurationUrl != nil { - data.Set("Configuration.Url", *params.ConfigurationUrl) -} -if params != nil && params.ConfigurationMethod != nil { - data.Set("Configuration.Method", *params.ConfigurationMethod) -} -if params != nil && params.ConfigurationFilters != nil { - for _, item := range *params.ConfigurationFilters { - data.Add("Configuration.Filters", item) + + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) } -} -if params != nil && params.ConfigurationTriggers != nil { - for _, item := range *params.ConfigurationTriggers { - data.Add("Configuration.Triggers", item) + if params != nil && params.ConfigurationUrl != nil { + data.Set("Configuration.Url", *params.ConfigurationUrl) + } + if params != nil && params.ConfigurationMethod != nil { + data.Set("Configuration.Method", *params.ConfigurationMethod) + } + if params != nil && params.ConfigurationFilters != nil { + for _, item := range *params.ConfigurationFilters { + data.Add("Configuration.Filters", item) + } + } + if params != nil && params.ConfigurationTriggers != nil { + for _, item := range *params.ConfigurationTriggers { + data.Add("Configuration.Triggers", item) + } + } + if params != nil && params.ConfigurationFlowSid != nil { + data.Set("Configuration.FlowSid", *params.ConfigurationFlowSid) + } + if params != nil && params.ConfigurationRetryCount != nil { + data.Set("Configuration.RetryCount", fmt.Sprint(*params.ConfigurationRetryCount)) } -} -if params != nil && params.ConfigurationFlowSid != nil { - data.Set("Configuration.FlowSid", *params.ConfigurationFlowSid) -} -if params != nil && params.ConfigurationRetryCount != nil { - data.Set("Configuration.RetryCount", fmt.Sprint(*params.ConfigurationRetryCount)) -} @@ -133,6 +134,7 @@ func (c *ApiService) DeleteChannelWebhook(ServiceSid string, ChannelSid string, + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -155,6 +157,7 @@ func (c *ApiService) FetchChannelWebhook(ServiceSid string, ChannelSid string, S + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -196,9 +199,10 @@ func (c *ApiService) PageChannelWebhook(ServiceSid string, ChannelSid string, pa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -360,28 +364,29 @@ func (c *ApiService) UpdateChannelWebhook(ServiceSid string, ChannelSid string, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ConfigurationUrl != nil { - data.Set("Configuration.Url", *params.ConfigurationUrl) -} -if params != nil && params.ConfigurationMethod != nil { - data.Set("Configuration.Method", *params.ConfigurationMethod) -} -if params != nil && params.ConfigurationFilters != nil { - for _, item := range *params.ConfigurationFilters { - data.Add("Configuration.Filters", item) + + if params != nil && params.ConfigurationUrl != nil { + data.Set("Configuration.Url", *params.ConfigurationUrl) } -} -if params != nil && params.ConfigurationTriggers != nil { - for _, item := range *params.ConfigurationTriggers { - data.Add("Configuration.Triggers", item) + if params != nil && params.ConfigurationMethod != nil { + data.Set("Configuration.Method", *params.ConfigurationMethod) + } + if params != nil && params.ConfigurationFilters != nil { + for _, item := range *params.ConfigurationFilters { + data.Add("Configuration.Filters", item) + } + } + if params != nil && params.ConfigurationTriggers != nil { + for _, item := range *params.ConfigurationTriggers { + data.Add("Configuration.Triggers", item) + } + } + if params != nil && params.ConfigurationFlowSid != nil { + data.Set("Configuration.FlowSid", *params.ConfigurationFlowSid) + } + if params != nil && params.ConfigurationRetryCount != nil { + data.Set("Configuration.RetryCount", fmt.Sprint(*params.ConfigurationRetryCount)) } -} -if params != nil && params.ConfigurationFlowSid != nil { - data.Set("Configuration.FlowSid", *params.ConfigurationFlowSid) -} -if params != nil && params.ConfigurationRetryCount != nil { - data.Set("Configuration.RetryCount", fmt.Sprint(*params.ConfigurationRetryCount)) -} diff --git a/rest/ip_messaging/v2/services_roles.go b/rest/ip_messaging/v2/services_roles.go index 90f0e13d8..dff8c4c64 100644 --- a/rest/ip_messaging/v2/services_roles.go +++ b/rest/ip_messaging/v2/services_roles.go @@ -53,17 +53,18 @@ func (c *ApiService) CreateRole(ServiceSid string, params *CreateRoleParams) (*I data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.Permission != nil { - for _, item := range *params.Permission { - data.Add("Permission", item) + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } + if params != nil && params.Permission != nil { + for _, item := range *params.Permission { + data.Add("Permission", item) + } } -} @@ -93,6 +94,7 @@ func (c *ApiService) DeleteRole(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -114,6 +116,7 @@ func (c *ApiService) FetchRole(ServiceSid string, Sid string, ) (*IpMessagingV2R + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -154,9 +157,10 @@ func (c *ApiService) PageRole(ServiceSid string, params *ListRoleParams, pageTok data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -287,11 +291,12 @@ func (c *ApiService) UpdateRole(ServiceSid string, Sid string, params *UpdateRol data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Permission != nil { - for _, item := range *params.Permission { - data.Add("Permission", item) + + if params != nil && params.Permission != nil { + for _, item := range *params.Permission { + data.Add("Permission", item) + } } -} diff --git a/rest/ip_messaging/v2/services_users.go b/rest/ip_messaging/v2/services_users.go index d1235c46f..29caf02ee 100644 --- a/rest/ip_messaging/v2/services_users.go +++ b/rest/ip_messaging/v2/services_users.go @@ -65,18 +65,19 @@ func (c *ApiService) CreateUser(ServiceSid string, params *CreateUserParams) (*I 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) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } if params != nil && params.XTwilioWebhookEnabled != nil { @@ -109,6 +110,7 @@ func (c *ApiService) DeleteUser(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -130,6 +132,7 @@ func (c *ApiService) FetchUser(ServiceSid string, Sid string, ) (*IpMessagingV2U + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -170,9 +173,10 @@ func (c *ApiService) PageUser(ServiceSid string, params *ListUserParams, pageTok data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -321,15 +325,16 @@ func (c *ApiService) UpdateUser(ServiceSid string, Sid string, params *UpdateUse data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.RoleSid != nil { - data.Set("RoleSid", *params.RoleSid) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.RoleSid != nil { + data.Set("RoleSid", *params.RoleSid) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } if params != nil && params.XTwilioWebhookEnabled != nil { diff --git a/rest/ip_messaging/v2/services_users_bindings.go b/rest/ip_messaging/v2/services_users_bindings.go index 83379513e..9fae371fe 100644 --- a/rest/ip_messaging/v2/services_users_bindings.go +++ b/rest/ip_messaging/v2/services_users_bindings.go @@ -35,6 +35,7 @@ func (c *ApiService) DeleteUserBinding(ServiceSid string, UserSid string, Sid st + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -57,6 +58,7 @@ func (c *ApiService) FetchUserBinding(ServiceSid string, UserSid string, Sid str + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -104,14 +106,15 @@ func (c *ApiService) PageUserBinding(ServiceSid string, UserSid string, params * data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.BindingType != nil { - for _, item := range *params.BindingType { - data.Add("BindingType", item) + + if params != nil && params.BindingType != nil { + for _, item := range *params.BindingType { + data.Add("BindingType", item) + } + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) } -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/ip_messaging/v2/services_users_channels.go b/rest/ip_messaging/v2/services_users_channels.go index 76965d968..8213b22d7 100644 --- a/rest/ip_messaging/v2/services_users_channels.go +++ b/rest/ip_messaging/v2/services_users_channels.go @@ -35,6 +35,7 @@ func (c *ApiService) DeleteUserChannel(ServiceSid string, UserSid string, Channe + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -57,6 +58,7 @@ func (c *ApiService) FetchUserChannel(ServiceSid string, UserSid string, Channel + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -98,9 +100,10 @@ func (c *ApiService) PageUserChannel(ServiceSid string, UserSid string, params * data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -244,15 +247,16 @@ func (c *ApiService) UpdateUserChannel(ServiceSid string, UserSid string, Channe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.NotificationLevel != nil { - data.Set("NotificationLevel", *params.NotificationLevel) -} -if params != nil && params.LastConsumedMessageIndex != nil { - data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) -} -if params != nil && params.LastConsumptionTimestamp != nil { - data.Set("LastConsumptionTimestamp", fmt.Sprint((*params.LastConsumptionTimestamp).Format(time.RFC3339))) -} + + if params != nil && params.NotificationLevel != nil { + data.Set("NotificationLevel", *params.NotificationLevel) + } + if params != nil && params.LastConsumedMessageIndex != nil { + data.Set("LastConsumedMessageIndex", fmt.Sprint(*params.LastConsumedMessageIndex)) + } + if params != nil && params.LastConsumptionTimestamp != nil { + data.Set("LastConsumptionTimestamp", fmt.Sprint((*params.LastConsumptionTimestamp).Format(time.RFC3339))) + } diff --git a/rest/lookups/v1/phone_numbers.go b/rest/lookups/v1/phone_numbers.go index 40d26e840..f506cfcdb 100644 --- a/rest/lookups/v1/phone_numbers.go +++ b/rest/lookups/v1/phone_numbers.go @@ -59,28 +59,29 @@ func (c *ApiService) FetchPhoneNumber(PhoneNumber string, params *FetchPhoneNumb data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.CountryCode != nil { - data.Set("CountryCode", *params.CountryCode) -} -if params != nil && params.Type != nil { - for _, item := range *params.Type { - data.Add("Type", item) + + if params != nil && params.CountryCode != nil { + data.Set("CountryCode", *params.CountryCode) } -} -if params != nil && params.AddOns != nil { - for _, item := range *params.AddOns { - data.Add("AddOns", item) + if params != nil && params.Type != nil { + for _, item := range *params.Type { + data.Add("Type", item) + } + } + if params != nil && params.AddOns != nil { + for _, item := range *params.AddOns { + data.Add("AddOns", item) } -} -if params != nil && params.AddOnsData != nil { - v, err := json.Marshal(params.AddOnsData) - - if err != nil { - return nil, err } + if params != nil && params.AddOnsData != nil { + v, err := json.Marshal(params.AddOnsData) - data.Set("AddOnsData", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("AddOnsData", string(v)) + } diff --git a/rest/lookups/v2/phone_numbers.go b/rest/lookups/v2/phone_numbers.go index f52d2e9b8..f0cac8b44 100644 --- a/rest/lookups/v2/phone_numbers.go +++ b/rest/lookups/v2/phone_numbers.go @@ -113,45 +113,46 @@ func (c *ApiService) FetchPhoneNumber(PhoneNumber string, params *FetchPhoneNumb data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Fields != nil { - data.Set("Fields", *params.Fields) -} -if params != nil && params.CountryCode != nil { - data.Set("CountryCode", *params.CountryCode) -} -if params != nil && params.FirstName != nil { - data.Set("FirstName", *params.FirstName) -} -if params != nil && params.LastName != nil { - data.Set("LastName", *params.LastName) -} -if params != nil && params.AddressLine1 != nil { - data.Set("AddressLine1", *params.AddressLine1) -} -if params != nil && params.AddressLine2 != nil { - data.Set("AddressLine2", *params.AddressLine2) -} -if params != nil && params.City != nil { - data.Set("City", *params.City) -} -if params != nil && params.State != nil { - data.Set("State", *params.State) -} -if params != nil && params.PostalCode != nil { - data.Set("PostalCode", *params.PostalCode) -} -if params != nil && params.AddressCountryCode != nil { - data.Set("AddressCountryCode", *params.AddressCountryCode) -} -if params != nil && params.NationalId != nil { - data.Set("NationalId", *params.NationalId) -} -if params != nil && params.DateOfBirth != nil { - data.Set("DateOfBirth", *params.DateOfBirth) -} -if params != nil && params.LastVerifiedDate != nil { - data.Set("LastVerifiedDate", *params.LastVerifiedDate) -} + + if params != nil && params.Fields != nil { + data.Set("Fields", *params.Fields) + } + if params != nil && params.CountryCode != nil { + data.Set("CountryCode", *params.CountryCode) + } + if params != nil && params.FirstName != nil { + data.Set("FirstName", *params.FirstName) + } + if params != nil && params.LastName != nil { + data.Set("LastName", *params.LastName) + } + if params != nil && params.AddressLine1 != nil { + data.Set("AddressLine1", *params.AddressLine1) + } + if params != nil && params.AddressLine2 != nil { + data.Set("AddressLine2", *params.AddressLine2) + } + if params != nil && params.City != nil { + data.Set("City", *params.City) + } + if params != nil && params.State != nil { + data.Set("State", *params.State) + } + if params != nil && params.PostalCode != nil { + data.Set("PostalCode", *params.PostalCode) + } + if params != nil && params.AddressCountryCode != nil { + data.Set("AddressCountryCode", *params.AddressCountryCode) + } + if params != nil && params.NationalId != nil { + data.Set("NationalId", *params.NationalId) + } + if params != nil && params.DateOfBirth != nil { + data.Set("DateOfBirth", *params.DateOfBirth) + } + if params != nil && params.LastVerifiedDate != nil { + data.Set("LastVerifiedDate", *params.LastVerifiedDate) + } diff --git a/rest/media/v1/media_processors.go b/rest/media/v1/media_processors.go index 2f2252cdb..9621657a6 100644 --- a/rest/media/v1/media_processors.go +++ b/rest/media/v1/media_processors.go @@ -70,30 +70,31 @@ func (c *ApiService) CreateMediaProcessor(params *CreateMediaProcessorParams) (* data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Extension != nil { - data.Set("Extension", *params.Extension) -} -if params != nil && params.ExtensionContext != nil { - data.Set("ExtensionContext", *params.ExtensionContext) -} -if params != nil && params.ExtensionEnvironment != nil { - v, err := json.Marshal(params.ExtensionEnvironment) - if err != nil { - return nil, err + if params != nil && params.Extension != nil { + data.Set("Extension", *params.Extension) } + if params != nil && params.ExtensionContext != nil { + data.Set("ExtensionContext", *params.ExtensionContext) + } + if params != nil && params.ExtensionEnvironment != nil { + v, err := json.Marshal(params.ExtensionEnvironment) - data.Set("ExtensionEnvironment", string(v)) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.MaxDuration != nil { - data.Set("MaxDuration", fmt.Sprint(*params.MaxDuration)) -} + if err != nil { + return nil, err + } + + data.Set("ExtensionEnvironment", string(v)) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.MaxDuration != nil { + data.Set("MaxDuration", fmt.Sprint(*params.MaxDuration)) + } @@ -122,6 +123,7 @@ func (c *ApiService) FetchMediaProcessor(Sid string, ) (*MediaV1MediaProcessor, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -173,15 +175,16 @@ func (c *ApiService) PageMediaProcessor(params *ListMediaProcessorParams, pageTo data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Order != nil { - data.Set("Order", *params.Order) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Order != nil { + data.Set("Order", *params.Order) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -311,9 +314,10 @@ func (c *ApiService) UpdateMediaProcessor(Sid string, params *UpdateMediaProcess data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } diff --git a/rest/media/v1/media_recordings.go b/rest/media/v1/media_recordings.go index 401fd8a6a..82e685f6d 100644 --- a/rest/media/v1/media_recordings.go +++ b/rest/media/v1/media_recordings.go @@ -33,6 +33,7 @@ func (c *ApiService) DeleteMediaRecording(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -53,6 +54,7 @@ func (c *ApiService) FetchMediaRecording(Sid string, ) (*MediaV1MediaRecording, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -116,21 +118,22 @@ func (c *ApiService) PageMediaRecording(params *ListMediaRecordingParams, pageTo data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Order != nil { - data.Set("Order", *params.Order) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.ProcessorSid != nil { - data.Set("ProcessorSid", *params.ProcessorSid) -} -if params != nil && params.SourceSid != nil { - data.Set("SourceSid", *params.SourceSid) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Order != nil { + data.Set("Order", *params.Order) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.ProcessorSid != nil { + data.Set("ProcessorSid", *params.ProcessorSid) + } + if params != nil && params.SourceSid != nil { + data.Set("SourceSid", *params.SourceSid) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/media/v1/player_streamers.go b/rest/media/v1/player_streamers.go index f40c0c236..f662fad2d 100644 --- a/rest/media/v1/player_streamers.go +++ b/rest/media/v1/player_streamers.go @@ -58,18 +58,19 @@ func (c *ApiService) CreatePlayerStreamer(params *CreatePlayerStreamerParams) (* data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Video != nil { - data.Set("Video", fmt.Sprint(*params.Video)) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.MaxDuration != nil { - data.Set("MaxDuration", fmt.Sprint(*params.MaxDuration)) -} + + if params != nil && params.Video != nil { + data.Set("Video", fmt.Sprint(*params.Video)) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.MaxDuration != nil { + data.Set("MaxDuration", fmt.Sprint(*params.MaxDuration)) + } @@ -98,6 +99,7 @@ func (c *ApiService) FetchPlayerStreamer(Sid string, ) (*MediaV1PlayerStreamer, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -149,15 +151,16 @@ func (c *ApiService) PagePlayerStreamer(params *ListPlayerStreamerParams, pageTo data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Order != nil { - data.Set("Order", *params.Order) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Order != nil { + data.Set("Order", *params.Order) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -287,9 +290,10 @@ func (c *ApiService) UpdatePlayerStreamer(Sid string, params *UpdatePlayerStream data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } diff --git a/rest/media/v1/player_streamers_playback_grant.go b/rest/media/v1/player_streamers_playback_grant.go index b88f61ef0..f1f0c40d9 100644 --- a/rest/media/v1/player_streamers_playback_grant.go +++ b/rest/media/v1/player_streamers_playback_grant.go @@ -47,12 +47,13 @@ func (c *ApiService) CreatePlayerStreamerPlaybackGrant(Sid string, params *Creat 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.AccessControlAllowOrigin != nil { - data.Set("AccessControlAllowOrigin", *params.AccessControlAllowOrigin) -} + + if params != nil && params.Ttl != nil { + data.Set("Ttl", fmt.Sprint(*params.Ttl)) + } + if params != nil && params.AccessControlAllowOrigin != nil { + data.Set("AccessControlAllowOrigin", *params.AccessControlAllowOrigin) + } @@ -81,6 +82,7 @@ func (c *ApiService) FetchPlayerStreamerPlaybackGrant(Sid string, ) (*MediaV1Pla + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/messaging/v1/a2p_brand_registrations.go b/rest/messaging/v1/a2p_brand_registrations.go index 125b14d73..85a074945 100644 --- a/rest/messaging/v1/a2p_brand_registrations.go +++ b/rest/messaging/v1/a2p_brand_registrations.go @@ -64,21 +64,22 @@ func (c *ApiService) CreateBrandRegistrations(params *CreateBrandRegistrationsPa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.CustomerProfileBundleSid != nil { - data.Set("CustomerProfileBundleSid", *params.CustomerProfileBundleSid) -} -if params != nil && params.A2PProfileBundleSid != nil { - data.Set("A2PProfileBundleSid", *params.A2PProfileBundleSid) -} -if params != nil && params.BrandType != nil { - data.Set("BrandType", *params.BrandType) -} -if params != nil && params.Mock != nil { - data.Set("Mock", fmt.Sprint(*params.Mock)) -} -if params != nil && params.SkipAutomaticSecVet != nil { - data.Set("SkipAutomaticSecVet", fmt.Sprint(*params.SkipAutomaticSecVet)) -} + + if params != nil && params.CustomerProfileBundleSid != nil { + data.Set("CustomerProfileBundleSid", *params.CustomerProfileBundleSid) + } + if params != nil && params.A2PProfileBundleSid != nil { + data.Set("A2PProfileBundleSid", *params.A2PProfileBundleSid) + } + if params != nil && params.BrandType != nil { + data.Set("BrandType", *params.BrandType) + } + if params != nil && params.Mock != nil { + data.Set("Mock", fmt.Sprint(*params.Mock)) + } + if params != nil && params.SkipAutomaticSecVet != nil { + data.Set("SkipAutomaticSecVet", fmt.Sprint(*params.SkipAutomaticSecVet)) + } @@ -107,6 +108,7 @@ func (c *ApiService) FetchBrandRegistrations(Sid string, ) (*MessagingV1BrandReg + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -146,9 +148,10 @@ func (c *ApiService) PageBrandRegistrations(params *ListBrandRegistrationsParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -270,6 +273,7 @@ func (c *ApiService) UpdateBrandRegistrations(Sid string, ) (*MessagingV1BrandRe + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/messaging/v1/a2p_brand_registrations_sms_otp.go b/rest/messaging/v1/a2p_brand_registrations_sms_otp.go index 944da31ca..5f0d470e8 100644 --- a/rest/messaging/v1/a2p_brand_registrations_sms_otp.go +++ b/rest/messaging/v1/a2p_brand_registrations_sms_otp.go @@ -33,6 +33,7 @@ func (c *ApiService) CreateBrandRegistrationOtp(BrandRegistrationSid string, ) ( + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/messaging/v1/a2p_brand_registrations_vettings.go b/rest/messaging/v1/a2p_brand_registrations_vettings.go index 0c97fa2db..7820bc088 100644 --- a/rest/messaging/v1/a2p_brand_registrations_vettings.go +++ b/rest/messaging/v1/a2p_brand_registrations_vettings.go @@ -47,12 +47,13 @@ func (c *ApiService) CreateBrandVetting(BrandSid string, params *CreateBrandVett data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.VettingProvider != nil { - data.Set("VettingProvider", *params.VettingProvider) -} -if params != nil && params.VettingId != nil { - data.Set("VettingId", *params.VettingId) -} + + if params != nil && params.VettingProvider != nil { + data.Set("VettingProvider", *params.VettingProvider) + } + if params != nil && params.VettingId != nil { + data.Set("VettingId", *params.VettingId) + } @@ -82,6 +83,7 @@ func (c *ApiService) FetchBrandVetting(BrandSid string, BrandVettingSid string, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -128,12 +130,13 @@ func (c *ApiService) PageBrandVetting(BrandSid string, params *ListBrandVettingP data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.VettingProvider != nil { - data.Set("VettingProvider", *params.VettingProvider) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.VettingProvider != nil { + data.Set("VettingProvider", *params.VettingProvider) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/messaging/v1/deactivations.go b/rest/messaging/v1/deactivations.go index c30a0de2c..b64d8c942 100644 --- a/rest/messaging/v1/deactivations.go +++ b/rest/messaging/v1/deactivations.go @@ -40,9 +40,10 @@ func (c *ApiService) FetchDeactivation(params *FetchDeactivationParams) (*Messag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Date != nil { - data.Set("Date", fmt.Sprint(*params.Date)) -} + + if params != nil && params.Date != nil { + data.Set("Date", fmt.Sprint(*params.Date)) + } diff --git a/rest/messaging/v1/link_shortening_domains_certificate.go b/rest/messaging/v1/link_shortening_domains_certificate.go index dcda93a5e..52e38bebc 100644 --- a/rest/messaging/v1/link_shortening_domains_certificate.go +++ b/rest/messaging/v1/link_shortening_domains_certificate.go @@ -33,6 +33,7 @@ func (c *ApiService) DeleteDomainCertV4(DomainSid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -53,6 +54,7 @@ func (c *ApiService) FetchDomainCertV4(DomainSid string, ) (*MessagingV1DomainCe + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -86,9 +88,10 @@ func (c *ApiService) UpdateDomainCertV4(DomainSid string, params *UpdateDomainCe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.TlsCert != nil { - data.Set("TlsCert", *params.TlsCert) -} + + if params != nil && params.TlsCert != nil { + data.Set("TlsCert", *params.TlsCert) + } diff --git a/rest/messaging/v1/link_shortening_domains_config.go b/rest/messaging/v1/link_shortening_domains_config.go index 8fb66e60f..d2e4e89d9 100644 --- a/rest/messaging/v1/link_shortening_domains_config.go +++ b/rest/messaging/v1/link_shortening_domains_config.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchDomainConfig(DomainSid string, ) (*MessagingV1DomainCo + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -84,18 +85,19 @@ func (c *ApiService) UpdateDomainConfig(DomainSid string, params *UpdateDomainCo data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FallbackUrl != nil { - data.Set("FallbackUrl", *params.FallbackUrl) -} -if params != nil && params.CallbackUrl != nil { - data.Set("CallbackUrl", *params.CallbackUrl) -} -if params != nil && params.ContinueOnFailure != nil { - data.Set("ContinueOnFailure", fmt.Sprint(*params.ContinueOnFailure)) -} -if params != nil && params.DisableHttps != nil { - data.Set("DisableHttps", fmt.Sprint(*params.DisableHttps)) -} + + if params != nil && params.FallbackUrl != nil { + data.Set("FallbackUrl", *params.FallbackUrl) + } + if params != nil && params.CallbackUrl != nil { + data.Set("CallbackUrl", *params.CallbackUrl) + } + if params != nil && params.ContinueOnFailure != nil { + data.Set("ContinueOnFailure", fmt.Sprint(*params.ContinueOnFailure)) + } + if params != nil && params.DisableHttps != nil { + data.Set("DisableHttps", fmt.Sprint(*params.DisableHttps)) + } diff --git a/rest/messaging/v1/link_shortening_domains_messaging_services.go b/rest/messaging/v1/link_shortening_domains_messaging_services.go index 660adde4d..9775aee76 100644 --- a/rest/messaging/v1/link_shortening_domains_messaging_services.go +++ b/rest/messaging/v1/link_shortening_domains_messaging_services.go @@ -34,6 +34,7 @@ func (c *ApiService) CreateLinkshorteningMessagingService(DomainSid string, Mess + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -60,6 +61,7 @@ func (c *ApiService) DeleteLinkshorteningMessagingService(DomainSid string, Mess + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err diff --git a/rest/messaging/v1/link_shortening_messaging_service_domain_config.go b/rest/messaging/v1/link_shortening_messaging_service_domain_config.go index 77ca4aec2..722c80598 100644 --- a/rest/messaging/v1/link_shortening_messaging_service_domain_config.go +++ b/rest/messaging/v1/link_shortening_messaging_service_domain_config.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchDomainConfigMessagingService(MessagingServiceSid strin + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/messaging/v1/link_shortening_messaging_services_domain.go b/rest/messaging/v1/link_shortening_messaging_services_domain.go index b33106f51..d7827df3a 100644 --- a/rest/messaging/v1/link_shortening_messaging_services_domain.go +++ b/rest/messaging/v1/link_shortening_messaging_services_domain.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchLinkshorteningMessagingServiceDomainAssociation(Messag + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/messaging/v1/services.go b/rest/messaging/v1/services.go index abcc37bd2..70e6184a6 100644 --- a/rest/messaging/v1/services.go +++ b/rest/messaging/v1/services.go @@ -130,54 +130,55 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*MessagingV1Ser data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.InboundRequestUrl != nil { - data.Set("InboundRequestUrl", *params.InboundRequestUrl) -} -if params != nil && params.InboundMethod != nil { - data.Set("InboundMethod", *params.InboundMethod) -} -if params != nil && params.FallbackUrl != nil { - data.Set("FallbackUrl", *params.FallbackUrl) -} -if params != nil && params.FallbackMethod != nil { - data.Set("FallbackMethod", *params.FallbackMethod) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StickySender != nil { - data.Set("StickySender", fmt.Sprint(*params.StickySender)) -} -if params != nil && params.MmsConverter != nil { - data.Set("MmsConverter", fmt.Sprint(*params.MmsConverter)) -} -if params != nil && params.SmartEncoding != nil { - data.Set("SmartEncoding", fmt.Sprint(*params.SmartEncoding)) -} -if params != nil && params.ScanMessageContent != nil { - data.Set("ScanMessageContent", *params.ScanMessageContent) -} -if params != nil && params.FallbackToLongCode != nil { - data.Set("FallbackToLongCode", fmt.Sprint(*params.FallbackToLongCode)) -} -if params != nil && params.AreaCodeGeomatch != nil { - data.Set("AreaCodeGeomatch", fmt.Sprint(*params.AreaCodeGeomatch)) -} -if params != nil && params.ValidityPeriod != nil { - data.Set("ValidityPeriod", fmt.Sprint(*params.ValidityPeriod)) -} -if params != nil && params.SynchronousValidation != nil { - data.Set("SynchronousValidation", fmt.Sprint(*params.SynchronousValidation)) -} -if params != nil && params.Usecase != nil { - data.Set("Usecase", *params.Usecase) -} -if params != nil && params.UseInboundWebhookOnNumber != nil { - data.Set("UseInboundWebhookOnNumber", fmt.Sprint(*params.UseInboundWebhookOnNumber)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.InboundRequestUrl != nil { + data.Set("InboundRequestUrl", *params.InboundRequestUrl) + } + if params != nil && params.InboundMethod != nil { + data.Set("InboundMethod", *params.InboundMethod) + } + if params != nil && params.FallbackUrl != nil { + data.Set("FallbackUrl", *params.FallbackUrl) + } + if params != nil && params.FallbackMethod != nil { + data.Set("FallbackMethod", *params.FallbackMethod) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StickySender != nil { + data.Set("StickySender", fmt.Sprint(*params.StickySender)) + } + if params != nil && params.MmsConverter != nil { + data.Set("MmsConverter", fmt.Sprint(*params.MmsConverter)) + } + if params != nil && params.SmartEncoding != nil { + data.Set("SmartEncoding", fmt.Sprint(*params.SmartEncoding)) + } + if params != nil && params.ScanMessageContent != nil { + data.Set("ScanMessageContent", *params.ScanMessageContent) + } + if params != nil && params.FallbackToLongCode != nil { + data.Set("FallbackToLongCode", fmt.Sprint(*params.FallbackToLongCode)) + } + if params != nil && params.AreaCodeGeomatch != nil { + data.Set("AreaCodeGeomatch", fmt.Sprint(*params.AreaCodeGeomatch)) + } + if params != nil && params.ValidityPeriod != nil { + data.Set("ValidityPeriod", fmt.Sprint(*params.ValidityPeriod)) + } + if params != nil && params.SynchronousValidation != nil { + data.Set("SynchronousValidation", fmt.Sprint(*params.SynchronousValidation)) + } + if params != nil && params.Usecase != nil { + data.Set("Usecase", *params.Usecase) + } + if params != nil && params.UseInboundWebhookOnNumber != nil { + data.Set("UseInboundWebhookOnNumber", fmt.Sprint(*params.UseInboundWebhookOnNumber)) + } @@ -206,6 +207,7 @@ func (c *ApiService) DeleteService(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -226,6 +228,7 @@ func (c *ApiService) FetchService(Sid string, ) (*MessagingV1Service, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -265,9 +268,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -487,54 +491,55 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Me data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.InboundRequestUrl != nil { - data.Set("InboundRequestUrl", *params.InboundRequestUrl) -} -if params != nil && params.InboundMethod != nil { - data.Set("InboundMethod", *params.InboundMethod) -} -if params != nil && params.FallbackUrl != nil { - data.Set("FallbackUrl", *params.FallbackUrl) -} -if params != nil && params.FallbackMethod != nil { - data.Set("FallbackMethod", *params.FallbackMethod) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StickySender != nil { - data.Set("StickySender", fmt.Sprint(*params.StickySender)) -} -if params != nil && params.MmsConverter != nil { - data.Set("MmsConverter", fmt.Sprint(*params.MmsConverter)) -} -if params != nil && params.SmartEncoding != nil { - data.Set("SmartEncoding", fmt.Sprint(*params.SmartEncoding)) -} -if params != nil && params.ScanMessageContent != nil { - data.Set("ScanMessageContent", *params.ScanMessageContent) -} -if params != nil && params.FallbackToLongCode != nil { - data.Set("FallbackToLongCode", fmt.Sprint(*params.FallbackToLongCode)) -} -if params != nil && params.AreaCodeGeomatch != nil { - data.Set("AreaCodeGeomatch", fmt.Sprint(*params.AreaCodeGeomatch)) -} -if params != nil && params.ValidityPeriod != nil { - data.Set("ValidityPeriod", fmt.Sprint(*params.ValidityPeriod)) -} -if params != nil && params.SynchronousValidation != nil { - data.Set("SynchronousValidation", fmt.Sprint(*params.SynchronousValidation)) -} -if params != nil && params.Usecase != nil { - data.Set("Usecase", *params.Usecase) -} -if params != nil && params.UseInboundWebhookOnNumber != nil { - data.Set("UseInboundWebhookOnNumber", fmt.Sprint(*params.UseInboundWebhookOnNumber)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.InboundRequestUrl != nil { + data.Set("InboundRequestUrl", *params.InboundRequestUrl) + } + if params != nil && params.InboundMethod != nil { + data.Set("InboundMethod", *params.InboundMethod) + } + if params != nil && params.FallbackUrl != nil { + data.Set("FallbackUrl", *params.FallbackUrl) + } + if params != nil && params.FallbackMethod != nil { + data.Set("FallbackMethod", *params.FallbackMethod) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StickySender != nil { + data.Set("StickySender", fmt.Sprint(*params.StickySender)) + } + if params != nil && params.MmsConverter != nil { + data.Set("MmsConverter", fmt.Sprint(*params.MmsConverter)) + } + if params != nil && params.SmartEncoding != nil { + data.Set("SmartEncoding", fmt.Sprint(*params.SmartEncoding)) + } + if params != nil && params.ScanMessageContent != nil { + data.Set("ScanMessageContent", *params.ScanMessageContent) + } + if params != nil && params.FallbackToLongCode != nil { + data.Set("FallbackToLongCode", fmt.Sprint(*params.FallbackToLongCode)) + } + if params != nil && params.AreaCodeGeomatch != nil { + data.Set("AreaCodeGeomatch", fmt.Sprint(*params.AreaCodeGeomatch)) + } + if params != nil && params.ValidityPeriod != nil { + data.Set("ValidityPeriod", fmt.Sprint(*params.ValidityPeriod)) + } + if params != nil && params.SynchronousValidation != nil { + data.Set("SynchronousValidation", fmt.Sprint(*params.SynchronousValidation)) + } + if params != nil && params.Usecase != nil { + data.Set("Usecase", *params.Usecase) + } + if params != nil && params.UseInboundWebhookOnNumber != nil { + data.Set("UseInboundWebhookOnNumber", fmt.Sprint(*params.UseInboundWebhookOnNumber)) + } diff --git a/rest/messaging/v1/services_alpha_senders.go b/rest/messaging/v1/services_alpha_senders.go index c080f2326..1a2ed1006 100644 --- a/rest/messaging/v1/services_alpha_senders.go +++ b/rest/messaging/v1/services_alpha_senders.go @@ -41,9 +41,10 @@ func (c *ApiService) CreateAlphaSender(ServiceSid string, params *CreateAlphaSen data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.AlphaSender != nil { - data.Set("AlphaSender", *params.AlphaSender) -} + + if params != nil && params.AlphaSender != nil { + data.Set("AlphaSender", *params.AlphaSender) + } @@ -73,6 +74,7 @@ func (c *ApiService) DeleteAlphaSender(ServiceSid string, Sid string, ) (error) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -94,6 +96,7 @@ func (c *ApiService) FetchAlphaSender(ServiceSid string, Sid string, ) (*Messagi + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -134,9 +137,10 @@ func (c *ApiService) PageAlphaSender(ServiceSid string, params *ListAlphaSenderP data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/messaging/v1/services_channel_senders.go b/rest/messaging/v1/services_channel_senders.go index b6c35795d..fab2bc40f 100644 --- a/rest/messaging/v1/services_channel_senders.go +++ b/rest/messaging/v1/services_channel_senders.go @@ -34,6 +34,7 @@ func (c *ApiService) FetchChannelSender(MessagingServiceSid string, Sid string, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -74,9 +75,10 @@ func (c *ApiService) PageChannelSender(MessagingServiceSid string, params *ListC data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/messaging/v1/services_compliance_usa2p.go b/rest/messaging/v1/services_compliance_usa2p.go index a9f5526e6..fac1bfef3 100644 --- a/rest/messaging/v1/services_compliance_usa2p.go +++ b/rest/messaging/v1/services_compliance_usa2p.go @@ -113,53 +113,54 @@ func (c *ApiService) CreateUsAppToPerson(MessagingServiceSid string, params *Cre data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.BrandRegistrationSid != nil { - data.Set("BrandRegistrationSid", *params.BrandRegistrationSid) -} -if params != nil && params.Description != nil { - data.Set("Description", *params.Description) -} -if params != nil && params.MessageFlow != nil { - data.Set("MessageFlow", *params.MessageFlow) -} -if params != nil && params.MessageSamples != nil { - for _, item := range *params.MessageSamples { - data.Add("MessageSamples", item) + + if params != nil && params.BrandRegistrationSid != nil { + data.Set("BrandRegistrationSid", *params.BrandRegistrationSid) } -} -if params != nil && params.UsAppToPersonUsecase != nil { - data.Set("UsAppToPersonUsecase", *params.UsAppToPersonUsecase) -} -if params != nil && params.HasEmbeddedLinks != nil { - data.Set("HasEmbeddedLinks", fmt.Sprint(*params.HasEmbeddedLinks)) -} -if params != nil && params.HasEmbeddedPhone != nil { - data.Set("HasEmbeddedPhone", fmt.Sprint(*params.HasEmbeddedPhone)) -} -if params != nil && params.OptInMessage != nil { - data.Set("OptInMessage", *params.OptInMessage) -} -if params != nil && params.OptOutMessage != nil { - data.Set("OptOutMessage", *params.OptOutMessage) -} -if params != nil && params.HelpMessage != nil { - data.Set("HelpMessage", *params.HelpMessage) -} -if params != nil && params.OptInKeywords != nil { - for _, item := range *params.OptInKeywords { - data.Add("OptInKeywords", item) + if params != nil && params.Description != nil { + data.Set("Description", *params.Description) } -} -if params != nil && params.OptOutKeywords != nil { - for _, item := range *params.OptOutKeywords { - data.Add("OptOutKeywords", item) + if params != nil && params.MessageFlow != nil { + data.Set("MessageFlow", *params.MessageFlow) + } + if params != nil && params.MessageSamples != nil { + for _, item := range *params.MessageSamples { + data.Add("MessageSamples", item) + } + } + if params != nil && params.UsAppToPersonUsecase != nil { + data.Set("UsAppToPersonUsecase", *params.UsAppToPersonUsecase) + } + if params != nil && params.HasEmbeddedLinks != nil { + data.Set("HasEmbeddedLinks", fmt.Sprint(*params.HasEmbeddedLinks)) + } + if params != nil && params.HasEmbeddedPhone != nil { + data.Set("HasEmbeddedPhone", fmt.Sprint(*params.HasEmbeddedPhone)) + } + if params != nil && params.OptInMessage != nil { + data.Set("OptInMessage", *params.OptInMessage) + } + if params != nil && params.OptOutMessage != nil { + data.Set("OptOutMessage", *params.OptOutMessage) + } + if params != nil && params.HelpMessage != nil { + data.Set("HelpMessage", *params.HelpMessage) + } + if params != nil && params.OptInKeywords != nil { + for _, item := range *params.OptInKeywords { + data.Add("OptInKeywords", item) + } + } + if params != nil && params.OptOutKeywords != nil { + for _, item := range *params.OptOutKeywords { + data.Add("OptOutKeywords", item) + } + } + if params != nil && params.HelpKeywords != nil { + for _, item := range *params.HelpKeywords { + data.Add("HelpKeywords", item) } -} -if params != nil && params.HelpKeywords != nil { - for _, item := range *params.HelpKeywords { - data.Add("HelpKeywords", item) } -} @@ -189,6 +190,7 @@ func (c *ApiService) DeleteUsAppToPerson(MessagingServiceSid string, Sid string, + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -210,6 +212,7 @@ func (c *ApiService) FetchUsAppToPerson(MessagingServiceSid string, Sid string, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -250,9 +253,10 @@ func (c *ApiService) PageUsAppToPerson(MessagingServiceSid string, params *ListU data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/messaging/v1/services_compliance_usa2p_usecases.go b/rest/messaging/v1/services_compliance_usa2p_usecases.go index a6cbc84df..054a3bc29 100644 --- a/rest/messaging/v1/services_compliance_usa2p_usecases.go +++ b/rest/messaging/v1/services_compliance_usa2p_usecases.go @@ -41,9 +41,10 @@ func (c *ApiService) FetchUsAppToPersonUsecase(MessagingServiceSid string, param data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.BrandRegistrationSid != nil { - data.Set("BrandRegistrationSid", *params.BrandRegistrationSid) -} + + if params != nil && params.BrandRegistrationSid != nil { + data.Set("BrandRegistrationSid", *params.BrandRegistrationSid) + } diff --git a/rest/messaging/v1/services_phone_numbers.go b/rest/messaging/v1/services_phone_numbers.go index 3b40b8cc4..c042b7aa5 100644 --- a/rest/messaging/v1/services_phone_numbers.go +++ b/rest/messaging/v1/services_phone_numbers.go @@ -41,9 +41,10 @@ func (c *ApiService) CreatePhoneNumber(ServiceSid string, params *CreatePhoneNum data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PhoneNumberSid != nil { - data.Set("PhoneNumberSid", *params.PhoneNumberSid) -} + + if params != nil && params.PhoneNumberSid != nil { + data.Set("PhoneNumberSid", *params.PhoneNumberSid) + } @@ -73,6 +74,7 @@ func (c *ApiService) DeletePhoneNumber(ServiceSid string, Sid string, ) (error) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -94,6 +96,7 @@ func (c *ApiService) FetchPhoneNumber(ServiceSid string, Sid string, ) (*Messagi + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -134,9 +137,10 @@ func (c *ApiService) PagePhoneNumber(ServiceSid string, params *ListPhoneNumberP data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/messaging/v1/services_preregistered_usa2p.go b/rest/messaging/v1/services_preregistered_usa2p.go index 948304302..d378e4ba1 100644 --- a/rest/messaging/v1/services_preregistered_usa2p.go +++ b/rest/messaging/v1/services_preregistered_usa2p.go @@ -46,12 +46,13 @@ func (c *ApiService) CreateExternalCampaign(params *CreateExternalCampaignParams 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) -} + + if params != nil && params.CampaignId != nil { + data.Set("CampaignId", *params.CampaignId) + } + if params != nil && params.MessagingServiceSid != nil { + data.Set("MessagingServiceSid", *params.MessagingServiceSid) + } diff --git a/rest/messaging/v1/services_short_codes.go b/rest/messaging/v1/services_short_codes.go index 6c63b5179..547975f66 100644 --- a/rest/messaging/v1/services_short_codes.go +++ b/rest/messaging/v1/services_short_codes.go @@ -41,9 +41,10 @@ func (c *ApiService) CreateShortCode(ServiceSid string, params *CreateShortCodeP data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ShortCodeSid != nil { - data.Set("ShortCodeSid", *params.ShortCodeSid) -} + + if params != nil && params.ShortCodeSid != nil { + data.Set("ShortCodeSid", *params.ShortCodeSid) + } @@ -73,6 +74,7 @@ func (c *ApiService) DeleteShortCode(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -94,6 +96,7 @@ func (c *ApiService) FetchShortCode(ServiceSid string, Sid string, ) (*Messaging + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -134,9 +137,10 @@ func (c *ApiService) PageShortCode(ServiceSid string, params *ListShortCodeParam data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/messaging/v1/services_usecases.go b/rest/messaging/v1/services_usecases.go index 70a25e6ba..1db090723 100644 --- a/rest/messaging/v1/services_usecases.go +++ b/rest/messaging/v1/services_usecases.go @@ -32,6 +32,7 @@ func (c *ApiService) FetchUsecase() (*MessagingV1Usecase, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/messaging/v1/tollfree_verifications.go b/rest/messaging/v1/tollfree_verifications.go index 20b6de873..fc8596821 100644 --- a/rest/messaging/v1/tollfree_verifications.go +++ b/rest/messaging/v1/tollfree_verifications.go @@ -172,79 +172,80 @@ func (c *ApiService) CreateTollfreeVerification(params *CreateTollfreeVerificati data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.BusinessName != nil { - data.Set("BusinessName", *params.BusinessName) -} -if params != nil && params.BusinessWebsite != nil { - data.Set("BusinessWebsite", *params.BusinessWebsite) -} -if params != nil && params.NotificationEmail != nil { - data.Set("NotificationEmail", *params.NotificationEmail) -} -if params != nil && params.UseCaseCategories != nil { - for _, item := range *params.UseCaseCategories { - data.Add("UseCaseCategories", item) + + if params != nil && params.BusinessName != nil { + data.Set("BusinessName", *params.BusinessName) } -} -if params != nil && params.UseCaseSummary != nil { - data.Set("UseCaseSummary", *params.UseCaseSummary) -} -if params != nil && params.ProductionMessageSample != nil { - data.Set("ProductionMessageSample", *params.ProductionMessageSample) -} -if params != nil && params.OptInImageUrls != nil { - for _, item := range *params.OptInImageUrls { - data.Add("OptInImageUrls", item) + if params != nil && params.BusinessWebsite != nil { + data.Set("BusinessWebsite", *params.BusinessWebsite) + } + if params != nil && params.NotificationEmail != nil { + data.Set("NotificationEmail", *params.NotificationEmail) + } + if params != nil && params.UseCaseCategories != nil { + for _, item := range *params.UseCaseCategories { + data.Add("UseCaseCategories", item) + } + } + if params != nil && params.UseCaseSummary != nil { + data.Set("UseCaseSummary", *params.UseCaseSummary) + } + if params != nil && params.ProductionMessageSample != nil { + data.Set("ProductionMessageSample", *params.ProductionMessageSample) + } + if params != nil && params.OptInImageUrls != nil { + for _, item := range *params.OptInImageUrls { + data.Add("OptInImageUrls", item) + } + } + if params != nil && params.OptInType != nil { + data.Set("OptInType", *params.OptInType) + } + if params != nil && params.MessageVolume != nil { + data.Set("MessageVolume", *params.MessageVolume) + } + if params != nil && params.TollfreePhoneNumberSid != nil { + data.Set("TollfreePhoneNumberSid", *params.TollfreePhoneNumberSid) + } + if params != nil && params.CustomerProfileSid != nil { + data.Set("CustomerProfileSid", *params.CustomerProfileSid) + } + if params != nil && params.BusinessStreetAddress != nil { + data.Set("BusinessStreetAddress", *params.BusinessStreetAddress) + } + if params != nil && params.BusinessStreetAddress2 != nil { + data.Set("BusinessStreetAddress2", *params.BusinessStreetAddress2) + } + if params != nil && params.BusinessCity != nil { + data.Set("BusinessCity", *params.BusinessCity) + } + if params != nil && params.BusinessStateProvinceRegion != nil { + data.Set("BusinessStateProvinceRegion", *params.BusinessStateProvinceRegion) + } + if params != nil && params.BusinessPostalCode != nil { + data.Set("BusinessPostalCode", *params.BusinessPostalCode) + } + if params != nil && params.BusinessCountry != nil { + data.Set("BusinessCountry", *params.BusinessCountry) + } + if params != nil && params.AdditionalInformation != nil { + data.Set("AdditionalInformation", *params.AdditionalInformation) + } + if params != nil && params.BusinessContactFirstName != nil { + data.Set("BusinessContactFirstName", *params.BusinessContactFirstName) + } + if params != nil && params.BusinessContactLastName != nil { + data.Set("BusinessContactLastName", *params.BusinessContactLastName) + } + if params != nil && params.BusinessContactEmail != nil { + data.Set("BusinessContactEmail", *params.BusinessContactEmail) + } + if params != nil && params.BusinessContactPhone != nil { + data.Set("BusinessContactPhone", *params.BusinessContactPhone) + } + if params != nil && params.ExternalReferenceId != nil { + data.Set("ExternalReferenceId", *params.ExternalReferenceId) } -} -if params != nil && params.OptInType != nil { - data.Set("OptInType", *params.OptInType) -} -if params != nil && params.MessageVolume != nil { - data.Set("MessageVolume", *params.MessageVolume) -} -if params != nil && params.TollfreePhoneNumberSid != nil { - data.Set("TollfreePhoneNumberSid", *params.TollfreePhoneNumberSid) -} -if params != nil && params.CustomerProfileSid != nil { - data.Set("CustomerProfileSid", *params.CustomerProfileSid) -} -if params != nil && params.BusinessStreetAddress != nil { - data.Set("BusinessStreetAddress", *params.BusinessStreetAddress) -} -if params != nil && params.BusinessStreetAddress2 != nil { - data.Set("BusinessStreetAddress2", *params.BusinessStreetAddress2) -} -if params != nil && params.BusinessCity != nil { - data.Set("BusinessCity", *params.BusinessCity) -} -if params != nil && params.BusinessStateProvinceRegion != nil { - data.Set("BusinessStateProvinceRegion", *params.BusinessStateProvinceRegion) -} -if params != nil && params.BusinessPostalCode != nil { - data.Set("BusinessPostalCode", *params.BusinessPostalCode) -} -if params != nil && params.BusinessCountry != nil { - data.Set("BusinessCountry", *params.BusinessCountry) -} -if params != nil && params.AdditionalInformation != nil { - data.Set("AdditionalInformation", *params.AdditionalInformation) -} -if params != nil && params.BusinessContactFirstName != nil { - data.Set("BusinessContactFirstName", *params.BusinessContactFirstName) -} -if params != nil && params.BusinessContactLastName != nil { - data.Set("BusinessContactLastName", *params.BusinessContactLastName) -} -if params != nil && params.BusinessContactEmail != nil { - data.Set("BusinessContactEmail", *params.BusinessContactEmail) -} -if params != nil && params.BusinessContactPhone != nil { - data.Set("BusinessContactPhone", *params.BusinessContactPhone) -} -if params != nil && params.ExternalReferenceId != nil { - data.Set("ExternalReferenceId", *params.ExternalReferenceId) -} @@ -273,6 +274,7 @@ func (c *ApiService) FetchTollfreeVerification(Sid string, ) (*MessagingV1Tollfr + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -324,15 +326,16 @@ func (c *ApiService) PageTollfreeVerification(params *ListTollfreeVerificationPa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.TollfreePhoneNumberSid != nil { - data.Set("TollfreePhoneNumberSid", *params.TollfreePhoneNumberSid) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.TollfreePhoneNumberSid != nil { + data.Set("TollfreePhoneNumberSid", *params.TollfreePhoneNumberSid) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -576,70 +579,71 @@ func (c *ApiService) UpdateTollfreeVerification(Sid string, params *UpdateTollfr data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.BusinessName != nil { - data.Set("BusinessName", *params.BusinessName) -} -if params != nil && params.BusinessWebsite != nil { - data.Set("BusinessWebsite", *params.BusinessWebsite) -} -if params != nil && params.NotificationEmail != nil { - data.Set("NotificationEmail", *params.NotificationEmail) -} -if params != nil && params.UseCaseCategories != nil { - for _, item := range *params.UseCaseCategories { - data.Add("UseCaseCategories", item) + + if params != nil && params.BusinessName != nil { + data.Set("BusinessName", *params.BusinessName) } -} -if params != nil && params.UseCaseSummary != nil { - data.Set("UseCaseSummary", *params.UseCaseSummary) -} -if params != nil && params.ProductionMessageSample != nil { - data.Set("ProductionMessageSample", *params.ProductionMessageSample) -} -if params != nil && params.OptInImageUrls != nil { - for _, item := range *params.OptInImageUrls { - data.Add("OptInImageUrls", item) + if params != nil && params.BusinessWebsite != nil { + data.Set("BusinessWebsite", *params.BusinessWebsite) + } + if params != nil && params.NotificationEmail != nil { + data.Set("NotificationEmail", *params.NotificationEmail) + } + if params != nil && params.UseCaseCategories != nil { + for _, item := range *params.UseCaseCategories { + data.Add("UseCaseCategories", item) + } + } + if params != nil && params.UseCaseSummary != nil { + data.Set("UseCaseSummary", *params.UseCaseSummary) + } + if params != nil && params.ProductionMessageSample != nil { + data.Set("ProductionMessageSample", *params.ProductionMessageSample) + } + if params != nil && params.OptInImageUrls != nil { + for _, item := range *params.OptInImageUrls { + data.Add("OptInImageUrls", item) + } + } + if params != nil && params.OptInType != nil { + data.Set("OptInType", *params.OptInType) + } + if params != nil && params.MessageVolume != nil { + data.Set("MessageVolume", *params.MessageVolume) + } + if params != nil && params.BusinessStreetAddress != nil { + data.Set("BusinessStreetAddress", *params.BusinessStreetAddress) + } + if params != nil && params.BusinessStreetAddress2 != nil { + data.Set("BusinessStreetAddress2", *params.BusinessStreetAddress2) + } + if params != nil && params.BusinessCity != nil { + data.Set("BusinessCity", *params.BusinessCity) + } + if params != nil && params.BusinessStateProvinceRegion != nil { + data.Set("BusinessStateProvinceRegion", *params.BusinessStateProvinceRegion) + } + if params != nil && params.BusinessPostalCode != nil { + data.Set("BusinessPostalCode", *params.BusinessPostalCode) + } + if params != nil && params.BusinessCountry != nil { + data.Set("BusinessCountry", *params.BusinessCountry) + } + if params != nil && params.AdditionalInformation != nil { + data.Set("AdditionalInformation", *params.AdditionalInformation) + } + if params != nil && params.BusinessContactFirstName != nil { + data.Set("BusinessContactFirstName", *params.BusinessContactFirstName) + } + if params != nil && params.BusinessContactLastName != nil { + data.Set("BusinessContactLastName", *params.BusinessContactLastName) + } + if params != nil && params.BusinessContactEmail != nil { + data.Set("BusinessContactEmail", *params.BusinessContactEmail) + } + if params != nil && params.BusinessContactPhone != nil { + data.Set("BusinessContactPhone", *params.BusinessContactPhone) } -} -if params != nil && params.OptInType != nil { - data.Set("OptInType", *params.OptInType) -} -if params != nil && params.MessageVolume != nil { - data.Set("MessageVolume", *params.MessageVolume) -} -if params != nil && params.BusinessStreetAddress != nil { - data.Set("BusinessStreetAddress", *params.BusinessStreetAddress) -} -if params != nil && params.BusinessStreetAddress2 != nil { - data.Set("BusinessStreetAddress2", *params.BusinessStreetAddress2) -} -if params != nil && params.BusinessCity != nil { - data.Set("BusinessCity", *params.BusinessCity) -} -if params != nil && params.BusinessStateProvinceRegion != nil { - data.Set("BusinessStateProvinceRegion", *params.BusinessStateProvinceRegion) -} -if params != nil && params.BusinessPostalCode != nil { - data.Set("BusinessPostalCode", *params.BusinessPostalCode) -} -if params != nil && params.BusinessCountry != nil { - data.Set("BusinessCountry", *params.BusinessCountry) -} -if params != nil && params.AdditionalInformation != nil { - data.Set("AdditionalInformation", *params.AdditionalInformation) -} -if params != nil && params.BusinessContactFirstName != nil { - data.Set("BusinessContactFirstName", *params.BusinessContactFirstName) -} -if params != nil && params.BusinessContactLastName != nil { - data.Set("BusinessContactLastName", *params.BusinessContactLastName) -} -if params != nil && params.BusinessContactEmail != nil { - data.Set("BusinessContactEmail", *params.BusinessContactEmail) -} -if params != nil && params.BusinessContactPhone != nil { - data.Set("BusinessContactPhone", *params.BusinessContactPhone) -} diff --git a/rest/microvisor/v1/apps.go b/rest/microvisor/v1/apps.go index 68d5aceb1..36bd256a1 100644 --- a/rest/microvisor/v1/apps.go +++ b/rest/microvisor/v1/apps.go @@ -33,6 +33,7 @@ func (c *ApiService) DeleteApp(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -53,6 +54,7 @@ func (c *ApiService) FetchApp(Sid string, ) (*MicrovisorV1App, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -92,9 +94,10 @@ func (c *ApiService) PageApp(params *ListAppParams, pageToken, pageNumber string data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/microvisor/v1/apps_manifest.go b/rest/microvisor/v1/apps_manifest.go index c43c29933..7dec14858 100644 --- a/rest/microvisor/v1/apps_manifest.go +++ b/rest/microvisor/v1/apps_manifest.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchAppManifest(AppSid string, ) (*MicrovisorV1AppManifest + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/microvisor/v1/configs.go b/rest/microvisor/v1/configs.go index c1d60b52c..c2aee4d02 100644 --- a/rest/microvisor/v1/configs.go +++ b/rest/microvisor/v1/configs.go @@ -46,12 +46,13 @@ func (c *ApiService) CreateAccountConfig(params *CreateAccountConfigParams) (*Mi 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) -} + + if params != nil && params.Key != nil { + data.Set("Key", *params.Key) + } + if params != nil && params.Value != nil { + data.Set("Value", *params.Value) + } @@ -80,6 +81,7 @@ func (c *ApiService) DeleteAccountConfig(Key string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -100,6 +102,7 @@ func (c *ApiService) FetchAccountConfig(Key string, ) (*MicrovisorV1AccountConfi + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -139,9 +142,10 @@ func (c *ApiService) PageAccountConfig(params *ListAccountConfigParams, pageToke data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -271,9 +275,10 @@ func (c *ApiService) UpdateAccountConfig(Key string, params *UpdateAccountConfig data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Value != nil { - data.Set("Value", *params.Value) -} + + if params != nil && params.Value != nil { + data.Set("Value", *params.Value) + } diff --git a/rest/microvisor/v1/devices.go b/rest/microvisor/v1/devices.go index 43f49933e..9f734b7a9 100644 --- a/rest/microvisor/v1/devices.go +++ b/rest/microvisor/v1/devices.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchDevice(Sid string, ) (*MicrovisorV1Device, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -72,9 +73,10 @@ func (c *ApiService) PageDevice(params *ListDeviceParams, pageToken, pageNumber data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -222,18 +224,19 @@ func (c *ApiService) UpdateDevice(Sid string, params *UpdateDeviceParams) (*Micr data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.TargetApp != nil { - data.Set("TargetApp", *params.TargetApp) -} -if params != nil && params.LoggingEnabled != nil { - data.Set("LoggingEnabled", fmt.Sprint(*params.LoggingEnabled)) -} -if params != nil && params.RestartApp != nil { - data.Set("RestartApp", fmt.Sprint(*params.RestartApp)) -} + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.TargetApp != nil { + data.Set("TargetApp", *params.TargetApp) + } + if params != nil && params.LoggingEnabled != nil { + data.Set("LoggingEnabled", fmt.Sprint(*params.LoggingEnabled)) + } + if params != nil && params.RestartApp != nil { + data.Set("RestartApp", fmt.Sprint(*params.RestartApp)) + } diff --git a/rest/microvisor/v1/devices_configs.go b/rest/microvisor/v1/devices_configs.go index 204025532..b197b6624 100644 --- a/rest/microvisor/v1/devices_configs.go +++ b/rest/microvisor/v1/devices_configs.go @@ -47,12 +47,13 @@ func (c *ApiService) CreateDeviceConfig(DeviceSid string, params *CreateDeviceCo 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) -} + + if params != nil && params.Key != nil { + data.Set("Key", *params.Key) + } + if params != nil && params.Value != nil { + data.Set("Value", *params.Value) + } @@ -82,6 +83,7 @@ func (c *ApiService) DeleteDeviceConfig(DeviceSid string, Key string, ) (error) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -103,6 +105,7 @@ func (c *ApiService) FetchDeviceConfig(DeviceSid string, Key string, ) (*Microvi + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -143,9 +146,10 @@ func (c *ApiService) PageDeviceConfig(DeviceSid string, params *ListDeviceConfig data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -276,9 +280,10 @@ func (c *ApiService) UpdateDeviceConfig(DeviceSid string, Key string, params *Up data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Value != nil { - data.Set("Value", *params.Value) -} + + if params != nil && params.Value != nil { + data.Set("Value", *params.Value) + } diff --git a/rest/microvisor/v1/devices_secrets.go b/rest/microvisor/v1/devices_secrets.go index a3afcf41f..d4f35c964 100644 --- a/rest/microvisor/v1/devices_secrets.go +++ b/rest/microvisor/v1/devices_secrets.go @@ -47,12 +47,13 @@ func (c *ApiService) CreateDeviceSecret(DeviceSid string, params *CreateDeviceSe 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) -} + + if params != nil && params.Key != nil { + data.Set("Key", *params.Key) + } + if params != nil && params.Value != nil { + data.Set("Value", *params.Value) + } @@ -82,6 +83,7 @@ func (c *ApiService) DeleteDeviceSecret(DeviceSid string, Key string, ) (error) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -103,6 +105,7 @@ func (c *ApiService) FetchDeviceSecret(DeviceSid string, Key string, ) (*Microvi + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -143,9 +146,10 @@ func (c *ApiService) PageDeviceSecret(DeviceSid string, params *ListDeviceSecret data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -276,9 +280,10 @@ func (c *ApiService) UpdateDeviceSecret(DeviceSid string, Key string, params *Up data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Value != nil { - data.Set("Value", *params.Value) -} + + if params != nil && params.Value != nil { + data.Set("Value", *params.Value) + } diff --git a/rest/microvisor/v1/secrets.go b/rest/microvisor/v1/secrets.go index 8dc6a7706..13b70b81a 100644 --- a/rest/microvisor/v1/secrets.go +++ b/rest/microvisor/v1/secrets.go @@ -46,12 +46,13 @@ func (c *ApiService) CreateAccountSecret(params *CreateAccountSecretParams) (*Mi 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) -} + + if params != nil && params.Key != nil { + data.Set("Key", *params.Key) + } + if params != nil && params.Value != nil { + data.Set("Value", *params.Value) + } @@ -80,6 +81,7 @@ func (c *ApiService) DeleteAccountSecret(Key string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -100,6 +102,7 @@ func (c *ApiService) FetchAccountSecret(Key string, ) (*MicrovisorV1AccountSecre + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -139,9 +142,10 @@ func (c *ApiService) PageAccountSecret(params *ListAccountSecretParams, pageToke data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -271,9 +275,10 @@ func (c *ApiService) UpdateAccountSecret(Key string, params *UpdateAccountSecret data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Value != nil { - data.Set("Value", *params.Value) -} + + if params != nil && params.Value != nil { + data.Set("Value", *params.Value) + } diff --git a/rest/monitor/v1/alerts.go b/rest/monitor/v1/alerts.go index ff7b09bd9..9f1dfb224 100644 --- a/rest/monitor/v1/alerts.go +++ b/rest/monitor/v1/alerts.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchAlert(Sid string, ) (*MonitorV1AlertInstance, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -90,18 +91,19 @@ func (c *ApiService) PageAlert(params *ListAlertParams, pageToken, pageNumber st data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.LogLevel != nil { - data.Set("LogLevel", *params.LogLevel) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) -} -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.LogLevel != nil { + data.Set("LogLevel", *params.LogLevel) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + } + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/monitor/v1/events.go b/rest/monitor/v1/events.go index 5dc438f79..410559172 100644 --- a/rest/monitor/v1/events.go +++ b/rest/monitor/v1/events.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchEvent(Sid string, ) (*MonitorV1Event, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -108,27 +109,28 @@ func (c *ApiService) PageEvent(params *ListEventParams, pageToken, pageNumber st data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ActorSid != nil { - data.Set("ActorSid", *params.ActorSid) -} -if params != nil && params.EventType != nil { - data.Set("EventType", *params.EventType) -} -if params != nil && params.ResourceSid != nil { - data.Set("ResourceSid", *params.ResourceSid) -} -if params != nil && params.SourceIpAddress != nil { - data.Set("SourceIpAddress", *params.SourceIpAddress) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) -} -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.ActorSid != nil { + data.Set("ActorSid", *params.ActorSid) + } + if params != nil && params.EventType != nil { + data.Set("EventType", *params.EventType) + } + if params != nil && params.ResourceSid != nil { + data.Set("ResourceSid", *params.ResourceSid) + } + if params != nil && params.SourceIpAddress != nil { + data.Set("SourceIpAddress", *params.SourceIpAddress) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + } + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/notify/v1/credentials.go b/rest/notify/v1/credentials.go index 4c562de25..79f7198e9 100644 --- a/rest/notify/v1/credentials.go +++ b/rest/notify/v1/credentials.go @@ -76,27 +76,28 @@ func (c *ApiService) CreateCredential(params *CreateCredentialParams) (*NotifyV1 data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Certificate != nil { - data.Set("Certificate", *params.Certificate) -} -if params != nil && params.PrivateKey != nil { - data.Set("PrivateKey", *params.PrivateKey) -} -if params != nil && params.Sandbox != nil { - data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) -} -if params != nil && params.ApiKey != nil { - data.Set("ApiKey", *params.ApiKey) -} -if params != nil && params.Secret != nil { - data.Set("Secret", *params.Secret) -} + + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Certificate != nil { + data.Set("Certificate", *params.Certificate) + } + if params != nil && params.PrivateKey != nil { + data.Set("PrivateKey", *params.PrivateKey) + } + if params != nil && params.Sandbox != nil { + data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) + } + if params != nil && params.ApiKey != nil { + data.Set("ApiKey", *params.ApiKey) + } + if params != nil && params.Secret != nil { + data.Set("Secret", *params.Secret) + } @@ -125,6 +126,7 @@ func (c *ApiService) DeleteCredential(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -145,6 +147,7 @@ func (c *ApiService) FetchCredential(Sid string, ) (*NotifyV1Credential, error) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -184,9 +187,10 @@ func (c *ApiService) PageCredential(params *ListCredentialParams, pageToken, pag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -346,24 +350,25 @@ func (c *ApiService) UpdateCredential(Sid string, params *UpdateCredentialParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Certificate != nil { - data.Set("Certificate", *params.Certificate) -} -if params != nil && params.PrivateKey != nil { - data.Set("PrivateKey", *params.PrivateKey) -} -if params != nil && params.Sandbox != nil { - data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) -} -if params != nil && params.ApiKey != nil { - data.Set("ApiKey", *params.ApiKey) -} -if params != nil && params.Secret != nil { - data.Set("Secret", *params.Secret) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Certificate != nil { + data.Set("Certificate", *params.Certificate) + } + if params != nil && params.PrivateKey != nil { + data.Set("PrivateKey", *params.PrivateKey) + } + if params != nil && params.Sandbox != nil { + data.Set("Sandbox", fmt.Sprint(*params.Sandbox)) + } + if params != nil && params.ApiKey != nil { + data.Set("ApiKey", *params.ApiKey) + } + if params != nil && params.Secret != nil { + data.Set("Secret", *params.Secret) + } diff --git a/rest/notify/v1/services.go b/rest/notify/v1/services.go index 1efe180b6..8e24183fe 100644 --- a/rest/notify/v1/services.go +++ b/rest/notify/v1/services.go @@ -118,48 +118,49 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*NotifyV1Servic data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.ApnCredentialSid != nil { - data.Set("ApnCredentialSid", *params.ApnCredentialSid) -} -if params != nil && params.GcmCredentialSid != nil { - data.Set("GcmCredentialSid", *params.GcmCredentialSid) -} -if params != nil && params.MessagingServiceSid != nil { - data.Set("MessagingServiceSid", *params.MessagingServiceSid) -} -if params != nil && params.FacebookMessengerPageId != nil { - data.Set("FacebookMessengerPageId", *params.FacebookMessengerPageId) -} -if params != nil && params.DefaultApnNotificationProtocolVersion != nil { - data.Set("DefaultApnNotificationProtocolVersion", *params.DefaultApnNotificationProtocolVersion) -} -if params != nil && params.DefaultGcmNotificationProtocolVersion != nil { - data.Set("DefaultGcmNotificationProtocolVersion", *params.DefaultGcmNotificationProtocolVersion) -} -if params != nil && params.FcmCredentialSid != nil { - data.Set("FcmCredentialSid", *params.FcmCredentialSid) -} -if params != nil && params.DefaultFcmNotificationProtocolVersion != nil { - data.Set("DefaultFcmNotificationProtocolVersion", *params.DefaultFcmNotificationProtocolVersion) -} -if params != nil && params.LogEnabled != nil { - data.Set("LogEnabled", fmt.Sprint(*params.LogEnabled)) -} -if params != nil && params.AlexaSkillId != nil { - data.Set("AlexaSkillId", *params.AlexaSkillId) -} -if params != nil && params.DefaultAlexaNotificationProtocolVersion != nil { - data.Set("DefaultAlexaNotificationProtocolVersion", *params.DefaultAlexaNotificationProtocolVersion) -} -if params != nil && params.DeliveryCallbackUrl != nil { - data.Set("DeliveryCallbackUrl", *params.DeliveryCallbackUrl) -} -if params != nil && params.DeliveryCallbackEnabled != nil { - data.Set("DeliveryCallbackEnabled", fmt.Sprint(*params.DeliveryCallbackEnabled)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.ApnCredentialSid != nil { + data.Set("ApnCredentialSid", *params.ApnCredentialSid) + } + if params != nil && params.GcmCredentialSid != nil { + data.Set("GcmCredentialSid", *params.GcmCredentialSid) + } + if params != nil && params.MessagingServiceSid != nil { + data.Set("MessagingServiceSid", *params.MessagingServiceSid) + } + if params != nil && params.FacebookMessengerPageId != nil { + data.Set("FacebookMessengerPageId", *params.FacebookMessengerPageId) + } + if params != nil && params.DefaultApnNotificationProtocolVersion != nil { + data.Set("DefaultApnNotificationProtocolVersion", *params.DefaultApnNotificationProtocolVersion) + } + if params != nil && params.DefaultGcmNotificationProtocolVersion != nil { + data.Set("DefaultGcmNotificationProtocolVersion", *params.DefaultGcmNotificationProtocolVersion) + } + if params != nil && params.FcmCredentialSid != nil { + data.Set("FcmCredentialSid", *params.FcmCredentialSid) + } + if params != nil && params.DefaultFcmNotificationProtocolVersion != nil { + data.Set("DefaultFcmNotificationProtocolVersion", *params.DefaultFcmNotificationProtocolVersion) + } + if params != nil && params.LogEnabled != nil { + data.Set("LogEnabled", fmt.Sprint(*params.LogEnabled)) + } + if params != nil && params.AlexaSkillId != nil { + data.Set("AlexaSkillId", *params.AlexaSkillId) + } + if params != nil && params.DefaultAlexaNotificationProtocolVersion != nil { + data.Set("DefaultAlexaNotificationProtocolVersion", *params.DefaultAlexaNotificationProtocolVersion) + } + if params != nil && params.DeliveryCallbackUrl != nil { + data.Set("DeliveryCallbackUrl", *params.DeliveryCallbackUrl) + } + if params != nil && params.DeliveryCallbackEnabled != nil { + data.Set("DeliveryCallbackEnabled", fmt.Sprint(*params.DeliveryCallbackEnabled)) + } @@ -188,6 +189,7 @@ func (c *ApiService) DeleteService(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -208,6 +210,7 @@ func (c *ApiService) FetchService(Sid string, ) (*NotifyV1Service, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -253,12 +256,13 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe 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)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -466,48 +470,49 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*No data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.ApnCredentialSid != nil { - data.Set("ApnCredentialSid", *params.ApnCredentialSid) -} -if params != nil && params.GcmCredentialSid != nil { - data.Set("GcmCredentialSid", *params.GcmCredentialSid) -} -if params != nil && params.MessagingServiceSid != nil { - data.Set("MessagingServiceSid", *params.MessagingServiceSid) -} -if params != nil && params.FacebookMessengerPageId != nil { - data.Set("FacebookMessengerPageId", *params.FacebookMessengerPageId) -} -if params != nil && params.DefaultApnNotificationProtocolVersion != nil { - data.Set("DefaultApnNotificationProtocolVersion", *params.DefaultApnNotificationProtocolVersion) -} -if params != nil && params.DefaultGcmNotificationProtocolVersion != nil { - data.Set("DefaultGcmNotificationProtocolVersion", *params.DefaultGcmNotificationProtocolVersion) -} -if params != nil && params.FcmCredentialSid != nil { - data.Set("FcmCredentialSid", *params.FcmCredentialSid) -} -if params != nil && params.DefaultFcmNotificationProtocolVersion != nil { - data.Set("DefaultFcmNotificationProtocolVersion", *params.DefaultFcmNotificationProtocolVersion) -} -if params != nil && params.LogEnabled != nil { - data.Set("LogEnabled", fmt.Sprint(*params.LogEnabled)) -} -if params != nil && params.AlexaSkillId != nil { - data.Set("AlexaSkillId", *params.AlexaSkillId) -} -if params != nil && params.DefaultAlexaNotificationProtocolVersion != nil { - data.Set("DefaultAlexaNotificationProtocolVersion", *params.DefaultAlexaNotificationProtocolVersion) -} -if params != nil && params.DeliveryCallbackUrl != nil { - data.Set("DeliveryCallbackUrl", *params.DeliveryCallbackUrl) -} -if params != nil && params.DeliveryCallbackEnabled != nil { - data.Set("DeliveryCallbackEnabled", fmt.Sprint(*params.DeliveryCallbackEnabled)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.ApnCredentialSid != nil { + data.Set("ApnCredentialSid", *params.ApnCredentialSid) + } + if params != nil && params.GcmCredentialSid != nil { + data.Set("GcmCredentialSid", *params.GcmCredentialSid) + } + if params != nil && params.MessagingServiceSid != nil { + data.Set("MessagingServiceSid", *params.MessagingServiceSid) + } + if params != nil && params.FacebookMessengerPageId != nil { + data.Set("FacebookMessengerPageId", *params.FacebookMessengerPageId) + } + if params != nil && params.DefaultApnNotificationProtocolVersion != nil { + data.Set("DefaultApnNotificationProtocolVersion", *params.DefaultApnNotificationProtocolVersion) + } + if params != nil && params.DefaultGcmNotificationProtocolVersion != nil { + data.Set("DefaultGcmNotificationProtocolVersion", *params.DefaultGcmNotificationProtocolVersion) + } + if params != nil && params.FcmCredentialSid != nil { + data.Set("FcmCredentialSid", *params.FcmCredentialSid) + } + if params != nil && params.DefaultFcmNotificationProtocolVersion != nil { + data.Set("DefaultFcmNotificationProtocolVersion", *params.DefaultFcmNotificationProtocolVersion) + } + if params != nil && params.LogEnabled != nil { + data.Set("LogEnabled", fmt.Sprint(*params.LogEnabled)) + } + if params != nil && params.AlexaSkillId != nil { + data.Set("AlexaSkillId", *params.AlexaSkillId) + } + if params != nil && params.DefaultAlexaNotificationProtocolVersion != nil { + data.Set("DefaultAlexaNotificationProtocolVersion", *params.DefaultAlexaNotificationProtocolVersion) + } + if params != nil && params.DeliveryCallbackUrl != nil { + data.Set("DeliveryCallbackUrl", *params.DeliveryCallbackUrl) + } + if params != nil && params.DeliveryCallbackEnabled != nil { + data.Set("DeliveryCallbackEnabled", fmt.Sprint(*params.DeliveryCallbackEnabled)) + } diff --git a/rest/notify/v1/services_bindings.go b/rest/notify/v1/services_bindings.go index f8681f38e..279beabdd 100644 --- a/rest/notify/v1/services_bindings.go +++ b/rest/notify/v1/services_bindings.go @@ -77,29 +77,30 @@ func (c *ApiService) CreateBinding(ServiceSid string, params *CreateBindingParam data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Identity != nil { - data.Set("Identity", *params.Identity) -} -if params != nil && params.BindingType != nil { - data.Set("BindingType", *params.BindingType) -} -if params != nil && params.Address != nil { - data.Set("Address", *params.Address) -} -if params != nil && params.Tag != nil { - for _, item := range *params.Tag { - data.Add("Tag", item) + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.BindingType != nil { + data.Set("BindingType", *params.BindingType) + } + if params != nil && params.Address != nil { + data.Set("Address", *params.Address) + } + if params != nil && params.Tag != nil { + for _, item := range *params.Tag { + data.Add("Tag", item) + } + } + if params != nil && params.NotificationProtocolVersion != nil { + data.Set("NotificationProtocolVersion", *params.NotificationProtocolVersion) + } + if params != nil && params.CredentialSid != nil { + data.Set("CredentialSid", *params.CredentialSid) + } + if params != nil && params.Endpoint != nil { + data.Set("Endpoint", *params.Endpoint) } -} -if params != nil && params.NotificationProtocolVersion != nil { - data.Set("NotificationProtocolVersion", *params.NotificationProtocolVersion) -} -if params != nil && params.CredentialSid != nil { - data.Set("CredentialSid", *params.CredentialSid) -} -if params != nil && params.Endpoint != nil { - data.Set("Endpoint", *params.Endpoint) -} @@ -129,6 +130,7 @@ func (c *ApiService) DeleteBinding(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -150,6 +152,7 @@ func (c *ApiService) FetchBinding(ServiceSid string, Sid string, ) (*NotifyV1Bin + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -214,25 +217,26 @@ func (c *ApiService) PageBinding(ServiceSid string, params *ListBindingParams, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint(*params.StartDate)) -} -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint(*params.EndDate)) -} -if params != nil && params.Identity != nil { - for _, item := range *params.Identity { - data.Add("Identity", item) + + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint(*params.StartDate)) } -} -if params != nil && params.Tag != nil { - for _, item := range *params.Tag { - data.Add("Tag", item) + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint(*params.EndDate)) + } + if params != nil && params.Identity != nil { + for _, item := range *params.Identity { + data.Add("Identity", item) + } + } + if params != nil && params.Tag != nil { + for _, item := range *params.Tag { + data.Add("Tag", item) + } + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) } -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/notify/v1/services_notifications.go b/rest/notify/v1/services_notifications.go index 33518f78e..ce4da39e7 100644 --- a/rest/notify/v1/services_notifications.go +++ b/rest/notify/v1/services_notifications.go @@ -143,110 +143,111 @@ func (c *ApiService) CreateNotification(ServiceSid string, params *CreateNotific data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Body != nil { - data.Set("Body", *params.Body) -} -if params != nil && params.Priority != nil { - data.Set("Priority", *params.Priority) -} -if params != nil && params.Ttl != nil { - data.Set("Ttl", fmt.Sprint(*params.Ttl)) -} -if params != nil && params.Title != nil { - data.Set("Title", *params.Title) -} -if params != nil && params.Sound != nil { - data.Set("Sound", *params.Sound) -} -if params != nil && params.Action != nil { - data.Set("Action", *params.Action) -} -if params != nil && params.Data != nil { - v, err := json.Marshal(params.Data) - if err != nil { - return nil, err + if params != nil && params.Body != nil { + data.Set("Body", *params.Body) + } + if params != nil && params.Priority != nil { + data.Set("Priority", *params.Priority) + } + if params != nil && params.Ttl != nil { + data.Set("Ttl", fmt.Sprint(*params.Ttl)) + } + if params != nil && params.Title != nil { + data.Set("Title", *params.Title) + } + if params != nil && params.Sound != nil { + data.Set("Sound", *params.Sound) } + if params != nil && params.Action != nil { + data.Set("Action", *params.Action) + } + if params != nil && params.Data != nil { + v, err := json.Marshal(params.Data) - data.Set("Data", string(v)) -} -if params != nil && params.Apn != nil { - v, err := json.Marshal(params.Apn) + if err != nil { + return nil, err + } - if err != nil { - return nil, err + data.Set("Data", string(v)) } + if params != nil && params.Apn != nil { + v, err := json.Marshal(params.Apn) - data.Set("Apn", string(v)) -} -if params != nil && params.Gcm != nil { - v, err := json.Marshal(params.Gcm) + if err != nil { + return nil, err + } - if err != nil { - return nil, err + data.Set("Apn", string(v)) } + if params != nil && params.Gcm != nil { + v, err := json.Marshal(params.Gcm) - data.Set("Gcm", string(v)) -} -if params != nil && params.Sms != nil { - v, err := json.Marshal(params.Sms) + if err != nil { + return nil, err + } - if err != nil { - return nil, err + data.Set("Gcm", string(v)) } + if params != nil && params.Sms != nil { + v, err := json.Marshal(params.Sms) - data.Set("Sms", string(v)) -} -if params != nil && params.FacebookMessenger != nil { - v, err := json.Marshal(params.FacebookMessenger) + if err != nil { + return nil, err + } - if err != nil { - return nil, err + data.Set("Sms", string(v)) } + if params != nil && params.FacebookMessenger != nil { + v, err := json.Marshal(params.FacebookMessenger) - data.Set("FacebookMessenger", string(v)) -} -if params != nil && params.Fcm != nil { - v, err := json.Marshal(params.Fcm) + if err != nil { + return nil, err + } - if err != nil { - return nil, err + data.Set("FacebookMessenger", string(v)) } + if params != nil && params.Fcm != nil { + v, err := json.Marshal(params.Fcm) - data.Set("Fcm", string(v)) -} -if params != nil && params.Segment != nil { - for _, item := range *params.Segment { - data.Add("Segment", item) - } -} -if params != nil && params.Alexa != nil { - v, err := json.Marshal(params.Alexa) + if err != nil { + return nil, err + } - if err != nil { - return nil, err + data.Set("Fcm", string(v)) + } + if params != nil && params.Segment != nil { + for _, item := range *params.Segment { + data.Add("Segment", item) + } } + if params != nil && params.Alexa != nil { + v, err := json.Marshal(params.Alexa) - data.Set("Alexa", string(v)) -} -if params != nil && params.ToBinding != nil { - for _, item := range *params.ToBinding { - data.Add("ToBinding", item) + if err != nil { + return nil, err + } + + data.Set("Alexa", string(v)) } -} -if params != nil && params.DeliveryCallbackUrl != nil { - data.Set("DeliveryCallbackUrl", *params.DeliveryCallbackUrl) -} -if params != nil && params.Identity != nil { - for _, item := range *params.Identity { - data.Add("Identity", item) + if params != nil && params.ToBinding != nil { + for _, item := range *params.ToBinding { + data.Add("ToBinding", item) + } + } + if params != nil && params.DeliveryCallbackUrl != nil { + data.Set("DeliveryCallbackUrl", *params.DeliveryCallbackUrl) + } + if params != nil && params.Identity != nil { + for _, item := range *params.Identity { + data.Add("Identity", item) + } + } + if params != nil && params.Tag != nil { + for _, item := range *params.Tag { + data.Add("Tag", item) } -} -if params != nil && params.Tag != nil { - for _, item := range *params.Tag { - data.Add("Tag", item) } -} diff --git a/rest/numbers/v1/hosted_number_eligibility_bulk.go b/rest/numbers/v1/hosted_number_eligibility_bulk.go index eeda4864e..497215400 100644 --- a/rest/numbers/v1/hosted_number_eligibility_bulk.go +++ b/rest/numbers/v1/hosted_number_eligibility_bulk.go @@ -32,6 +32,7 @@ func (c *ApiService) CreateBulkEligibility() (*NumbersV1BulkEligibility, error) + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -57,6 +58,7 @@ func (c *ApiService) FetchBulkEligibility(RequestId string, ) (*NumbersV1BulkEli + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/numbers/v1/porting_portability.go b/rest/numbers/v1/porting_portability.go index ca37b8f60..a25becee7 100644 --- a/rest/numbers/v1/porting_portability.go +++ b/rest/numbers/v1/porting_portability.go @@ -40,11 +40,12 @@ func (c *ApiService) CreatePortingBulkPortability(params *CreatePortingBulkPorta data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PhoneNumbers != nil { - for _, item := range *params.PhoneNumbers { - data.Add("PhoneNumbers", item) + + if params != nil && params.PhoneNumbers != nil { + for _, item := range *params.PhoneNumbers { + data.Add("PhoneNumbers", item) + } } -} @@ -73,6 +74,7 @@ func (c *ApiService) FetchPortingBulkPortability(Sid string, ) (*NumbersV1Portin + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/numbers/v1/porting_portability_phone_number.go b/rest/numbers/v1/porting_portability_phone_number.go index 046b611c1..ebdec3fe8 100644 --- a/rest/numbers/v1/porting_portability_phone_number.go +++ b/rest/numbers/v1/porting_portability_phone_number.go @@ -41,9 +41,10 @@ func (c *ApiService) FetchPortingPortability(PhoneNumber string, params *FetchPo data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.TargetAccountSid != nil { - data.Set("TargetAccountSid", *params.TargetAccountSid) -} + + if params != nil && params.TargetAccountSid != nil { + data.Set("TargetAccountSid", *params.TargetAccountSid) + } diff --git a/rest/numbers/v2/hosted_number_authorization_documents.go b/rest/numbers/v2/hosted_number_authorization_documents.go index 69a8114be..c57eff417 100644 --- a/rest/numbers/v2/hosted_number_authorization_documents.go +++ b/rest/numbers/v2/hosted_number_authorization_documents.go @@ -70,28 +70,29 @@ func (c *ApiService) CreateAuthorizationDocument(params *CreateAuthorizationDocu data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.AddressSid != nil { - data.Set("AddressSid", *params.AddressSid) -} -if params != nil && params.Email != nil { - data.Set("Email", *params.Email) -} -if params != nil && params.ContactPhoneNumber != nil { - data.Set("ContactPhoneNumber", *params.ContactPhoneNumber) -} -if params != nil && params.HostedNumberOrderSids != nil { - for _, item := range *params.HostedNumberOrderSids { - data.Add("HostedNumberOrderSids", item) + + if params != nil && params.AddressSid != nil { + data.Set("AddressSid", *params.AddressSid) + } + if params != nil && params.Email != nil { + data.Set("Email", *params.Email) + } + if params != nil && params.ContactPhoneNumber != nil { + data.Set("ContactPhoneNumber", *params.ContactPhoneNumber) + } + if params != nil && params.HostedNumberOrderSids != nil { + for _, item := range *params.HostedNumberOrderSids { + data.Add("HostedNumberOrderSids", item) + } + } + if params != nil && params.ContactTitle != nil { + data.Set("ContactTitle", *params.ContactTitle) + } + if params != nil && params.CcEmails != nil { + for _, item := range *params.CcEmails { + data.Add("CcEmails", item) } -} -if params != nil && params.ContactTitle != nil { - data.Set("ContactTitle", *params.ContactTitle) -} -if params != nil && params.CcEmails != nil { - for _, item := range *params.CcEmails { - data.Add("CcEmails", item) } -} @@ -120,6 +121,7 @@ func (c *ApiService) DeleteAuthorizationDocument(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -140,6 +142,7 @@ func (c *ApiService) FetchAuthorizationDocument(Sid string, ) (*NumbersV2Authori + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -191,15 +194,16 @@ func (c *ApiService) PageAuthorizationDocument(params *ListAuthorizationDocument data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Email != nil { - data.Set("Email", *params.Email) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Email != nil { + data.Set("Email", *params.Email) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/numbers/v2/hosted_number_authorization_documents_dependent_hosted_number_orders.go b/rest/numbers/v2/hosted_number_authorization_documents_dependent_hosted_number_orders.go index 5771e52a0..9304df97e 100644 --- a/rest/numbers/v2/hosted_number_authorization_documents_dependent_hosted_number_orders.go +++ b/rest/numbers/v2/hosted_number_authorization_documents_dependent_hosted_number_orders.go @@ -72,21 +72,22 @@ func (c *ApiService) PageDependentHostedNumberOrder(SigningDocumentSid string, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) -} -if params != nil && params.IncomingPhoneNumberSid != nil { - data.Set("IncomingPhoneNumberSid", *params.IncomingPhoneNumberSid) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.PhoneNumber != nil { + data.Set("PhoneNumber", *params.PhoneNumber) + } + if params != nil && params.IncomingPhoneNumberSid != nil { + data.Set("IncomingPhoneNumberSid", *params.IncomingPhoneNumberSid) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/numbers/v2/hosted_number_orders.go b/rest/numbers/v2/hosted_number_orders.go index 761bba44a..2e254fb20 100644 --- a/rest/numbers/v2/hosted_number_orders.go +++ b/rest/numbers/v2/hosted_number_orders.go @@ -130,56 +130,57 @@ func (c *ApiService) CreateHostedNumberOrder(params *CreateHostedNumberOrderPara data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) -} -if params != nil && params.ContactPhoneNumber != nil { - data.Set("ContactPhoneNumber", *params.ContactPhoneNumber) -} -if params != nil && params.AddressSid != nil { - data.Set("AddressSid", *params.AddressSid) -} -if params != nil && params.Email != nil { - data.Set("Email", *params.Email) -} -if params != nil && params.AccountSid != nil { - data.Set("AccountSid", *params.AccountSid) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.CcEmails != nil { - for _, item := range *params.CcEmails { - data.Add("CcEmails", item) + + if params != nil && params.PhoneNumber != nil { + data.Set("PhoneNumber", *params.PhoneNumber) + } + if params != nil && params.ContactPhoneNumber != nil { + data.Set("ContactPhoneNumber", *params.ContactPhoneNumber) + } + if params != nil && params.AddressSid != nil { + data.Set("AddressSid", *params.AddressSid) + } + if params != nil && params.Email != nil { + data.Set("Email", *params.Email) + } + if params != nil && params.AccountSid != nil { + data.Set("AccountSid", *params.AccountSid) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.CcEmails != nil { + for _, item := range *params.CcEmails { + data.Add("CcEmails", item) + } + } + if params != nil && params.SmsUrl != nil { + data.Set("SmsUrl", *params.SmsUrl) + } + if params != nil && params.SmsMethod != nil { + data.Set("SmsMethod", *params.SmsMethod) + } + if params != nil && params.SmsFallbackUrl != nil { + data.Set("SmsFallbackUrl", *params.SmsFallbackUrl) + } + if params != nil && params.SmsCapability != nil { + data.Set("SmsCapability", fmt.Sprint(*params.SmsCapability)) + } + if params != nil && params.SmsFallbackMethod != nil { + data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) + } + if params != nil && params.StatusCallbackUrl != nil { + data.Set("StatusCallbackUrl", *params.StatusCallbackUrl) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.SmsApplicationSid != nil { + data.Set("SmsApplicationSid", *params.SmsApplicationSid) + } + if params != nil && params.ContactTitle != nil { + data.Set("ContactTitle", *params.ContactTitle) } -} -if params != nil && params.SmsUrl != nil { - data.Set("SmsUrl", *params.SmsUrl) -} -if params != nil && params.SmsMethod != nil { - data.Set("SmsMethod", *params.SmsMethod) -} -if params != nil && params.SmsFallbackUrl != nil { - data.Set("SmsFallbackUrl", *params.SmsFallbackUrl) -} -if params != nil && params.SmsCapability != nil { - data.Set("SmsCapability", fmt.Sprint(*params.SmsCapability)) -} -if params != nil && params.SmsFallbackMethod != nil { - data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) -} -if params != nil && params.StatusCallbackUrl != nil { - data.Set("StatusCallbackUrl", *params.StatusCallbackUrl) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.SmsApplicationSid != nil { - data.Set("SmsApplicationSid", *params.SmsApplicationSid) -} -if params != nil && params.ContactTitle != nil { - data.Set("ContactTitle", *params.ContactTitle) -} @@ -208,6 +209,7 @@ func (c *ApiService) DeleteHostedNumberOrder(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -228,6 +230,7 @@ func (c *ApiService) FetchHostedNumberOrder(Sid string, ) (*NumbersV2HostedNumbe + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -297,24 +300,25 @@ func (c *ApiService) PageHostedNumberOrder(params *ListHostedNumberOrderParams, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.SmsCapability != nil { - data.Set("SmsCapability", fmt.Sprint(*params.SmsCapability)) -} -if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) -} -if params != nil && params.IncomingPhoneNumberSid != nil { - data.Set("IncomingPhoneNumberSid", *params.IncomingPhoneNumberSid) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.SmsCapability != nil { + data.Set("SmsCapability", fmt.Sprint(*params.SmsCapability)) + } + if params != nil && params.PhoneNumber != nil { + data.Set("PhoneNumber", *params.PhoneNumber) + } + if params != nil && params.IncomingPhoneNumberSid != nil { + data.Set("IncomingPhoneNumberSid", *params.IncomingPhoneNumberSid) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/numbers/v2/hosted_number_orders_bulk.go b/rest/numbers/v2/hosted_number_orders_bulk.go index 855db55ec..f548932cb 100644 --- a/rest/numbers/v2/hosted_number_orders_bulk.go +++ b/rest/numbers/v2/hosted_number_orders_bulk.go @@ -32,6 +32,7 @@ func (c *ApiService) CreateBulkHostedNumberOrder() (*NumbersV2BulkHostedNumberOr + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -65,9 +66,10 @@ func (c *ApiService) FetchBulkHostedNumberOrder(BulkHostingSid string, params *F data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.OrderStatus != nil { - data.Set("OrderStatus", *params.OrderStatus) -} + + if params != nil && params.OrderStatus != nil { + data.Set("OrderStatus", *params.OrderStatus) + } diff --git a/rest/numbers/v2/regulatory_compliance_bundles.go b/rest/numbers/v2/regulatory_compliance_bundles.go index dc11598d9..cb8944e9b 100644 --- a/rest/numbers/v2/regulatory_compliance_bundles.go +++ b/rest/numbers/v2/regulatory_compliance_bundles.go @@ -76,27 +76,28 @@ func (c *ApiService) CreateBundle(params *CreateBundleParams) (*NumbersV2Bundle, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Email != nil { - data.Set("Email", *params.Email) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.RegulationSid != nil { - data.Set("RegulationSid", *params.RegulationSid) -} -if params != nil && params.IsoCountry != nil { - data.Set("IsoCountry", *params.IsoCountry) -} -if params != nil && params.EndUserType != nil { - data.Set("EndUserType", *params.EndUserType) -} -if params != nil && params.NumberType != nil { - data.Set("NumberType", *params.NumberType) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Email != nil { + data.Set("Email", *params.Email) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.RegulationSid != nil { + data.Set("RegulationSid", *params.RegulationSid) + } + if params != nil && params.IsoCountry != nil { + data.Set("IsoCountry", *params.IsoCountry) + } + if params != nil && params.EndUserType != nil { + data.Set("EndUserType", *params.EndUserType) + } + if params != nil && params.NumberType != nil { + data.Set("NumberType", *params.NumberType) + } @@ -125,6 +126,7 @@ func (c *ApiService) DeleteBundle(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -145,6 +147,7 @@ func (c *ApiService) FetchBundle(Sid string, ) (*NumbersV2Bundle, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -238,36 +241,37 @@ func (c *ApiService) PageBundle(params *ListBundleParams, pageToken, pageNumber data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.RegulationSid != nil { - data.Set("RegulationSid", *params.RegulationSid) -} -if params != nil && params.IsoCountry != nil { - data.Set("IsoCountry", *params.IsoCountry) -} -if params != nil && params.NumberType != nil { - data.Set("NumberType", *params.NumberType) -} -if params != nil && params.HasValidUntilDate != nil { - data.Set("HasValidUntilDate", fmt.Sprint(*params.HasValidUntilDate)) -} -if params != nil && params.SortBy != nil { - data.Set("SortBy", *params.SortBy) -} -if params != nil && params.SortDirection != nil { - data.Set("SortDirection", *params.SortDirection) -} -if params != nil && params.ValidUntilDate != nil { - data.Set("ValidUntilDate", fmt.Sprint((*params.ValidUntilDate).Format(time.RFC3339))) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.RegulationSid != nil { + data.Set("RegulationSid", *params.RegulationSid) + } + if params != nil && params.IsoCountry != nil { + data.Set("IsoCountry", *params.IsoCountry) + } + if params != nil && params.NumberType != nil { + data.Set("NumberType", *params.NumberType) + } + if params != nil && params.HasValidUntilDate != nil { + data.Set("HasValidUntilDate", fmt.Sprint(*params.HasValidUntilDate)) + } + if params != nil && params.SortBy != nil { + data.Set("SortBy", *params.SortBy) + } + if params != nil && params.SortDirection != nil { + data.Set("SortDirection", *params.SortDirection) + } + if params != nil && params.ValidUntilDate != nil { + data.Set("ValidUntilDate", fmt.Sprint((*params.ValidUntilDate).Format(time.RFC3339))) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -415,18 +419,19 @@ func (c *ApiService) UpdateBundle(Sid string, params *UpdateBundleParams) (*Numb data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Email != nil { - data.Set("Email", *params.Email) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Email != nil { + data.Set("Email", *params.Email) + } diff --git a/rest/numbers/v2/regulatory_compliance_bundles_copies.go b/rest/numbers/v2/regulatory_compliance_bundles_copies.go index e76c45706..4f3225743 100644 --- a/rest/numbers/v2/regulatory_compliance_bundles_copies.go +++ b/rest/numbers/v2/regulatory_compliance_bundles_copies.go @@ -41,9 +41,10 @@ func (c *ApiService) CreateBundleCopy(BundleSid string, params *CreateBundleCopy data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } @@ -87,9 +88,10 @@ func (c *ApiService) PageBundleCopy(BundleSid string, params *ListBundleCopyPara data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/numbers/v2/regulatory_compliance_bundles_evaluations.go b/rest/numbers/v2/regulatory_compliance_bundles_evaluations.go index 49fc55a2d..d8559c1a7 100644 --- a/rest/numbers/v2/regulatory_compliance_bundles_evaluations.go +++ b/rest/numbers/v2/regulatory_compliance_bundles_evaluations.go @@ -33,6 +33,7 @@ func (c *ApiService) CreateEvaluation(BundleSid string, ) (*NumbersV2Evaluation, + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -59,6 +60,7 @@ func (c *ApiService) FetchEvaluation(BundleSid string, Sid string, ) (*NumbersV2 + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -99,9 +101,10 @@ func (c *ApiService) PageEvaluation(BundleSid string, params *ListEvaluationPara data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/numbers/v2/regulatory_compliance_bundles_item_assignments.go b/rest/numbers/v2/regulatory_compliance_bundles_item_assignments.go index 4c5c88f6d..ca320e715 100644 --- a/rest/numbers/v2/regulatory_compliance_bundles_item_assignments.go +++ b/rest/numbers/v2/regulatory_compliance_bundles_item_assignments.go @@ -41,9 +41,10 @@ func (c *ApiService) CreateItemAssignment(BundleSid string, params *CreateItemAs data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ObjectSid != nil { - data.Set("ObjectSid", *params.ObjectSid) -} + + if params != nil && params.ObjectSid != nil { + data.Set("ObjectSid", *params.ObjectSid) + } @@ -73,6 +74,7 @@ func (c *ApiService) DeleteItemAssignment(BundleSid string, Sid string, ) (error + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -94,6 +96,7 @@ func (c *ApiService) FetchItemAssignment(BundleSid string, Sid string, ) (*Numbe + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -134,9 +137,10 @@ func (c *ApiService) PageItemAssignment(BundleSid string, params *ListItemAssign data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/numbers/v2/regulatory_compliance_bundles_replace_items.go b/rest/numbers/v2/regulatory_compliance_bundles_replace_items.go index 63e47ad27..55bf2e837 100644 --- a/rest/numbers/v2/regulatory_compliance_bundles_replace_items.go +++ b/rest/numbers/v2/regulatory_compliance_bundles_replace_items.go @@ -41,9 +41,10 @@ func (c *ApiService) CreateReplaceItems(BundleSid string, params *CreateReplaceI data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FromBundleSid != nil { - data.Set("FromBundleSid", *params.FromBundleSid) -} + + if params != nil && params.FromBundleSid != nil { + data.Set("FromBundleSid", *params.FromBundleSid) + } diff --git a/rest/numbers/v2/regulatory_compliance_end_user_types.go b/rest/numbers/v2/regulatory_compliance_end_user_types.go index 70f0f0d2a..cea11ce39 100644 --- a/rest/numbers/v2/regulatory_compliance_end_user_types.go +++ b/rest/numbers/v2/regulatory_compliance_end_user_types.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchEndUserType(Sid string, ) (*NumbersV2EndUserType, erro + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -72,9 +73,10 @@ func (c *ApiService) PageEndUserType(params *ListEndUserTypeParams, pageToken, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/numbers/v2/regulatory_compliance_end_users.go b/rest/numbers/v2/regulatory_compliance_end_users.go index 8bec93bed..3b6584939 100644 --- a/rest/numbers/v2/regulatory_compliance_end_users.go +++ b/rest/numbers/v2/regulatory_compliance_end_users.go @@ -52,21 +52,22 @@ func (c *ApiService) CreateEndUser(params *CreateEndUserParams) (*NumbersV2EndUs data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.Attributes != nil { - v, err := json.Marshal(params.Attributes) - if err != nil { - return nil, err + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) } + if params != nil && params.Attributes != nil { + v, err := json.Marshal(params.Attributes) - data.Set("Attributes", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Attributes", string(v)) + } @@ -95,6 +96,7 @@ func (c *ApiService) DeleteEndUser(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -115,6 +117,7 @@ func (c *ApiService) FetchEndUser(Sid string, ) (*NumbersV2EndUser, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -154,9 +157,10 @@ func (c *ApiService) PageEndUser(params *ListEndUserParams, pageToken, pageNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -292,18 +296,19 @@ func (c *ApiService) UpdateEndUser(Sid string, params *UpdateEndUserParams) (*Nu data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Attributes != nil { - v, err := json.Marshal(params.Attributes) - if err != nil { - return nil, err + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) } + if params != nil && params.Attributes != nil { + v, err := json.Marshal(params.Attributes) - data.Set("Attributes", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Attributes", string(v)) + } diff --git a/rest/numbers/v2/regulatory_compliance_regulations.go b/rest/numbers/v2/regulatory_compliance_regulations.go index d1c37a3e6..ccfaaad34 100644 --- a/rest/numbers/v2/regulatory_compliance_regulations.go +++ b/rest/numbers/v2/regulatory_compliance_regulations.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchRegulation(Sid string, ) (*NumbersV2Regulation, error) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -90,18 +91,19 @@ func (c *ApiService) PageRegulation(params *ListRegulationParams, pageToken, pag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.EndUserType != nil { - data.Set("EndUserType", *params.EndUserType) -} -if params != nil && params.IsoCountry != nil { - data.Set("IsoCountry", *params.IsoCountry) -} -if params != nil && params.NumberType != nil { - data.Set("NumberType", *params.NumberType) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.EndUserType != nil { + data.Set("EndUserType", *params.EndUserType) + } + if params != nil && params.IsoCountry != nil { + data.Set("IsoCountry", *params.IsoCountry) + } + if params != nil && params.NumberType != nil { + data.Set("NumberType", *params.NumberType) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/numbers/v2/regulatory_compliance_supporting_document_types.go b/rest/numbers/v2/regulatory_compliance_supporting_document_types.go index ca48edebf..9e6c8b999 100644 --- a/rest/numbers/v2/regulatory_compliance_supporting_document_types.go +++ b/rest/numbers/v2/regulatory_compliance_supporting_document_types.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchSupportingDocumentType(Sid string, ) (*NumbersV2Suppor + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -72,9 +73,10 @@ func (c *ApiService) PageSupportingDocumentType(params *ListSupportingDocumentTy data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/numbers/v2/regulatory_compliance_supporting_documents.go b/rest/numbers/v2/regulatory_compliance_supporting_documents.go index b6dc7a7dd..3bb3cc4e7 100644 --- a/rest/numbers/v2/regulatory_compliance_supporting_documents.go +++ b/rest/numbers/v2/regulatory_compliance_supporting_documents.go @@ -52,21 +52,22 @@ func (c *ApiService) CreateSupportingDocument(params *CreateSupportingDocumentPa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.Attributes != nil { - v, err := json.Marshal(params.Attributes) - if err != nil { - return nil, err + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) } + if params != nil && params.Attributes != nil { + v, err := json.Marshal(params.Attributes) - data.Set("Attributes", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Attributes", string(v)) + } @@ -95,6 +96,7 @@ func (c *ApiService) DeleteSupportingDocument(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -115,6 +117,7 @@ func (c *ApiService) FetchSupportingDocument(Sid string, ) (*NumbersV2Supporting + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -154,9 +157,10 @@ func (c *ApiService) PageSupportingDocument(params *ListSupportingDocumentParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -292,18 +296,19 @@ func (c *ApiService) UpdateSupportingDocument(Sid string, params *UpdateSupporti data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Attributes != nil { - v, err := json.Marshal(params.Attributes) - if err != nil { - return nil, err + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) } + if params != nil && params.Attributes != nil { + v, err := json.Marshal(params.Attributes) - data.Set("Attributes", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Attributes", string(v)) + } diff --git a/rest/oauth/v1/certs.go b/rest/oauth/v1/certs.go index 04635dc4a..74d675118 100644 --- a/rest/oauth/v1/certs.go +++ b/rest/oauth/v1/certs.go @@ -32,6 +32,7 @@ func (c *ApiService) FetchCerts() (*OauthV1Certs, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/oauth/v1/device_code.go b/rest/oauth/v1/device_code.go index 71e803fc8..ef8c46a2b 100644 --- a/rest/oauth/v1/device_code.go +++ b/rest/oauth/v1/device_code.go @@ -52,19 +52,20 @@ func (c *ApiService) CreateDeviceCode(params *CreateDeviceCodeParams) (*OauthV1D data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ClientSid != nil { - data.Set("ClientSid", *params.ClientSid) -} -if params != nil && params.Scopes != nil { - for _, item := range *params.Scopes { - data.Add("Scopes", item) + + if params != nil && params.ClientSid != nil { + data.Set("ClientSid", *params.ClientSid) + } + if params != nil && params.Scopes != nil { + for _, item := range *params.Scopes { + data.Add("Scopes", item) + } + } + if params != nil && params.Audiences != nil { + for _, item := range *params.Audiences { + data.Add("Audiences", item) } -} -if params != nil && params.Audiences != nil { - for _, item := range *params.Audiences { - data.Add("Audiences", item) } -} diff --git a/rest/oauth/v1/token.go b/rest/oauth/v1/token.go index 6fed8906f..82d0183d2 100644 --- a/rest/oauth/v1/token.go +++ b/rest/oauth/v1/token.go @@ -82,30 +82,31 @@ func (c *ApiService) CreateToken(params *CreateTokenParams) (*OauthV1Token, erro data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.GrantType != nil { - data.Set("GrantType", *params.GrantType) -} -if params != nil && params.ClientSid != nil { - data.Set("ClientSid", *params.ClientSid) -} -if params != nil && params.ClientSecret != nil { - data.Set("ClientSecret", *params.ClientSecret) -} -if params != nil && params.Code != nil { - data.Set("Code", *params.Code) -} -if params != nil && params.CodeVerifier != nil { - data.Set("CodeVerifier", *params.CodeVerifier) -} -if params != nil && params.DeviceCode != nil { - data.Set("DeviceCode", *params.DeviceCode) -} -if params != nil && params.RefreshToken != nil { - data.Set("RefreshToken", *params.RefreshToken) -} -if params != nil && params.DeviceId != nil { - data.Set("DeviceId", *params.DeviceId) -} + + if params != nil && params.GrantType != nil { + data.Set("GrantType", *params.GrantType) + } + if params != nil && params.ClientSid != nil { + data.Set("ClientSid", *params.ClientSid) + } + if params != nil && params.ClientSecret != nil { + data.Set("ClientSecret", *params.ClientSecret) + } + if params != nil && params.Code != nil { + data.Set("Code", *params.Code) + } + if params != nil && params.CodeVerifier != nil { + data.Set("CodeVerifier", *params.CodeVerifier) + } + if params != nil && params.DeviceCode != nil { + data.Set("DeviceCode", *params.DeviceCode) + } + if params != nil && params.RefreshToken != nil { + data.Set("RefreshToken", *params.RefreshToken) + } + if params != nil && params.DeviceId != nil { + data.Set("DeviceId", *params.DeviceId) + } diff --git a/rest/oauth/v1/userinfo.go b/rest/oauth/v1/userinfo.go index d9fa84768..46b31a081 100644 --- a/rest/oauth/v1/userinfo.go +++ b/rest/oauth/v1/userinfo.go @@ -32,6 +32,7 @@ func (c *ApiService) FetchUserInfo() (*OauthV1UserInfo, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/oauth/v1/well_known_openid_configuration.go b/rest/oauth/v1/well_known_openid_configuration.go index 7be1a739a..acca6c71a 100644 --- a/rest/oauth/v1/well_known_openid_configuration.go +++ b/rest/oauth/v1/well_known_openid_configuration.go @@ -32,6 +32,7 @@ func (c *ApiService) FetchOpenidDiscovery() (*OauthV1OpenidDiscovery, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/pricing/v1/messaging_countries.go b/rest/pricing/v1/messaging_countries.go index 371683d78..958ce51ab 100644 --- a/rest/pricing/v1/messaging_countries.go +++ b/rest/pricing/v1/messaging_countries.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchMessagingCountry(IsoCountry string, ) (*PricingV1Messa + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -72,9 +73,10 @@ func (c *ApiService) PageMessagingCountry(params *ListMessagingCountryParams, pa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/pricing/v1/phone_numbers_countries.go b/rest/pricing/v1/phone_numbers_countries.go index d179324e7..8a6eb2cbc 100644 --- a/rest/pricing/v1/phone_numbers_countries.go +++ b/rest/pricing/v1/phone_numbers_countries.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchPhoneNumberCountry(IsoCountry string, ) (*PricingV1Pho + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -72,9 +73,10 @@ func (c *ApiService) PagePhoneNumberCountry(params *ListPhoneNumberCountryParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/pricing/v1/voice_countries.go b/rest/pricing/v1/voice_countries.go index 5add7f553..b890eaa18 100644 --- a/rest/pricing/v1/voice_countries.go +++ b/rest/pricing/v1/voice_countries.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchVoiceCountry(IsoCountry string, ) (*PricingV1VoiceCoun + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -72,9 +73,10 @@ func (c *ApiService) PageVoiceCountry(params *ListVoiceCountryParams, pageToken, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/pricing/v1/voice_numbers.go b/rest/pricing/v1/voice_numbers.go index 4d22cb846..4b7f85874 100644 --- a/rest/pricing/v1/voice_numbers.go +++ b/rest/pricing/v1/voice_numbers.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchVoiceNumber(Number string, ) (*PricingV1VoiceNumber, e + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/pricing/v2/trunking_countries.go b/rest/pricing/v2/trunking_countries.go index 0f6ffef9e..3c0aafd79 100644 --- a/rest/pricing/v2/trunking_countries.go +++ b/rest/pricing/v2/trunking_countries.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchTrunkingCountry(IsoCountry string, ) (*PricingV2Trunki + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -72,9 +73,10 @@ func (c *ApiService) PageTrunkingCountry(params *ListTrunkingCountryParams, page data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/pricing/v2/trunking_numbers.go b/rest/pricing/v2/trunking_numbers.go index 496eee137..e46a19ae1 100644 --- a/rest/pricing/v2/trunking_numbers.go +++ b/rest/pricing/v2/trunking_numbers.go @@ -41,9 +41,10 @@ func (c *ApiService) FetchTrunkingNumber(DestinationNumber string, params *Fetch data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.OriginationNumber != nil { - data.Set("OriginationNumber", *params.OriginationNumber) -} + + if params != nil && params.OriginationNumber != nil { + data.Set("OriginationNumber", *params.OriginationNumber) + } diff --git a/rest/pricing/v2/voice_countries.go b/rest/pricing/v2/voice_countries.go index 52bd54a39..2b3dec30f 100644 --- a/rest/pricing/v2/voice_countries.go +++ b/rest/pricing/v2/voice_countries.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchVoiceCountry(IsoCountry string, ) (*PricingV2VoiceCoun + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -72,9 +73,10 @@ func (c *ApiService) PageVoiceCountry(params *ListVoiceCountryParams, pageToken, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/pricing/v2/voice_numbers.go b/rest/pricing/v2/voice_numbers.go index 5eee4102c..b0e30631d 100644 --- a/rest/pricing/v2/voice_numbers.go +++ b/rest/pricing/v2/voice_numbers.go @@ -41,9 +41,10 @@ func (c *ApiService) FetchVoiceNumber(DestinationNumber string, params *FetchVoi data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.OriginationNumber != nil { - data.Set("OriginationNumber", *params.OriginationNumber) -} + + if params != nil && params.OriginationNumber != nil { + data.Set("OriginationNumber", *params.OriginationNumber) + } diff --git a/rest/proxy/v1/services.go b/rest/proxy/v1/services.go index 0256e7526..dc4be50f0 100644 --- a/rest/proxy/v1/services.go +++ b/rest/proxy/v1/services.go @@ -82,30 +82,31 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ProxyV1Service data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.DefaultTtl != nil { - data.Set("DefaultTtl", fmt.Sprint(*params.DefaultTtl)) -} -if params != nil && params.CallbackUrl != nil { - data.Set("CallbackUrl", *params.CallbackUrl) -} -if params != nil && params.GeoMatchLevel != nil { - data.Set("GeoMatchLevel", *params.GeoMatchLevel) -} -if params != nil && params.NumberSelectionBehavior != nil { - data.Set("NumberSelectionBehavior", *params.NumberSelectionBehavior) -} -if params != nil && params.InterceptCallbackUrl != nil { - data.Set("InterceptCallbackUrl", *params.InterceptCallbackUrl) -} -if params != nil && params.OutOfSessionCallbackUrl != nil { - data.Set("OutOfSessionCallbackUrl", *params.OutOfSessionCallbackUrl) -} -if params != nil && params.ChatInstanceSid != nil { - data.Set("ChatInstanceSid", *params.ChatInstanceSid) -} + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.DefaultTtl != nil { + data.Set("DefaultTtl", fmt.Sprint(*params.DefaultTtl)) + } + if params != nil && params.CallbackUrl != nil { + data.Set("CallbackUrl", *params.CallbackUrl) + } + if params != nil && params.GeoMatchLevel != nil { + data.Set("GeoMatchLevel", *params.GeoMatchLevel) + } + if params != nil && params.NumberSelectionBehavior != nil { + data.Set("NumberSelectionBehavior", *params.NumberSelectionBehavior) + } + if params != nil && params.InterceptCallbackUrl != nil { + data.Set("InterceptCallbackUrl", *params.InterceptCallbackUrl) + } + if params != nil && params.OutOfSessionCallbackUrl != nil { + data.Set("OutOfSessionCallbackUrl", *params.OutOfSessionCallbackUrl) + } + if params != nil && params.ChatInstanceSid != nil { + data.Set("ChatInstanceSid", *params.ChatInstanceSid) + } @@ -134,6 +135,7 @@ func (c *ApiService) DeleteService(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -154,6 +156,7 @@ func (c *ApiService) FetchService(Sid string, ) (*ProxyV1Service, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -193,9 +196,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -367,30 +371,31 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Pr data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.DefaultTtl != nil { - data.Set("DefaultTtl", fmt.Sprint(*params.DefaultTtl)) -} -if params != nil && params.CallbackUrl != nil { - data.Set("CallbackUrl", *params.CallbackUrl) -} -if params != nil && params.GeoMatchLevel != nil { - data.Set("GeoMatchLevel", *params.GeoMatchLevel) -} -if params != nil && params.NumberSelectionBehavior != nil { - data.Set("NumberSelectionBehavior", *params.NumberSelectionBehavior) -} -if params != nil && params.InterceptCallbackUrl != nil { - data.Set("InterceptCallbackUrl", *params.InterceptCallbackUrl) -} -if params != nil && params.OutOfSessionCallbackUrl != nil { - data.Set("OutOfSessionCallbackUrl", *params.OutOfSessionCallbackUrl) -} -if params != nil && params.ChatInstanceSid != nil { - data.Set("ChatInstanceSid", *params.ChatInstanceSid) -} + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.DefaultTtl != nil { + data.Set("DefaultTtl", fmt.Sprint(*params.DefaultTtl)) + } + if params != nil && params.CallbackUrl != nil { + data.Set("CallbackUrl", *params.CallbackUrl) + } + if params != nil && params.GeoMatchLevel != nil { + data.Set("GeoMatchLevel", *params.GeoMatchLevel) + } + if params != nil && params.NumberSelectionBehavior != nil { + data.Set("NumberSelectionBehavior", *params.NumberSelectionBehavior) + } + if params != nil && params.InterceptCallbackUrl != nil { + data.Set("InterceptCallbackUrl", *params.InterceptCallbackUrl) + } + if params != nil && params.OutOfSessionCallbackUrl != nil { + data.Set("OutOfSessionCallbackUrl", *params.OutOfSessionCallbackUrl) + } + if params != nil && params.ChatInstanceSid != nil { + data.Set("ChatInstanceSid", *params.ChatInstanceSid) + } diff --git a/rest/proxy/v1/services_phone_numbers.go b/rest/proxy/v1/services_phone_numbers.go index e9c0bd826..1f5919295 100644 --- a/rest/proxy/v1/services_phone_numbers.go +++ b/rest/proxy/v1/services_phone_numbers.go @@ -53,15 +53,16 @@ func (c *ApiService) CreatePhoneNumber(ServiceSid string, params *CreatePhoneNum data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Sid != nil { - data.Set("Sid", *params.Sid) -} -if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) -} -if params != nil && params.IsReserved != nil { - data.Set("IsReserved", fmt.Sprint(*params.IsReserved)) -} + + if params != nil && params.Sid != nil { + data.Set("Sid", *params.Sid) + } + if params != nil && params.PhoneNumber != nil { + data.Set("PhoneNumber", *params.PhoneNumber) + } + if params != nil && params.IsReserved != nil { + data.Set("IsReserved", fmt.Sprint(*params.IsReserved)) + } @@ -91,6 +92,7 @@ func (c *ApiService) DeletePhoneNumber(ServiceSid string, Sid string, ) (error) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -112,6 +114,7 @@ func (c *ApiService) FetchPhoneNumber(ServiceSid string, Sid string, ) (*ProxyV1 + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -152,9 +155,10 @@ func (c *ApiService) PagePhoneNumber(ServiceSid string, params *ListPhoneNumberP data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -285,9 +289,10 @@ func (c *ApiService) UpdatePhoneNumber(ServiceSid string, Sid string, params *Up data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.IsReserved != nil { - data.Set("IsReserved", fmt.Sprint(*params.IsReserved)) -} + + if params != nil && params.IsReserved != nil { + data.Set("IsReserved", fmt.Sprint(*params.IsReserved)) + } diff --git a/rest/proxy/v1/services_sessions.go b/rest/proxy/v1/services_sessions.go index 3cb868f21..2f9b7d131 100644 --- a/rest/proxy/v1/services_sessions.go +++ b/rest/proxy/v1/services_sessions.go @@ -71,32 +71,33 @@ func (c *ApiService) CreateSession(ServiceSid string, params *CreateSessionParam data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.DateExpiry != nil { - data.Set("DateExpiry", fmt.Sprint((*params.DateExpiry).Format(time.RFC3339))) -} -if params != nil && params.Ttl != nil { - data.Set("Ttl", fmt.Sprint(*params.Ttl)) -} -if params != nil && params.Mode != nil { - data.Set("Mode", *params.Mode) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.Participants != nil { - for _, item := range *params.Participants { - v, err := json.Marshal(item) - if err != nil { - return nil, err - } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.DateExpiry != nil { + data.Set("DateExpiry", fmt.Sprint((*params.DateExpiry).Format(time.RFC3339))) + } + if params != nil && params.Ttl != nil { + data.Set("Ttl", fmt.Sprint(*params.Ttl)) + } + if params != nil && params.Mode != nil { + data.Set("Mode", *params.Mode) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.Participants != nil { + for _, item := range *params.Participants { + v, err := json.Marshal(item) - data.Add("Participants", string(v)) + if err != nil { + return nil, err + } + + data.Add("Participants", string(v)) + } } -} @@ -126,6 +127,7 @@ func (c *ApiService) DeleteSession(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -147,6 +149,7 @@ func (c *ApiService) FetchSession(ServiceSid string, Sid string, ) (*ProxyV1Sess + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -187,9 +190,10 @@ func (c *ApiService) PageSession(ServiceSid string, params *ListSessionParams, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -332,15 +336,16 @@ func (c *ApiService) UpdateSession(ServiceSid string, Sid string, params *Update data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.DateExpiry != nil { - data.Set("DateExpiry", fmt.Sprint((*params.DateExpiry).Format(time.RFC3339))) -} -if params != nil && params.Ttl != nil { - data.Set("Ttl", fmt.Sprint(*params.Ttl)) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} + + if params != nil && params.DateExpiry != nil { + data.Set("DateExpiry", fmt.Sprint((*params.DateExpiry).Format(time.RFC3339))) + } + if params != nil && params.Ttl != nil { + data.Set("Ttl", fmt.Sprint(*params.Ttl)) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } diff --git a/rest/proxy/v1/services_sessions_interactions.go b/rest/proxy/v1/services_sessions_interactions.go index 3ae2ba6a9..51b74c805 100644 --- a/rest/proxy/v1/services_sessions_interactions.go +++ b/rest/proxy/v1/services_sessions_interactions.go @@ -35,6 +35,7 @@ func (c *ApiService) DeleteInteraction(ServiceSid string, SessionSid string, Sid + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -57,6 +58,7 @@ func (c *ApiService) FetchInteraction(ServiceSid string, SessionSid string, Sid + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -98,9 +100,10 @@ func (c *ApiService) PageInteraction(ServiceSid string, SessionSid string, param data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/proxy/v1/services_sessions_participants.go b/rest/proxy/v1/services_sessions_participants.go index 9e68efd75..6a776a45e 100644 --- a/rest/proxy/v1/services_sessions_participants.go +++ b/rest/proxy/v1/services_sessions_participants.go @@ -60,18 +60,19 @@ func (c *ApiService) CreateParticipant(ServiceSid string, SessionSid string, par data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Identifier != nil { - data.Set("Identifier", *params.Identifier) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.ProxyIdentifier != nil { - data.Set("ProxyIdentifier", *params.ProxyIdentifier) -} -if params != nil && params.ProxyIdentifierSid != nil { - data.Set("ProxyIdentifierSid", *params.ProxyIdentifierSid) -} + + if params != nil && params.Identifier != nil { + data.Set("Identifier", *params.Identifier) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.ProxyIdentifier != nil { + data.Set("ProxyIdentifier", *params.ProxyIdentifier) + } + if params != nil && params.ProxyIdentifierSid != nil { + data.Set("ProxyIdentifierSid", *params.ProxyIdentifierSid) + } @@ -102,6 +103,7 @@ func (c *ApiService) DeleteParticipant(ServiceSid string, SessionSid string, Sid + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -124,6 +126,7 @@ func (c *ApiService) FetchParticipant(ServiceSid string, SessionSid string, Sid + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -165,9 +168,10 @@ func (c *ApiService) PageParticipant(ServiceSid string, SessionSid string, param data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/proxy/v1/services_sessions_participants_message_interactions.go b/rest/proxy/v1/services_sessions_participants_message_interactions.go index 753c97556..323eab9bc 100644 --- a/rest/proxy/v1/services_sessions_participants_message_interactions.go +++ b/rest/proxy/v1/services_sessions_participants_message_interactions.go @@ -49,14 +49,15 @@ func (c *ApiService) CreateMessageInteraction(ServiceSid string, SessionSid stri data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Body != nil { - data.Set("Body", *params.Body) -} -if params != nil && params.MediaUrl != nil { - for _, item := range *params.MediaUrl { - data.Add("MediaUrl", item) + + if params != nil && params.Body != nil { + data.Set("Body", *params.Body) + } + if params != nil && params.MediaUrl != nil { + for _, item := range *params.MediaUrl { + data.Add("MediaUrl", item) + } } -} @@ -88,6 +89,7 @@ func (c *ApiService) FetchMessageInteraction(ServiceSid string, SessionSid strin + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -130,9 +132,10 @@ func (c *ApiService) PageMessageInteraction(ServiceSid string, SessionSid string data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/proxy/v1/services_short_codes.go b/rest/proxy/v1/services_short_codes.go index 019555686..f473e2550 100644 --- a/rest/proxy/v1/services_short_codes.go +++ b/rest/proxy/v1/services_short_codes.go @@ -41,9 +41,10 @@ func (c *ApiService) CreateShortCode(ServiceSid string, params *CreateShortCodeP data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Sid != nil { - data.Set("Sid", *params.Sid) -} + + if params != nil && params.Sid != nil { + data.Set("Sid", *params.Sid) + } @@ -73,6 +74,7 @@ func (c *ApiService) DeleteShortCode(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -94,6 +96,7 @@ func (c *ApiService) FetchShortCode(ServiceSid string, Sid string, ) (*ProxyV1Sh + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -134,9 +137,10 @@ func (c *ApiService) PageShortCode(ServiceSid string, params *ListShortCodeParam data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -267,9 +271,10 @@ func (c *ApiService) UpdateShortCode(ServiceSid string, Sid string, params *Upda data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.IsReserved != nil { - data.Set("IsReserved", fmt.Sprint(*params.IsReserved)) -} + + if params != nil && params.IsReserved != nil { + data.Set("IsReserved", fmt.Sprint(*params.IsReserved)) + } diff --git a/rest/routes/v2/phone_numbers.go b/rest/routes/v2/phone_numbers.go index 1d44e9028..15cf0b4ba 100644 --- a/rest/routes/v2/phone_numbers.go +++ b/rest/routes/v2/phone_numbers.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchPhoneNumber(PhoneNumber string, ) (*RoutesV2PhoneNumbe + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -72,12 +73,13 @@ func (c *ApiService) UpdatePhoneNumber(PhoneNumber string, params *UpdatePhoneNu data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.VoiceRegion != nil { - data.Set("VoiceRegion", *params.VoiceRegion) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.VoiceRegion != nil { + data.Set("VoiceRegion", *params.VoiceRegion) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } diff --git a/rest/routes/v2/sip_domains.go b/rest/routes/v2/sip_domains.go index 24a90ffc2..cc3c4e88d 100644 --- a/rest/routes/v2/sip_domains.go +++ b/rest/routes/v2/sip_domains.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchSipDomain(SipDomain string, ) (*RoutesV2SipDomain, err + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -72,12 +73,13 @@ func (c *ApiService) UpdateSipDomain(SipDomain string, params *UpdateSipDomainPa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.VoiceRegion != nil { - data.Set("VoiceRegion", *params.VoiceRegion) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.VoiceRegion != nil { + data.Set("VoiceRegion", *params.VoiceRegion) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } diff --git a/rest/routes/v2/trunks.go b/rest/routes/v2/trunks.go index 8be8b8e4b..a41240a62 100644 --- a/rest/routes/v2/trunks.go +++ b/rest/routes/v2/trunks.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchTrunks(SipTrunkDomain string, ) (*RoutesV2Trunks, erro + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -72,12 +73,13 @@ func (c *ApiService) UpdateTrunks(SipTrunkDomain string, params *UpdateTrunksPar data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.VoiceRegion != nil { - data.Set("VoiceRegion", *params.VoiceRegion) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.VoiceRegion != nil { + data.Set("VoiceRegion", *params.VoiceRegion) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } diff --git a/rest/serverless/v1/services.go b/rest/serverless/v1/services.go index 8b369e848..01bb640aa 100644 --- a/rest/serverless/v1/services.go +++ b/rest/serverless/v1/services.go @@ -58,18 +58,19 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*ServerlessV1Se data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.IncludeCredentials != nil { - data.Set("IncludeCredentials", fmt.Sprint(*params.IncludeCredentials)) -} -if params != nil && params.UiEditable != nil { - data.Set("UiEditable", fmt.Sprint(*params.UiEditable)) -} + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.IncludeCredentials != nil { + data.Set("IncludeCredentials", fmt.Sprint(*params.IncludeCredentials)) + } + if params != nil && params.UiEditable != nil { + data.Set("UiEditable", fmt.Sprint(*params.UiEditable)) + } @@ -98,6 +99,7 @@ func (c *ApiService) DeleteService(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -118,6 +120,7 @@ func (c *ApiService) FetchService(Sid string, ) (*ServerlessV1Service, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -157,9 +160,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -301,15 +305,16 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Se data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.IncludeCredentials != nil { - data.Set("IncludeCredentials", fmt.Sprint(*params.IncludeCredentials)) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.UiEditable != nil { - data.Set("UiEditable", fmt.Sprint(*params.UiEditable)) -} + + if params != nil && params.IncludeCredentials != nil { + data.Set("IncludeCredentials", fmt.Sprint(*params.IncludeCredentials)) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.UiEditable != nil { + data.Set("UiEditable", fmt.Sprint(*params.UiEditable)) + } diff --git a/rest/serverless/v1/services_assets.go b/rest/serverless/v1/services_assets.go index 9c1cad9ef..bd7904d9e 100644 --- a/rest/serverless/v1/services_assets.go +++ b/rest/serverless/v1/services_assets.go @@ -41,9 +41,10 @@ func (c *ApiService) CreateAsset(ServiceSid string, params *CreateAssetParams) ( data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } @@ -73,6 +74,7 @@ func (c *ApiService) DeleteAsset(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -94,6 +96,7 @@ func (c *ApiService) FetchAsset(ServiceSid string, Sid string, ) (*ServerlessV1A + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -134,9 +137,10 @@ func (c *ApiService) PageAsset(ServiceSid string, params *ListAssetParams, pageT data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -267,9 +271,10 @@ func (c *ApiService) UpdateAsset(ServiceSid string, Sid string, params *UpdateAs data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } diff --git a/rest/serverless/v1/services_assets_versions.go b/rest/serverless/v1/services_assets_versions.go index d0b55ce4b..15728b6c7 100644 --- a/rest/serverless/v1/services_assets_versions.go +++ b/rest/serverless/v1/services_assets_versions.go @@ -35,6 +35,7 @@ func (c *ApiService) FetchAssetVersion(ServiceSid string, AssetSid string, Sid s + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -76,9 +77,10 @@ func (c *ApiService) PageAssetVersion(ServiceSid string, AssetSid string, params data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/serverless/v1/services_builds.go b/rest/serverless/v1/services_builds.go index 65a487171..88b9538a8 100644 --- a/rest/serverless/v1/services_builds.go +++ b/rest/serverless/v1/services_builds.go @@ -59,22 +59,23 @@ func (c *ApiService) CreateBuild(ServiceSid string, params *CreateBuildParams) ( data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.AssetVersions != nil { - for _, item := range *params.AssetVersions { - data.Add("AssetVersions", item) + + if params != nil && params.AssetVersions != nil { + for _, item := range *params.AssetVersions { + data.Add("AssetVersions", item) } -} -if params != nil && params.FunctionVersions != nil { - for _, item := range *params.FunctionVersions { - data.Add("FunctionVersions", item) } -} -if params != nil && params.Dependencies != nil { - data.Set("Dependencies", *params.Dependencies) -} -if params != nil && params.Runtime != nil { - data.Set("Runtime", *params.Runtime) -} + if params != nil && params.FunctionVersions != nil { + for _, item := range *params.FunctionVersions { + data.Add("FunctionVersions", item) + } + } + if params != nil && params.Dependencies != nil { + data.Set("Dependencies", *params.Dependencies) + } + if params != nil && params.Runtime != nil { + data.Set("Runtime", *params.Runtime) + } @@ -104,6 +105,7 @@ func (c *ApiService) DeleteBuild(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -125,6 +127,7 @@ func (c *ApiService) FetchBuild(ServiceSid string, Sid string, ) (*ServerlessV1B + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -165,9 +168,10 @@ func (c *ApiService) PageBuild(ServiceSid string, params *ListBuildParams, pageT data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/serverless/v1/services_builds_status.go b/rest/serverless/v1/services_builds_status.go index 65241658d..996a9faf2 100644 --- a/rest/serverless/v1/services_builds_status.go +++ b/rest/serverless/v1/services_builds_status.go @@ -34,6 +34,7 @@ func (c *ApiService) FetchBuildStatus(ServiceSid string, Sid string, ) (*Serverl + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/serverless/v1/services_environments.go b/rest/serverless/v1/services_environments.go index 99500194e..8595cdb51 100644 --- a/rest/serverless/v1/services_environments.go +++ b/rest/serverless/v1/services_environments.go @@ -47,12 +47,13 @@ func (c *ApiService) CreateEnvironment(ServiceSid string, params *CreateEnvironm data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.DomainSuffix != nil { - data.Set("DomainSuffix", *params.DomainSuffix) -} + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.DomainSuffix != nil { + data.Set("DomainSuffix", *params.DomainSuffix) + } @@ -82,6 +83,7 @@ func (c *ApiService) DeleteEnvironment(ServiceSid string, Sid string, ) (error) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -103,6 +105,7 @@ func (c *ApiService) FetchEnvironment(ServiceSid string, Sid string, ) (*Serverl + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -143,9 +146,10 @@ func (c *ApiService) PageEnvironment(ServiceSid string, params *ListEnvironmentP data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/serverless/v1/services_environments_deployments.go b/rest/serverless/v1/services_environments_deployments.go index aff2c5601..9d4639c28 100644 --- a/rest/serverless/v1/services_environments_deployments.go +++ b/rest/serverless/v1/services_environments_deployments.go @@ -42,9 +42,10 @@ func (c *ApiService) CreateDeployment(ServiceSid string, EnvironmentSid string, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.BuildSid != nil { - data.Set("BuildSid", *params.BuildSid) -} + + if params != nil && params.BuildSid != nil { + data.Set("BuildSid", *params.BuildSid) + } @@ -75,6 +76,7 @@ func (c *ApiService) FetchDeployment(ServiceSid string, EnvironmentSid string, S + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -116,9 +118,10 @@ func (c *ApiService) PageDeployment(ServiceSid string, EnvironmentSid string, pa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/serverless/v1/services_environments_logs.go b/rest/serverless/v1/services_environments_logs.go index 00a615928..1a0ea726d 100644 --- a/rest/serverless/v1/services_environments_logs.go +++ b/rest/serverless/v1/services_environments_logs.go @@ -35,6 +35,7 @@ func (c *ApiService) FetchLog(ServiceSid string, EnvironmentSid string, Sid stri + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -94,18 +95,19 @@ func (c *ApiService) PageLog(ServiceSid string, EnvironmentSid string, params *L data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FunctionSid != nil { - data.Set("FunctionSid", *params.FunctionSid) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) -} -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.FunctionSid != nil { + data.Set("FunctionSid", *params.FunctionSid) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + } + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/serverless/v1/services_environments_variables.go b/rest/serverless/v1/services_environments_variables.go index 1ac181f70..6cd0a072f 100644 --- a/rest/serverless/v1/services_environments_variables.go +++ b/rest/serverless/v1/services_environments_variables.go @@ -48,12 +48,13 @@ func (c *ApiService) CreateVariable(ServiceSid string, EnvironmentSid string, pa 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) -} + + if params != nil && params.Key != nil { + data.Set("Key", *params.Key) + } + if params != nil && params.Value != nil { + data.Set("Value", *params.Value) + } @@ -84,6 +85,7 @@ func (c *ApiService) DeleteVariable(ServiceSid string, EnvironmentSid string, Si + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -106,6 +108,7 @@ func (c *ApiService) FetchVariable(ServiceSid string, EnvironmentSid string, Sid + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -147,9 +150,10 @@ func (c *ApiService) PageVariable(ServiceSid string, EnvironmentSid string, para data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -287,12 +291,13 @@ func (c *ApiService) UpdateVariable(ServiceSid string, EnvironmentSid string, Si 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) -} + + if params != nil && params.Key != nil { + data.Set("Key", *params.Key) + } + if params != nil && params.Value != nil { + data.Set("Value", *params.Value) + } diff --git a/rest/serverless/v1/services_functions.go b/rest/serverless/v1/services_functions.go index 67cea9f28..da5e976eb 100644 --- a/rest/serverless/v1/services_functions.go +++ b/rest/serverless/v1/services_functions.go @@ -41,9 +41,10 @@ func (c *ApiService) CreateFunction(ServiceSid string, params *CreateFunctionPar data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } @@ -73,6 +74,7 @@ func (c *ApiService) DeleteFunction(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -94,6 +96,7 @@ func (c *ApiService) FetchFunction(ServiceSid string, Sid string, ) (*Serverless + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -134,9 +137,10 @@ func (c *ApiService) PageFunction(ServiceSid string, params *ListFunctionParams, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -267,9 +271,10 @@ func (c *ApiService) UpdateFunction(ServiceSid string, Sid string, params *Updat data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } diff --git a/rest/serverless/v1/services_functions_versions.go b/rest/serverless/v1/services_functions_versions.go index d8d270fc2..2181ffedb 100644 --- a/rest/serverless/v1/services_functions_versions.go +++ b/rest/serverless/v1/services_functions_versions.go @@ -35,6 +35,7 @@ func (c *ApiService) FetchFunctionVersion(ServiceSid string, FunctionSid string, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -76,9 +77,10 @@ func (c *ApiService) PageFunctionVersion(ServiceSid string, FunctionSid string, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/serverless/v1/services_functions_versions_content.go b/rest/serverless/v1/services_functions_versions_content.go index ccfdfd21b..782efbba6 100644 --- a/rest/serverless/v1/services_functions_versions_content.go +++ b/rest/serverless/v1/services_functions_versions_content.go @@ -35,6 +35,7 @@ func (c *ApiService) FetchFunctionVersionContent(ServiceSid string, FunctionSid + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/studio/v1/flows.go b/rest/studio/v1/flows.go index e868da46a..310c45685 100644 --- a/rest/studio/v1/flows.go +++ b/rest/studio/v1/flows.go @@ -33,6 +33,7 @@ func (c *ApiService) DeleteFlow(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -53,6 +54,7 @@ func (c *ApiService) FetchFlow(Sid string, ) (*StudioV1Flow, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -92,9 +94,10 @@ func (c *ApiService) PageFlow(params *ListFlowParams, pageToken, pageNumber stri data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/studio/v1/flows_engagements.go b/rest/studio/v1/flows_engagements.go index 889a8bbb2..ea2f11830 100644 --- a/rest/studio/v1/flows_engagements.go +++ b/rest/studio/v1/flows_engagements.go @@ -53,21 +53,22 @@ func (c *ApiService) CreateEngagement(FlowSid string, params *CreateEngagementPa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.To != nil { - data.Set("To", *params.To) -} -if params != nil && params.From != nil { - data.Set("From", *params.From) -} -if params != nil && params.Parameters != nil { - v, err := json.Marshal(params.Parameters) - if err != nil { - return nil, err + if params != nil && params.To != nil { + data.Set("To", *params.To) } + if params != nil && params.From != nil { + data.Set("From", *params.From) + } + if params != nil && params.Parameters != nil { + v, err := json.Marshal(params.Parameters) - data.Set("Parameters", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Parameters", string(v)) + } @@ -97,6 +98,7 @@ func (c *ApiService) DeleteEngagement(FlowSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -118,6 +120,7 @@ func (c *ApiService) FetchEngagement(FlowSid string, Sid string, ) (*StudioV1Eng + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -158,9 +161,10 @@ func (c *ApiService) PageEngagement(FlowSid string, params *ListEngagementParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/studio/v1/flows_engagements_context.go b/rest/studio/v1/flows_engagements_context.go index 2394bd34d..f74ecad81 100644 --- a/rest/studio/v1/flows_engagements_context.go +++ b/rest/studio/v1/flows_engagements_context.go @@ -34,6 +34,7 @@ func (c *ApiService) FetchEngagementContext(FlowSid string, EngagementSid string + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/studio/v1/flows_engagements_steps.go b/rest/studio/v1/flows_engagements_steps.go index ee8b3989a..8ca0e3c4b 100644 --- a/rest/studio/v1/flows_engagements_steps.go +++ b/rest/studio/v1/flows_engagements_steps.go @@ -35,6 +35,7 @@ func (c *ApiService) FetchStep(FlowSid string, EngagementSid string, Sid string, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -76,9 +77,10 @@ func (c *ApiService) PageStep(FlowSid string, EngagementSid string, params *List data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/studio/v1/flows_engagements_steps_context.go b/rest/studio/v1/flows_engagements_steps_context.go index 545c44d4f..7a65a4491 100644 --- a/rest/studio/v1/flows_engagements_steps_context.go +++ b/rest/studio/v1/flows_engagements_steps_context.go @@ -35,6 +35,7 @@ func (c *ApiService) FetchStepContext(FlowSid string, EngagementSid string, Step + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/studio/v1/flows_executions.go b/rest/studio/v1/flows_executions.go index 48e35f97b..3d43b9b43 100644 --- a/rest/studio/v1/flows_executions.go +++ b/rest/studio/v1/flows_executions.go @@ -53,21 +53,22 @@ func (c *ApiService) CreateExecution(FlowSid string, params *CreateExecutionPara data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.To != nil { - data.Set("To", *params.To) -} -if params != nil && params.From != nil { - data.Set("From", *params.From) -} -if params != nil && params.Parameters != nil { - v, err := json.Marshal(params.Parameters) - if err != nil { - return nil, err + if params != nil && params.To != nil { + data.Set("To", *params.To) + } + if params != nil && params.From != nil { + data.Set("From", *params.From) } + if params != nil && params.Parameters != nil { + v, err := json.Marshal(params.Parameters) - data.Set("Parameters", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Parameters", string(v)) + } @@ -97,6 +98,7 @@ func (c *ApiService) DeleteExecution(FlowSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -118,6 +120,7 @@ func (c *ApiService) FetchExecution(FlowSid string, Sid string, ) (*StudioV1Exec + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -170,15 +173,16 @@ func (c *ApiService) PageExecution(FlowSid string, params *ListExecutionParams, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.DateCreatedFrom != nil { - data.Set("DateCreatedFrom", fmt.Sprint((*params.DateCreatedFrom).Format(time.RFC3339))) -} -if params != nil && params.DateCreatedTo != nil { - data.Set("DateCreatedTo", fmt.Sprint((*params.DateCreatedTo).Format(time.RFC3339))) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.DateCreatedFrom != nil { + data.Set("DateCreatedFrom", fmt.Sprint((*params.DateCreatedFrom).Format(time.RFC3339))) + } + if params != nil && params.DateCreatedTo != nil { + data.Set("DateCreatedTo", fmt.Sprint((*params.DateCreatedTo).Format(time.RFC3339))) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -309,9 +313,10 @@ func (c *ApiService) UpdateExecution(FlowSid string, Sid string, params *UpdateE data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } diff --git a/rest/studio/v1/flows_executions_context.go b/rest/studio/v1/flows_executions_context.go index 65cf36134..26272bef8 100644 --- a/rest/studio/v1/flows_executions_context.go +++ b/rest/studio/v1/flows_executions_context.go @@ -34,6 +34,7 @@ func (c *ApiService) FetchExecutionContext(FlowSid string, ExecutionSid string, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/studio/v1/flows_executions_steps.go b/rest/studio/v1/flows_executions_steps.go index 431e888eb..5002faa09 100644 --- a/rest/studio/v1/flows_executions_steps.go +++ b/rest/studio/v1/flows_executions_steps.go @@ -35,6 +35,7 @@ func (c *ApiService) FetchExecutionStep(FlowSid string, ExecutionSid string, Sid + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -76,9 +77,10 @@ func (c *ApiService) PageExecutionStep(FlowSid string, ExecutionSid string, para data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/studio/v1/flows_executions_steps_context.go b/rest/studio/v1/flows_executions_steps_context.go index d0b59f215..20055a273 100644 --- a/rest/studio/v1/flows_executions_steps_context.go +++ b/rest/studio/v1/flows_executions_steps_context.go @@ -35,6 +35,7 @@ func (c *ApiService) FetchExecutionStepContext(FlowSid string, ExecutionSid stri + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/studio/v2/flows.go b/rest/studio/v2/flows.go index cf809f5f2..fba24de24 100644 --- a/rest/studio/v2/flows.go +++ b/rest/studio/v2/flows.go @@ -58,24 +58,25 @@ func (c *ApiService) CreateFlow(params *CreateFlowParams) (*StudioV2Flow, error) 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) -} -if params != nil && params.Definition != nil { - v, err := json.Marshal(params.Definition) - if err != nil { - return nil, err + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.Definition != nil { + v, err := json.Marshal(params.Definition) - data.Set("Definition", string(v)) -} -if params != nil && params.CommitMessage != nil { - data.Set("CommitMessage", *params.CommitMessage) -} + if err != nil { + return nil, err + } + + data.Set("Definition", string(v)) + } + if params != nil && params.CommitMessage != nil { + data.Set("CommitMessage", *params.CommitMessage) + } @@ -104,6 +105,7 @@ func (c *ApiService) DeleteFlow(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -124,6 +126,7 @@ func (c *ApiService) FetchFlow(Sid string, ) (*StudioV2Flow, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -163,9 +166,10 @@ func (c *ApiService) PageFlow(params *ListFlowParams, pageToken, pageNumber stri data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -313,24 +317,25 @@ func (c *ApiService) UpdateFlow(Sid string, params *UpdateFlowParams) (*StudioV2 data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Definition != nil { - v, err := json.Marshal(params.Definition) - if err != nil { - return nil, err + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Definition != nil { + v, err := json.Marshal(params.Definition) - data.Set("Definition", string(v)) -} -if params != nil && params.CommitMessage != nil { - data.Set("CommitMessage", *params.CommitMessage) -} + if err != nil { + return nil, err + } + + data.Set("Definition", string(v)) + } + if params != nil && params.CommitMessage != nil { + data.Set("CommitMessage", *params.CommitMessage) + } diff --git a/rest/studio/v2/flows_executions.go b/rest/studio/v2/flows_executions.go index 2313e91fe..1586625a4 100644 --- a/rest/studio/v2/flows_executions.go +++ b/rest/studio/v2/flows_executions.go @@ -53,21 +53,22 @@ func (c *ApiService) CreateExecution(FlowSid string, params *CreateExecutionPara data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.To != nil { - data.Set("To", *params.To) -} -if params != nil && params.From != nil { - data.Set("From", *params.From) -} -if params != nil && params.Parameters != nil { - v, err := json.Marshal(params.Parameters) - if err != nil { - return nil, err + if params != nil && params.To != nil { + data.Set("To", *params.To) + } + if params != nil && params.From != nil { + data.Set("From", *params.From) } + if params != nil && params.Parameters != nil { + v, err := json.Marshal(params.Parameters) - data.Set("Parameters", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Parameters", string(v)) + } @@ -97,6 +98,7 @@ func (c *ApiService) DeleteExecution(FlowSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -118,6 +120,7 @@ func (c *ApiService) FetchExecution(FlowSid string, Sid string, ) (*StudioV2Exec + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -170,15 +173,16 @@ func (c *ApiService) PageExecution(FlowSid string, params *ListExecutionParams, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.DateCreatedFrom != nil { - data.Set("DateCreatedFrom", fmt.Sprint((*params.DateCreatedFrom).Format(time.RFC3339))) -} -if params != nil && params.DateCreatedTo != nil { - data.Set("DateCreatedTo", fmt.Sprint((*params.DateCreatedTo).Format(time.RFC3339))) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.DateCreatedFrom != nil { + data.Set("DateCreatedFrom", fmt.Sprint((*params.DateCreatedFrom).Format(time.RFC3339))) + } + if params != nil && params.DateCreatedTo != nil { + data.Set("DateCreatedTo", fmt.Sprint((*params.DateCreatedTo).Format(time.RFC3339))) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -309,9 +313,10 @@ func (c *ApiService) UpdateExecution(FlowSid string, Sid string, params *UpdateE data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } diff --git a/rest/studio/v2/flows_executions_context.go b/rest/studio/v2/flows_executions_context.go index cf21e0959..d8ae47977 100644 --- a/rest/studio/v2/flows_executions_context.go +++ b/rest/studio/v2/flows_executions_context.go @@ -34,6 +34,7 @@ func (c *ApiService) FetchExecutionContext(FlowSid string, ExecutionSid string, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/studio/v2/flows_executions_steps.go b/rest/studio/v2/flows_executions_steps.go index 88f9ec9cb..4324e821e 100644 --- a/rest/studio/v2/flows_executions_steps.go +++ b/rest/studio/v2/flows_executions_steps.go @@ -35,6 +35,7 @@ func (c *ApiService) FetchExecutionStep(FlowSid string, ExecutionSid string, Sid + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -76,9 +77,10 @@ func (c *ApiService) PageExecutionStep(FlowSid string, ExecutionSid string, para data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/studio/v2/flows_executions_steps_context.go b/rest/studio/v2/flows_executions_steps_context.go index d01876fe2..856fa775c 100644 --- a/rest/studio/v2/flows_executions_steps_context.go +++ b/rest/studio/v2/flows_executions_steps_context.go @@ -35,6 +35,7 @@ func (c *ApiService) FetchExecutionStepContext(FlowSid string, ExecutionSid stri + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/studio/v2/flows_revisions.go b/rest/studio/v2/flows_revisions.go index a04eec469..41612c61a 100644 --- a/rest/studio/v2/flows_revisions.go +++ b/rest/studio/v2/flows_revisions.go @@ -34,6 +34,7 @@ func (c *ApiService) FetchFlowRevision(Sid string, Revision string, ) (*StudioV2 + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -74,9 +75,10 @@ func (c *ApiService) PageFlowRevision(Sid string, params *ListFlowRevisionParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/studio/v2/flows_test_users.go b/rest/studio/v2/flows_test_users.go index a646bc081..8454b1cc8 100644 --- a/rest/studio/v2/flows_test_users.go +++ b/rest/studio/v2/flows_test_users.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchTestUser(Sid string, ) (*StudioV2TestUser, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -66,11 +67,12 @@ func (c *ApiService) UpdateTestUser(Sid string, params *UpdateTestUserParams) (* data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.TestUsers != nil { - for _, item := range *params.TestUsers { - data.Add("TestUsers", item) + + if params != nil && params.TestUsers != nil { + for _, item := range *params.TestUsers { + data.Add("TestUsers", item) + } } -} diff --git a/rest/studio/v2/flows_validate.go b/rest/studio/v2/flows_validate.go index 801dd1e75..db678ae19 100644 --- a/rest/studio/v2/flows_validate.go +++ b/rest/studio/v2/flows_validate.go @@ -58,24 +58,25 @@ func (c *ApiService) UpdateFlowValidate(params *UpdateFlowValidateParams) (*Stud 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) -} -if params != nil && params.Definition != nil { - v, err := json.Marshal(params.Definition) - if err != nil { - return nil, err + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) } + if params != nil && params.Definition != nil { + v, err := json.Marshal(params.Definition) - data.Set("Definition", string(v)) -} -if params != nil && params.CommitMessage != nil { - data.Set("CommitMessage", *params.CommitMessage) -} + if err != nil { + return nil, err + } + + data.Set("Definition", string(v)) + } + if params != nil && params.CommitMessage != nil { + data.Set("CommitMessage", *params.CommitMessage) + } diff --git a/rest/supersim/v1/e_sim_profiles.go b/rest/supersim/v1/e_sim_profiles.go index d590bdb35..d67c42119 100644 --- a/rest/supersim/v1/e_sim_profiles.go +++ b/rest/supersim/v1/e_sim_profiles.go @@ -58,18 +58,19 @@ func (c *ApiService) CreateEsimProfile(params *CreateEsimProfileParams) (*Supers data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.CallbackUrl != nil { - data.Set("CallbackUrl", *params.CallbackUrl) -} -if params != nil && params.CallbackMethod != nil { - data.Set("CallbackMethod", *params.CallbackMethod) -} -if params != nil && params.GenerateMatchingId != nil { - data.Set("GenerateMatchingId", fmt.Sprint(*params.GenerateMatchingId)) -} -if params != nil && params.Eid != nil { - data.Set("Eid", *params.Eid) -} + + if params != nil && params.CallbackUrl != nil { + data.Set("CallbackUrl", *params.CallbackUrl) + } + if params != nil && params.CallbackMethod != nil { + data.Set("CallbackMethod", *params.CallbackMethod) + } + if params != nil && params.GenerateMatchingId != nil { + data.Set("GenerateMatchingId", fmt.Sprint(*params.GenerateMatchingId)) + } + if params != nil && params.Eid != nil { + data.Set("Eid", *params.Eid) + } @@ -98,6 +99,7 @@ func (c *ApiService) FetchEsimProfile(Sid string, ) (*SupersimV1EsimProfile, err + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -155,18 +157,19 @@ func (c *ApiService) PageEsimProfile(params *ListEsimProfileParams, pageToken, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Eid != nil { - data.Set("Eid", *params.Eid) -} -if params != nil && params.SimSid != nil { - data.Set("SimSid", *params.SimSid) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Eid != nil { + data.Set("Eid", *params.Eid) + } + if params != nil && params.SimSid != nil { + data.Set("SimSid", *params.SimSid) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/supersim/v1/fleets.go b/rest/supersim/v1/fleets.go index 1c1c4326b..5cc9e584a 100644 --- a/rest/supersim/v1/fleets.go +++ b/rest/supersim/v1/fleets.go @@ -88,33 +88,34 @@ func (c *ApiService) CreateFleet(params *CreateFleetParams) (*SupersimV1Fleet, e data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.NetworkAccessProfile != nil { - data.Set("NetworkAccessProfile", *params.NetworkAccessProfile) -} -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.DataEnabled != nil { - data.Set("DataEnabled", fmt.Sprint(*params.DataEnabled)) -} -if params != nil && params.DataLimit != nil { - data.Set("DataLimit", fmt.Sprint(*params.DataLimit)) -} -if params != nil && params.IpCommandsUrl != nil { - data.Set("IpCommandsUrl", *params.IpCommandsUrl) -} -if params != nil && params.IpCommandsMethod != nil { - data.Set("IpCommandsMethod", *params.IpCommandsMethod) -} -if params != nil && params.SmsCommandsEnabled != nil { - data.Set("SmsCommandsEnabled", fmt.Sprint(*params.SmsCommandsEnabled)) -} -if params != nil && params.SmsCommandsUrl != nil { - data.Set("SmsCommandsUrl", *params.SmsCommandsUrl) -} -if params != nil && params.SmsCommandsMethod != nil { - data.Set("SmsCommandsMethod", *params.SmsCommandsMethod) -} + + if params != nil && params.NetworkAccessProfile != nil { + data.Set("NetworkAccessProfile", *params.NetworkAccessProfile) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.DataEnabled != nil { + data.Set("DataEnabled", fmt.Sprint(*params.DataEnabled)) + } + if params != nil && params.DataLimit != nil { + data.Set("DataLimit", fmt.Sprint(*params.DataLimit)) + } + if params != nil && params.IpCommandsUrl != nil { + data.Set("IpCommandsUrl", *params.IpCommandsUrl) + } + if params != nil && params.IpCommandsMethod != nil { + data.Set("IpCommandsMethod", *params.IpCommandsMethod) + } + if params != nil && params.SmsCommandsEnabled != nil { + data.Set("SmsCommandsEnabled", fmt.Sprint(*params.SmsCommandsEnabled)) + } + if params != nil && params.SmsCommandsUrl != nil { + data.Set("SmsCommandsUrl", *params.SmsCommandsUrl) + } + if params != nil && params.SmsCommandsMethod != nil { + data.Set("SmsCommandsMethod", *params.SmsCommandsMethod) + } @@ -143,6 +144,7 @@ func (c *ApiService) FetchFleet(Sid string, ) (*SupersimV1Fleet, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -188,12 +190,13 @@ func (c *ApiService) PageFleet(params *ListFleetParams, pageToken, pageNumber st 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)) -} + + if params != nil && params.NetworkAccessProfile != nil { + data.Set("NetworkAccessProfile", *params.NetworkAccessProfile) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -359,27 +362,28 @@ func (c *ApiService) UpdateFleet(Sid string, params *UpdateFleetParams) (*Supers data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.NetworkAccessProfile != nil { - data.Set("NetworkAccessProfile", *params.NetworkAccessProfile) -} -if params != nil && params.IpCommandsUrl != nil { - data.Set("IpCommandsUrl", *params.IpCommandsUrl) -} -if params != nil && params.IpCommandsMethod != nil { - data.Set("IpCommandsMethod", *params.IpCommandsMethod) -} -if params != nil && params.SmsCommandsUrl != nil { - data.Set("SmsCommandsUrl", *params.SmsCommandsUrl) -} -if params != nil && params.SmsCommandsMethod != nil { - data.Set("SmsCommandsMethod", *params.SmsCommandsMethod) -} -if params != nil && params.DataLimit != nil { - data.Set("DataLimit", fmt.Sprint(*params.DataLimit)) -} + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.NetworkAccessProfile != nil { + data.Set("NetworkAccessProfile", *params.NetworkAccessProfile) + } + if params != nil && params.IpCommandsUrl != nil { + data.Set("IpCommandsUrl", *params.IpCommandsUrl) + } + if params != nil && params.IpCommandsMethod != nil { + data.Set("IpCommandsMethod", *params.IpCommandsMethod) + } + if params != nil && params.SmsCommandsUrl != nil { + data.Set("SmsCommandsUrl", *params.SmsCommandsUrl) + } + if params != nil && params.SmsCommandsMethod != nil { + data.Set("SmsCommandsMethod", *params.SmsCommandsMethod) + } + if params != nil && params.DataLimit != nil { + data.Set("DataLimit", fmt.Sprint(*params.DataLimit)) + } diff --git a/rest/supersim/v1/ip_commands.go b/rest/supersim/v1/ip_commands.go index 6756d577f..a3bcbe3f4 100644 --- a/rest/supersim/v1/ip_commands.go +++ b/rest/supersim/v1/ip_commands.go @@ -70,24 +70,25 @@ func (c *ApiService) CreateIpCommand(params *CreateIpCommandParams) (*SupersimV1 data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Sim != nil { - data.Set("Sim", *params.Sim) -} -if params != nil && params.Payload != nil { - data.Set("Payload", *params.Payload) -} -if params != nil && params.DevicePort != nil { - data.Set("DevicePort", fmt.Sprint(*params.DevicePort)) -} -if params != nil && params.PayloadType != nil { - data.Set("PayloadType", *params.PayloadType) -} -if params != nil && params.CallbackUrl != nil { - data.Set("CallbackUrl", *params.CallbackUrl) -} -if params != nil && params.CallbackMethod != nil { - data.Set("CallbackMethod", *params.CallbackMethod) -} + + if params != nil && params.Sim != nil { + data.Set("Sim", *params.Sim) + } + if params != nil && params.Payload != nil { + data.Set("Payload", *params.Payload) + } + if params != nil && params.DevicePort != nil { + data.Set("DevicePort", fmt.Sprint(*params.DevicePort)) + } + if params != nil && params.PayloadType != nil { + data.Set("PayloadType", *params.PayloadType) + } + if params != nil && params.CallbackUrl != nil { + data.Set("CallbackUrl", *params.CallbackUrl) + } + if params != nil && params.CallbackMethod != nil { + data.Set("CallbackMethod", *params.CallbackMethod) + } @@ -116,6 +117,7 @@ func (c *ApiService) FetchIpCommand(Sid string, ) (*SupersimV1IpCommand, error) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -179,21 +181,22 @@ func (c *ApiService) PageIpCommand(params *ListIpCommandParams, pageToken, pageN data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Sim != nil { - data.Set("Sim", *params.Sim) -} -if params != nil && params.SimIccid != nil { - data.Set("SimIccid", *params.SimIccid) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.Direction != nil { - data.Set("Direction", *params.Direction) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Sim != nil { + data.Set("Sim", *params.Sim) + } + if params != nil && params.SimIccid != nil { + data.Set("SimIccid", *params.SimIccid) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.Direction != nil { + data.Set("Direction", *params.Direction) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/supersim/v1/network_access_profiles.go b/rest/supersim/v1/network_access_profiles.go index c7200598b..b39f4319d 100644 --- a/rest/supersim/v1/network_access_profiles.go +++ b/rest/supersim/v1/network_access_profiles.go @@ -46,14 +46,15 @@ func (c *ApiService) CreateNetworkAccessProfile(params *CreateNetworkAccessProfi data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.Networks != nil { - for _, item := range *params.Networks { - data.Add("Networks", item) + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.Networks != nil { + for _, item := range *params.Networks { + data.Add("Networks", item) + } } -} @@ -82,6 +83,7 @@ func (c *ApiService) FetchNetworkAccessProfile(Sid string, ) (*SupersimV1Network + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -121,9 +123,10 @@ func (c *ApiService) PageNetworkAccessProfile(params *ListNetworkAccessProfilePa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -253,9 +256,10 @@ func (c *ApiService) UpdateNetworkAccessProfile(Sid string, params *UpdateNetwor data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } diff --git a/rest/supersim/v1/network_access_profiles_networks.go b/rest/supersim/v1/network_access_profiles_networks.go index cc56b3801..875243e19 100644 --- a/rest/supersim/v1/network_access_profiles_networks.go +++ b/rest/supersim/v1/network_access_profiles_networks.go @@ -41,9 +41,10 @@ func (c *ApiService) CreateNetworkAccessProfileNetwork(NetworkAccessProfileSid s data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Network != nil { - data.Set("Network", *params.Network) -} + + if params != nil && params.Network != nil { + data.Set("Network", *params.Network) + } @@ -73,6 +74,7 @@ func (c *ApiService) DeleteNetworkAccessProfileNetwork(NetworkAccessProfileSid s + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -94,6 +96,7 @@ func (c *ApiService) FetchNetworkAccessProfileNetwork(NetworkAccessProfileSid st + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -134,9 +137,10 @@ func (c *ApiService) PageNetworkAccessProfileNetwork(NetworkAccessProfileSid str data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/supersim/v1/networks.go b/rest/supersim/v1/networks.go index 1ae84dd63..29a072e2d 100644 --- a/rest/supersim/v1/networks.go +++ b/rest/supersim/v1/networks.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchNetwork(Sid string, ) (*SupersimV1Network, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -90,18 +91,19 @@ func (c *ApiService) PageNetwork(params *ListNetworkParams, pageToken, pageNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.IsoCountry != nil { - data.Set("IsoCountry", *params.IsoCountry) -} -if params != nil && params.Mcc != nil { - data.Set("Mcc", *params.Mcc) -} -if params != nil && params.Mnc != nil { - data.Set("Mnc", *params.Mnc) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.IsoCountry != nil { + data.Set("IsoCountry", *params.IsoCountry) + } + if params != nil && params.Mcc != nil { + data.Set("Mcc", *params.Mcc) + } + if params != nil && params.Mnc != nil { + data.Set("Mnc", *params.Mnc) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/supersim/v1/settings_updates.go b/rest/supersim/v1/settings_updates.go index 8c39067eb..a0a3ff17c 100644 --- a/rest/supersim/v1/settings_updates.go +++ b/rest/supersim/v1/settings_updates.go @@ -59,15 +59,16 @@ func (c *ApiService) PageSettingsUpdate(params *ListSettingsUpdateParams, pageTo data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Sim != nil { - data.Set("Sim", *params.Sim) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Sim != nil { + data.Set("Sim", *params.Sim) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/supersim/v1/sims.go b/rest/supersim/v1/sims.go index 3e7662c5c..75179de2d 100644 --- a/rest/supersim/v1/sims.go +++ b/rest/supersim/v1/sims.go @@ -46,12 +46,13 @@ func (c *ApiService) CreateSim(params *CreateSimParams) (*SupersimV1Sim, error) 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) -} + + if params != nil && params.Iccid != nil { + data.Set("Iccid", *params.Iccid) + } + if params != nil && params.RegistrationCode != nil { + data.Set("RegistrationCode", *params.RegistrationCode) + } @@ -80,6 +81,7 @@ func (c *ApiService) FetchSim(Sid string, ) (*SupersimV1Sim, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -137,18 +139,19 @@ func (c *ApiService) PageSim(params *ListSimParams, pageToken, pageNumber string data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.Fleet != nil { - data.Set("Fleet", *params.Fleet) -} -if params != nil && params.Iccid != nil { - data.Set("Iccid", *params.Iccid) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.Fleet != nil { + data.Set("Fleet", *params.Fleet) + } + if params != nil && params.Iccid != nil { + data.Set("Iccid", *params.Iccid) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -308,24 +311,25 @@ func (c *ApiService) UpdateSim(Sid string, params *UpdateSimParams) (*SupersimV1 data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.Fleet != nil { - data.Set("Fleet", *params.Fleet) -} -if params != nil && params.CallbackUrl != nil { - data.Set("CallbackUrl", *params.CallbackUrl) -} -if params != nil && params.CallbackMethod != nil { - data.Set("CallbackMethod", *params.CallbackMethod) -} -if params != nil && params.AccountSid != nil { - data.Set("AccountSid", *params.AccountSid) -} + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.Fleet != nil { + data.Set("Fleet", *params.Fleet) + } + if params != nil && params.CallbackUrl != nil { + data.Set("CallbackUrl", *params.CallbackUrl) + } + if params != nil && params.CallbackMethod != nil { + data.Set("CallbackMethod", *params.CallbackMethod) + } + if params != nil && params.AccountSid != nil { + data.Set("AccountSid", *params.AccountSid) + } diff --git a/rest/supersim/v1/sims_billing_periods.go b/rest/supersim/v1/sims_billing_periods.go index b1ab5d686..cc74bd3ca 100644 --- a/rest/supersim/v1/sims_billing_periods.go +++ b/rest/supersim/v1/sims_billing_periods.go @@ -48,9 +48,10 @@ func (c *ApiService) PageBillingPeriod(SimSid string, params *ListBillingPeriodP data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/supersim/v1/sims_ip_addresses.go b/rest/supersim/v1/sims_ip_addresses.go index 81c685743..4cfa649d5 100644 --- a/rest/supersim/v1/sims_ip_addresses.go +++ b/rest/supersim/v1/sims_ip_addresses.go @@ -48,9 +48,10 @@ func (c *ApiService) PageSimIpAddress(SimSid string, params *ListSimIpAddressPar data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/supersim/v1/sms_commands.go b/rest/supersim/v1/sms_commands.go index 1397d9645..5dc7fb745 100644 --- a/rest/supersim/v1/sms_commands.go +++ b/rest/supersim/v1/sms_commands.go @@ -58,18 +58,19 @@ func (c *ApiService) CreateSmsCommand(params *CreateSmsCommandParams) (*Supersim data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Sim != nil { - data.Set("Sim", *params.Sim) -} -if params != nil && params.Payload != nil { - data.Set("Payload", *params.Payload) -} -if params != nil && params.CallbackMethod != nil { - data.Set("CallbackMethod", *params.CallbackMethod) -} -if params != nil && params.CallbackUrl != nil { - data.Set("CallbackUrl", *params.CallbackUrl) -} + + if params != nil && params.Sim != nil { + data.Set("Sim", *params.Sim) + } + if params != nil && params.Payload != nil { + data.Set("Payload", *params.Payload) + } + if params != nil && params.CallbackMethod != nil { + data.Set("CallbackMethod", *params.CallbackMethod) + } + if params != nil && params.CallbackUrl != nil { + data.Set("CallbackUrl", *params.CallbackUrl) + } @@ -98,6 +99,7 @@ func (c *ApiService) FetchSmsCommand(Sid string, ) (*SupersimV1SmsCommand, error + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -155,18 +157,19 @@ func (c *ApiService) PageSmsCommand(params *ListSmsCommandParams, pageToken, pag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Sim != nil { - data.Set("Sim", *params.Sim) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.Direction != nil { - data.Set("Direction", *params.Direction) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Sim != nil { + data.Set("Sim", *params.Sim) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.Direction != nil { + data.Set("Direction", *params.Direction) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/supersim/v1/usage_records.go b/rest/supersim/v1/usage_records.go index 2c263d767..b14a531b2 100644 --- a/rest/supersim/v1/usage_records.go +++ b/rest/supersim/v1/usage_records.go @@ -95,33 +95,34 @@ func (c *ApiService) PageUsageRecord(params *ListUsageRecordParams, pageToken, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Sim != nil { - data.Set("Sim", *params.Sim) -} -if params != nil && params.Fleet != nil { - data.Set("Fleet", *params.Fleet) -} -if params != nil && params.Network != nil { - data.Set("Network", *params.Network) -} -if params != nil && params.IsoCountry != nil { - data.Set("IsoCountry", *params.IsoCountry) -} -if params != nil && params.Group != nil { - data.Set("Group", *params.Group) -} -if params != nil && params.Granularity != nil { - data.Set("Granularity", *params.Granularity) -} -if params != nil && params.StartTime != nil { - data.Set("StartTime", fmt.Sprint((*params.StartTime).Format(time.RFC3339))) -} -if params != nil && params.EndTime != nil { - data.Set("EndTime", fmt.Sprint((*params.EndTime).Format(time.RFC3339))) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Sim != nil { + data.Set("Sim", *params.Sim) + } + if params != nil && params.Fleet != nil { + data.Set("Fleet", *params.Fleet) + } + if params != nil && params.Network != nil { + data.Set("Network", *params.Network) + } + if params != nil && params.IsoCountry != nil { + data.Set("IsoCountry", *params.IsoCountry) + } + if params != nil && params.Group != nil { + data.Set("Group", *params.Group) + } + if params != nil && params.Granularity != nil { + data.Set("Granularity", *params.Granularity) + } + if params != nil && params.StartTime != nil { + data.Set("StartTime", fmt.Sprint((*params.StartTime).Format(time.RFC3339))) + } + if params != nil && params.EndTime != nil { + data.Set("EndTime", fmt.Sprint((*params.EndTime).Format(time.RFC3339))) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/sync/v1/services.go b/rest/sync/v1/services.go index df3a932e0..1c66ba883 100644 --- a/rest/sync/v1/services.go +++ b/rest/sync/v1/services.go @@ -76,27 +76,28 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*SyncV1Service, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.WebhookUrl != nil { - data.Set("WebhookUrl", *params.WebhookUrl) -} -if params != nil && params.ReachabilityWebhooksEnabled != nil { - data.Set("ReachabilityWebhooksEnabled", fmt.Sprint(*params.ReachabilityWebhooksEnabled)) -} -if params != nil && params.AclEnabled != nil { - data.Set("AclEnabled", fmt.Sprint(*params.AclEnabled)) -} -if params != nil && params.ReachabilityDebouncingEnabled != nil { - data.Set("ReachabilityDebouncingEnabled", fmt.Sprint(*params.ReachabilityDebouncingEnabled)) -} -if params != nil && params.ReachabilityDebouncingWindow != nil { - data.Set("ReachabilityDebouncingWindow", fmt.Sprint(*params.ReachabilityDebouncingWindow)) -} -if params != nil && params.WebhooksFromRestEnabled != nil { - data.Set("WebhooksFromRestEnabled", fmt.Sprint(*params.WebhooksFromRestEnabled)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.WebhookUrl != nil { + data.Set("WebhookUrl", *params.WebhookUrl) + } + if params != nil && params.ReachabilityWebhooksEnabled != nil { + data.Set("ReachabilityWebhooksEnabled", fmt.Sprint(*params.ReachabilityWebhooksEnabled)) + } + if params != nil && params.AclEnabled != nil { + data.Set("AclEnabled", fmt.Sprint(*params.AclEnabled)) + } + if params != nil && params.ReachabilityDebouncingEnabled != nil { + data.Set("ReachabilityDebouncingEnabled", fmt.Sprint(*params.ReachabilityDebouncingEnabled)) + } + if params != nil && params.ReachabilityDebouncingWindow != nil { + data.Set("ReachabilityDebouncingWindow", fmt.Sprint(*params.ReachabilityDebouncingWindow)) + } + if params != nil && params.WebhooksFromRestEnabled != nil { + data.Set("WebhooksFromRestEnabled", fmt.Sprint(*params.WebhooksFromRestEnabled)) + } @@ -125,6 +126,7 @@ func (c *ApiService) DeleteService(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -145,6 +147,7 @@ func (c *ApiService) FetchService(Sid string, ) (*SyncV1Service, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -184,9 +187,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -352,27 +356,28 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Sy data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.WebhookUrl != nil { - data.Set("WebhookUrl", *params.WebhookUrl) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.ReachabilityWebhooksEnabled != nil { - data.Set("ReachabilityWebhooksEnabled", fmt.Sprint(*params.ReachabilityWebhooksEnabled)) -} -if params != nil && params.AclEnabled != nil { - data.Set("AclEnabled", fmt.Sprint(*params.AclEnabled)) -} -if params != nil && params.ReachabilityDebouncingEnabled != nil { - data.Set("ReachabilityDebouncingEnabled", fmt.Sprint(*params.ReachabilityDebouncingEnabled)) -} -if params != nil && params.ReachabilityDebouncingWindow != nil { - data.Set("ReachabilityDebouncingWindow", fmt.Sprint(*params.ReachabilityDebouncingWindow)) -} -if params != nil && params.WebhooksFromRestEnabled != nil { - data.Set("WebhooksFromRestEnabled", fmt.Sprint(*params.WebhooksFromRestEnabled)) -} + + if params != nil && params.WebhookUrl != nil { + data.Set("WebhookUrl", *params.WebhookUrl) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.ReachabilityWebhooksEnabled != nil { + data.Set("ReachabilityWebhooksEnabled", fmt.Sprint(*params.ReachabilityWebhooksEnabled)) + } + if params != nil && params.AclEnabled != nil { + data.Set("AclEnabled", fmt.Sprint(*params.AclEnabled)) + } + if params != nil && params.ReachabilityDebouncingEnabled != nil { + data.Set("ReachabilityDebouncingEnabled", fmt.Sprint(*params.ReachabilityDebouncingEnabled)) + } + if params != nil && params.ReachabilityDebouncingWindow != nil { + data.Set("ReachabilityDebouncingWindow", fmt.Sprint(*params.ReachabilityDebouncingWindow)) + } + if params != nil && params.WebhooksFromRestEnabled != nil { + data.Set("WebhooksFromRestEnabled", fmt.Sprint(*params.WebhooksFromRestEnabled)) + } diff --git a/rest/sync/v1/services_documents.go b/rest/sync/v1/services_documents.go index 888edce20..254b707fe 100644 --- a/rest/sync/v1/services_documents.go +++ b/rest/sync/v1/services_documents.go @@ -53,21 +53,22 @@ func (c *ApiService) CreateDocument(ServiceSid string, params *CreateDocumentPar data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.Data != nil { - v, err := json.Marshal(params.Data) - if err != nil { - return nil, err + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) } + if params != nil && params.Data != nil { + v, err := json.Marshal(params.Data) - data.Set("Data", string(v)) -} -if params != nil && params.Ttl != nil { - data.Set("Ttl", fmt.Sprint(*params.Ttl)) -} + if err != nil { + return nil, err + } + + data.Set("Data", string(v)) + } + if params != nil && params.Ttl != nil { + data.Set("Ttl", fmt.Sprint(*params.Ttl)) + } @@ -97,6 +98,7 @@ func (c *ApiService) DeleteDocument(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -118,6 +120,7 @@ func (c *ApiService) FetchDocument(ServiceSid string, Sid string, ) (*SyncV1Docu + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -158,9 +161,10 @@ func (c *ApiService) PageDocument(ServiceSid string, params *ListDocumentParams, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -303,18 +307,19 @@ func (c *ApiService) UpdateDocument(ServiceSid string, Sid string, params *Updat data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Data != nil { - v, err := json.Marshal(params.Data) - if err != nil { - return nil, err - } + if params != nil && params.Data != nil { + v, err := json.Marshal(params.Data) - data.Set("Data", string(v)) -} -if params != nil && params.Ttl != nil { - data.Set("Ttl", fmt.Sprint(*params.Ttl)) -} + if err != nil { + return nil, err + } + + data.Set("Data", string(v)) + } + if params != nil && params.Ttl != nil { + data.Set("Ttl", fmt.Sprint(*params.Ttl)) + } if params != nil && params.IfMatch != nil { diff --git a/rest/sync/v1/services_documents_permissions.go b/rest/sync/v1/services_documents_permissions.go index 464e37af9..8cf811d92 100644 --- a/rest/sync/v1/services_documents_permissions.go +++ b/rest/sync/v1/services_documents_permissions.go @@ -35,6 +35,7 @@ func (c *ApiService) DeleteDocumentPermission(ServiceSid string, DocumentSid str + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -57,6 +58,7 @@ func (c *ApiService) FetchDocumentPermission(ServiceSid string, DocumentSid stri + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -98,9 +100,10 @@ func (c *ApiService) PageDocumentPermission(ServiceSid string, DocumentSid strin data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -244,15 +247,16 @@ func (c *ApiService) UpdateDocumentPermission(ServiceSid string, DocumentSid str data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Read != nil { - data.Set("Read", fmt.Sprint(*params.Read)) -} -if params != nil && params.Write != nil { - data.Set("Write", fmt.Sprint(*params.Write)) -} -if params != nil && params.Manage != nil { - data.Set("Manage", fmt.Sprint(*params.Manage)) -} + + if params != nil && params.Read != nil { + data.Set("Read", fmt.Sprint(*params.Read)) + } + if params != nil && params.Write != nil { + data.Set("Write", fmt.Sprint(*params.Write)) + } + if params != nil && params.Manage != nil { + data.Set("Manage", fmt.Sprint(*params.Manage)) + } diff --git a/rest/sync/v1/services_lists.go b/rest/sync/v1/services_lists.go index 7f54fe88a..0fb5d129d 100644 --- a/rest/sync/v1/services_lists.go +++ b/rest/sync/v1/services_lists.go @@ -53,15 +53,16 @@ func (c *ApiService) CreateSyncList(ServiceSid string, params *CreateSyncListPar data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.Ttl != nil { - data.Set("Ttl", fmt.Sprint(*params.Ttl)) -} -if params != nil && params.CollectionTtl != nil { - data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) -} + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.Ttl != nil { + data.Set("Ttl", fmt.Sprint(*params.Ttl)) + } + if params != nil && params.CollectionTtl != nil { + data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) + } @@ -91,6 +92,7 @@ func (c *ApiService) DeleteSyncList(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -112,6 +114,7 @@ func (c *ApiService) FetchSyncList(ServiceSid string, Sid string, ) (*SyncV1Sync + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -152,9 +155,10 @@ func (c *ApiService) PageSyncList(ServiceSid string, params *ListSyncListParams, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -291,12 +295,13 @@ func (c *ApiService) UpdateSyncList(ServiceSid string, Sid string, params *Updat 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.CollectionTtl != nil { - data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) -} + + if params != nil && params.Ttl != nil { + data.Set("Ttl", fmt.Sprint(*params.Ttl)) + } + if params != nil && params.CollectionTtl != nil { + data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) + } diff --git a/rest/sync/v1/services_lists_items.go b/rest/sync/v1/services_lists_items.go index 9a7037b95..0209c030e 100644 --- a/rest/sync/v1/services_lists_items.go +++ b/rest/sync/v1/services_lists_items.go @@ -60,24 +60,25 @@ func (c *ApiService) CreateSyncListItem(ServiceSid string, ListSid string, param data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Data != nil { - v, err := json.Marshal(params.Data) - if err != nil { - return nil, err - } + if params != nil && params.Data != nil { + v, err := json.Marshal(params.Data) - data.Set("Data", string(v)) -} -if params != nil && params.Ttl != nil { - data.Set("Ttl", fmt.Sprint(*params.Ttl)) -} -if params != nil && params.ItemTtl != nil { - data.Set("ItemTtl", fmt.Sprint(*params.ItemTtl)) -} -if params != nil && params.CollectionTtl != nil { - data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) -} + if err != nil { + return nil, err + } + + data.Set("Data", string(v)) + } + if params != nil && params.Ttl != nil { + data.Set("Ttl", fmt.Sprint(*params.Ttl)) + } + if params != nil && params.ItemTtl != nil { + data.Set("ItemTtl", fmt.Sprint(*params.ItemTtl)) + } + if params != nil && params.CollectionTtl != nil { + data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) + } @@ -118,6 +119,7 @@ func (c *ApiService) DeleteSyncListItem(ServiceSid string, ListSid string, Index headers := make(map[string]interface{}) + if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } @@ -144,6 +146,7 @@ func (c *ApiService) FetchSyncListItem(ServiceSid string, ListSid string, Index + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -203,18 +206,19 @@ func (c *ApiService) PageSyncListItem(ServiceSid string, ListSid string, params data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Order != nil { - data.Set("Order", *params.Order) -} -if params != nil && params.From != nil { - data.Set("From", *params.From) -} -if params != nil && params.Bounds != nil { - data.Set("Bounds", *params.Bounds) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Order != nil { + data.Set("Order", *params.Order) + } + if params != nil && params.From != nil { + data.Set("From", *params.From) + } + if params != nil && params.Bounds != nil { + data.Set("Bounds", *params.Bounds) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -370,24 +374,25 @@ func (c *ApiService) UpdateSyncListItem(ServiceSid string, ListSid string, Index data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Data != nil { - v, err := json.Marshal(params.Data) - if err != nil { - return nil, err - } + if params != nil && params.Data != nil { + v, err := json.Marshal(params.Data) - data.Set("Data", string(v)) -} -if params != nil && params.Ttl != nil { - data.Set("Ttl", fmt.Sprint(*params.Ttl)) -} -if params != nil && params.ItemTtl != nil { - data.Set("ItemTtl", fmt.Sprint(*params.ItemTtl)) -} -if params != nil && params.CollectionTtl != nil { - data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) -} + if err != nil { + return nil, err + } + + data.Set("Data", string(v)) + } + if params != nil && params.Ttl != nil { + data.Set("Ttl", fmt.Sprint(*params.Ttl)) + } + if params != nil && params.ItemTtl != nil { + data.Set("ItemTtl", fmt.Sprint(*params.ItemTtl)) + } + if params != nil && params.CollectionTtl != nil { + data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) + } if params != nil && params.IfMatch != nil { diff --git a/rest/sync/v1/services_lists_permissions.go b/rest/sync/v1/services_lists_permissions.go index 4003e2b17..38f3f763a 100644 --- a/rest/sync/v1/services_lists_permissions.go +++ b/rest/sync/v1/services_lists_permissions.go @@ -35,6 +35,7 @@ func (c *ApiService) DeleteSyncListPermission(ServiceSid string, ListSid string, + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -57,6 +58,7 @@ func (c *ApiService) FetchSyncListPermission(ServiceSid string, ListSid string, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -98,9 +100,10 @@ func (c *ApiService) PageSyncListPermission(ServiceSid string, ListSid string, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -244,15 +247,16 @@ func (c *ApiService) UpdateSyncListPermission(ServiceSid string, ListSid string, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Read != nil { - data.Set("Read", fmt.Sprint(*params.Read)) -} -if params != nil && params.Write != nil { - data.Set("Write", fmt.Sprint(*params.Write)) -} -if params != nil && params.Manage != nil { - data.Set("Manage", fmt.Sprint(*params.Manage)) -} + + if params != nil && params.Read != nil { + data.Set("Read", fmt.Sprint(*params.Read)) + } + if params != nil && params.Write != nil { + data.Set("Write", fmt.Sprint(*params.Write)) + } + if params != nil && params.Manage != nil { + data.Set("Manage", fmt.Sprint(*params.Manage)) + } diff --git a/rest/sync/v1/services_maps.go b/rest/sync/v1/services_maps.go index bfc5cf5c5..2685521e0 100644 --- a/rest/sync/v1/services_maps.go +++ b/rest/sync/v1/services_maps.go @@ -53,15 +53,16 @@ func (c *ApiService) CreateSyncMap(ServiceSid string, params *CreateSyncMapParam data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.Ttl != nil { - data.Set("Ttl", fmt.Sprint(*params.Ttl)) -} -if params != nil && params.CollectionTtl != nil { - data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) -} + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.Ttl != nil { + data.Set("Ttl", fmt.Sprint(*params.Ttl)) + } + if params != nil && params.CollectionTtl != nil { + data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) + } @@ -91,6 +92,7 @@ func (c *ApiService) DeleteSyncMap(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -112,6 +114,7 @@ func (c *ApiService) FetchSyncMap(ServiceSid string, Sid string, ) (*SyncV1SyncM + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -152,9 +155,10 @@ func (c *ApiService) PageSyncMap(ServiceSid string, params *ListSyncMapParams, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -291,12 +295,13 @@ func (c *ApiService) UpdateSyncMap(ServiceSid string, Sid string, params *Update 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.CollectionTtl != nil { - data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) -} + + if params != nil && params.Ttl != nil { + data.Set("Ttl", fmt.Sprint(*params.Ttl)) + } + if params != nil && params.CollectionTtl != nil { + data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) + } diff --git a/rest/sync/v1/services_maps_items.go b/rest/sync/v1/services_maps_items.go index 12f879550..073e981a9 100644 --- a/rest/sync/v1/services_maps_items.go +++ b/rest/sync/v1/services_maps_items.go @@ -66,27 +66,28 @@ func (c *ApiService) CreateSyncMapItem(ServiceSid string, MapSid string, params data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Key != nil { - data.Set("Key", *params.Key) -} -if params != nil && params.Data != nil { - v, err := json.Marshal(params.Data) - if err != nil { - return nil, err + if params != nil && params.Key != nil { + data.Set("Key", *params.Key) } + if params != nil && params.Data != nil { + v, err := json.Marshal(params.Data) - data.Set("Data", string(v)) -} -if params != nil && params.Ttl != nil { - data.Set("Ttl", fmt.Sprint(*params.Ttl)) -} -if params != nil && params.ItemTtl != nil { - data.Set("ItemTtl", fmt.Sprint(*params.ItemTtl)) -} -if params != nil && params.CollectionTtl != nil { - data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) -} + if err != nil { + return nil, err + } + + data.Set("Data", string(v)) + } + if params != nil && params.Ttl != nil { + data.Set("Ttl", fmt.Sprint(*params.Ttl)) + } + if params != nil && params.ItemTtl != nil { + data.Set("ItemTtl", fmt.Sprint(*params.ItemTtl)) + } + if params != nil && params.CollectionTtl != nil { + data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) + } @@ -127,6 +128,7 @@ func (c *ApiService) DeleteSyncMapItem(ServiceSid string, MapSid string, Key str headers := make(map[string]interface{}) + if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } @@ -153,6 +155,7 @@ func (c *ApiService) FetchSyncMapItem(ServiceSid string, MapSid string, Key stri + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -212,18 +215,19 @@ func (c *ApiService) PageSyncMapItem(ServiceSid string, MapSid string, params *L data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Order != nil { - data.Set("Order", *params.Order) -} -if params != nil && params.From != nil { - data.Set("From", *params.From) -} -if params != nil && params.Bounds != nil { - data.Set("Bounds", *params.Bounds) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Order != nil { + data.Set("Order", *params.Order) + } + if params != nil && params.From != nil { + data.Set("From", *params.From) + } + if params != nil && params.Bounds != nil { + data.Set("Bounds", *params.Bounds) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -379,24 +383,25 @@ func (c *ApiService) UpdateSyncMapItem(ServiceSid string, MapSid string, Key str data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Data != nil { - v, err := json.Marshal(params.Data) - if err != nil { - return nil, err - } + if params != nil && params.Data != nil { + v, err := json.Marshal(params.Data) - data.Set("Data", string(v)) -} -if params != nil && params.Ttl != nil { - data.Set("Ttl", fmt.Sprint(*params.Ttl)) -} -if params != nil && params.ItemTtl != nil { - data.Set("ItemTtl", fmt.Sprint(*params.ItemTtl)) -} -if params != nil && params.CollectionTtl != nil { - data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) -} + if err != nil { + return nil, err + } + + data.Set("Data", string(v)) + } + if params != nil && params.Ttl != nil { + data.Set("Ttl", fmt.Sprint(*params.Ttl)) + } + if params != nil && params.ItemTtl != nil { + data.Set("ItemTtl", fmt.Sprint(*params.ItemTtl)) + } + if params != nil && params.CollectionTtl != nil { + data.Set("CollectionTtl", fmt.Sprint(*params.CollectionTtl)) + } if params != nil && params.IfMatch != nil { diff --git a/rest/sync/v1/services_maps_permissions.go b/rest/sync/v1/services_maps_permissions.go index d42e3acc6..12448eee4 100644 --- a/rest/sync/v1/services_maps_permissions.go +++ b/rest/sync/v1/services_maps_permissions.go @@ -35,6 +35,7 @@ func (c *ApiService) DeleteSyncMapPermission(ServiceSid string, MapSid string, I + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -57,6 +58,7 @@ func (c *ApiService) FetchSyncMapPermission(ServiceSid string, MapSid string, Id + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -98,9 +100,10 @@ func (c *ApiService) PageSyncMapPermission(ServiceSid string, MapSid string, par data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -244,15 +247,16 @@ func (c *ApiService) UpdateSyncMapPermission(ServiceSid string, MapSid string, I data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Read != nil { - data.Set("Read", fmt.Sprint(*params.Read)) -} -if params != nil && params.Write != nil { - data.Set("Write", fmt.Sprint(*params.Write)) -} -if params != nil && params.Manage != nil { - data.Set("Manage", fmt.Sprint(*params.Manage)) -} + + if params != nil && params.Read != nil { + data.Set("Read", fmt.Sprint(*params.Read)) + } + if params != nil && params.Write != nil { + data.Set("Write", fmt.Sprint(*params.Write)) + } + if params != nil && params.Manage != nil { + data.Set("Manage", fmt.Sprint(*params.Manage)) + } diff --git a/rest/sync/v1/services_streams.go b/rest/sync/v1/services_streams.go index b2ecb493a..c6dc9f2cd 100644 --- a/rest/sync/v1/services_streams.go +++ b/rest/sync/v1/services_streams.go @@ -47,12 +47,13 @@ func (c *ApiService) CreateSyncStream(ServiceSid string, params *CreateSyncStrea data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.Ttl != nil { - data.Set("Ttl", fmt.Sprint(*params.Ttl)) -} + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.Ttl != nil { + data.Set("Ttl", fmt.Sprint(*params.Ttl)) + } @@ -82,6 +83,7 @@ func (c *ApiService) DeleteSyncStream(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -103,6 +105,7 @@ func (c *ApiService) FetchSyncStream(ServiceSid string, Sid string, ) (*SyncV1Sy + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -143,9 +146,10 @@ func (c *ApiService) PageSyncStream(ServiceSid string, params *ListSyncStreamPar data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -276,9 +280,10 @@ func (c *ApiService) UpdateSyncStream(ServiceSid string, Sid string, params *Upd 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.Ttl != nil { + data.Set("Ttl", fmt.Sprint(*params.Ttl)) + } diff --git a/rest/sync/v1/services_streams_messages.go b/rest/sync/v1/services_streams_messages.go index e94c16ba4..ee08727a1 100644 --- a/rest/sync/v1/services_streams_messages.go +++ b/rest/sync/v1/services_streams_messages.go @@ -42,15 +42,16 @@ func (c *ApiService) CreateStreamMessage(ServiceSid string, StreamSid string, pa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Data != nil { - v, err := json.Marshal(params.Data) - if err != nil { - return nil, err - } + if params != nil && params.Data != nil { + v, err := json.Marshal(params.Data) - data.Set("Data", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Data", string(v)) + } diff --git a/rest/taskrouter/v1/workspaces.go b/rest/taskrouter/v1/workspaces.go index fa63ea17c..dd51e5a6b 100644 --- a/rest/taskrouter/v1/workspaces.go +++ b/rest/taskrouter/v1/workspaces.go @@ -70,24 +70,25 @@ func (c *ApiService) CreateWorkspace(params *CreateWorkspaceParams) (*Taskrouter data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.EventCallbackUrl != nil { - data.Set("EventCallbackUrl", *params.EventCallbackUrl) -} -if params != nil && params.EventsFilter != nil { - data.Set("EventsFilter", *params.EventsFilter) -} -if params != nil && params.MultiTaskEnabled != nil { - data.Set("MultiTaskEnabled", fmt.Sprint(*params.MultiTaskEnabled)) -} -if params != nil && params.Template != nil { - data.Set("Template", *params.Template) -} -if params != nil && params.PrioritizeQueueOrder != nil { - data.Set("PrioritizeQueueOrder", *params.PrioritizeQueueOrder) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.EventCallbackUrl != nil { + data.Set("EventCallbackUrl", *params.EventCallbackUrl) + } + if params != nil && params.EventsFilter != nil { + data.Set("EventsFilter", *params.EventsFilter) + } + if params != nil && params.MultiTaskEnabled != nil { + data.Set("MultiTaskEnabled", fmt.Sprint(*params.MultiTaskEnabled)) + } + if params != nil && params.Template != nil { + data.Set("Template", *params.Template) + } + if params != nil && params.PrioritizeQueueOrder != nil { + data.Set("PrioritizeQueueOrder", *params.PrioritizeQueueOrder) + } @@ -116,6 +117,7 @@ func (c *ApiService) DeleteWorkspace(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -136,6 +138,7 @@ func (c *ApiService) FetchWorkspace(Sid string, ) (*TaskrouterV1Workspace, error + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -181,12 +184,13 @@ func (c *ApiService) PageWorkspace(params *ListWorkspaceParams, pageToken, pageN 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)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -352,27 +356,28 @@ func (c *ApiService) UpdateWorkspace(Sid string, params *UpdateWorkspaceParams) data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.DefaultActivitySid != nil { - data.Set("DefaultActivitySid", *params.DefaultActivitySid) -} -if params != nil && params.EventCallbackUrl != nil { - data.Set("EventCallbackUrl", *params.EventCallbackUrl) -} -if params != nil && params.EventsFilter != nil { - data.Set("EventsFilter", *params.EventsFilter) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.MultiTaskEnabled != nil { - data.Set("MultiTaskEnabled", fmt.Sprint(*params.MultiTaskEnabled)) -} -if params != nil && params.TimeoutActivitySid != nil { - data.Set("TimeoutActivitySid", *params.TimeoutActivitySid) -} -if params != nil && params.PrioritizeQueueOrder != nil { - data.Set("PrioritizeQueueOrder", *params.PrioritizeQueueOrder) -} + + if params != nil && params.DefaultActivitySid != nil { + data.Set("DefaultActivitySid", *params.DefaultActivitySid) + } + if params != nil && params.EventCallbackUrl != nil { + data.Set("EventCallbackUrl", *params.EventCallbackUrl) + } + if params != nil && params.EventsFilter != nil { + data.Set("EventsFilter", *params.EventsFilter) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.MultiTaskEnabled != nil { + data.Set("MultiTaskEnabled", fmt.Sprint(*params.MultiTaskEnabled)) + } + if params != nil && params.TimeoutActivitySid != nil { + data.Set("TimeoutActivitySid", *params.TimeoutActivitySid) + } + if params != nil && params.PrioritizeQueueOrder != nil { + data.Set("PrioritizeQueueOrder", *params.PrioritizeQueueOrder) + } diff --git a/rest/taskrouter/v1/workspaces_activities.go b/rest/taskrouter/v1/workspaces_activities.go index b8ab69fb3..e84a0ed02 100644 --- a/rest/taskrouter/v1/workspaces_activities.go +++ b/rest/taskrouter/v1/workspaces_activities.go @@ -47,12 +47,13 @@ func (c *ApiService) CreateActivity(WorkspaceSid string, params *CreateActivityP data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Available != nil { - data.Set("Available", fmt.Sprint(*params.Available)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Available != nil { + data.Set("Available", fmt.Sprint(*params.Available)) + } @@ -82,6 +83,7 @@ func (c *ApiService) DeleteActivity(WorkspaceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -103,6 +105,7 @@ func (c *ApiService) FetchActivity(WorkspaceSid string, Sid string, ) (*Taskrout + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -155,15 +158,16 @@ func (c *ApiService) PageActivity(WorkspaceSid string, params *ListActivityParam data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Available != nil { - data.Set("Available", *params.Available) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Available != nil { + data.Set("Available", *params.Available) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -294,9 +298,10 @@ func (c *ApiService) UpdateActivity(WorkspaceSid string, Sid string, params *Upd data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } diff --git a/rest/taskrouter/v1/workspaces_cumulative_statistics.go b/rest/taskrouter/v1/workspaces_cumulative_statistics.go index e0a927a7f..1e1b964bd 100644 --- a/rest/taskrouter/v1/workspaces_cumulative_statistics.go +++ b/rest/taskrouter/v1/workspaces_cumulative_statistics.go @@ -65,21 +65,22 @@ func (c *ApiService) FetchWorkspaceCumulativeStatistics(WorkspaceSid string, par data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) -} -if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) -} -if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) -} -if params != nil && params.SplitByWaitTime != nil { - data.Set("SplitByWaitTime", *params.SplitByWaitTime) -} + + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + } + if params != nil && params.Minutes != nil { + data.Set("Minutes", fmt.Sprint(*params.Minutes)) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + } + if params != nil && params.TaskChannel != nil { + data.Set("TaskChannel", *params.TaskChannel) + } + if params != nil && params.SplitByWaitTime != nil { + data.Set("SplitByWaitTime", *params.SplitByWaitTime) + } diff --git a/rest/taskrouter/v1/workspaces_events.go b/rest/taskrouter/v1/workspaces_events.go index 361f6e42e..2d3d6e8e3 100644 --- a/rest/taskrouter/v1/workspaces_events.go +++ b/rest/taskrouter/v1/workspaces_events.go @@ -34,6 +34,7 @@ func (c *ApiService) FetchEvent(WorkspaceSid string, Sid string, ) (*TaskrouterV + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -140,42 +141,43 @@ func (c *ApiService) PageEvent(WorkspaceSid string, params *ListEventParams, pag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) -} -if params != nil && params.EventType != nil { - data.Set("EventType", *params.EventType) -} -if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) -} -if params != nil && params.ReservationSid != nil { - data.Set("ReservationSid", *params.ReservationSid) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) -} -if params != nil && params.TaskQueueSid != nil { - data.Set("TaskQueueSid", *params.TaskQueueSid) -} -if params != nil && params.TaskSid != nil { - data.Set("TaskSid", *params.TaskSid) -} -if params != nil && params.WorkerSid != nil { - data.Set("WorkerSid", *params.WorkerSid) -} -if params != nil && params.WorkflowSid != nil { - data.Set("WorkflowSid", *params.WorkflowSid) -} -if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) -} -if params != nil && params.Sid != nil { - data.Set("Sid", *params.Sid) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + } + if params != nil && params.EventType != nil { + data.Set("EventType", *params.EventType) + } + if params != nil && params.Minutes != nil { + data.Set("Minutes", fmt.Sprint(*params.Minutes)) + } + if params != nil && params.ReservationSid != nil { + data.Set("ReservationSid", *params.ReservationSid) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + } + if params != nil && params.TaskQueueSid != nil { + data.Set("TaskQueueSid", *params.TaskQueueSid) + } + if params != nil && params.TaskSid != nil { + data.Set("TaskSid", *params.TaskSid) + } + if params != nil && params.WorkerSid != nil { + data.Set("WorkerSid", *params.WorkerSid) + } + if params != nil && params.WorkflowSid != nil { + data.Set("WorkflowSid", *params.WorkflowSid) + } + if params != nil && params.TaskChannel != nil { + data.Set("TaskChannel", *params.TaskChannel) + } + if params != nil && params.Sid != nil { + data.Set("Sid", *params.Sid) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/taskrouter/v1/workspaces_real_time_statistics.go b/rest/taskrouter/v1/workspaces_real_time_statistics.go index 89182a2de..6509d522c 100644 --- a/rest/taskrouter/v1/workspaces_real_time_statistics.go +++ b/rest/taskrouter/v1/workspaces_real_time_statistics.go @@ -41,9 +41,10 @@ func (c *ApiService) FetchWorkspaceRealTimeStatistics(WorkspaceSid string, param data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) -} + + if params != nil && params.TaskChannel != nil { + data.Set("TaskChannel", *params.TaskChannel) + } diff --git a/rest/taskrouter/v1/workspaces_statistics.go b/rest/taskrouter/v1/workspaces_statistics.go index 2e1e9b62c..068918b48 100644 --- a/rest/taskrouter/v1/workspaces_statistics.go +++ b/rest/taskrouter/v1/workspaces_statistics.go @@ -65,21 +65,22 @@ func (c *ApiService) FetchWorkspaceStatistics(WorkspaceSid string, params *Fetch data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) -} -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) -} -if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) -} -if params != nil && params.SplitByWaitTime != nil { - data.Set("SplitByWaitTime", *params.SplitByWaitTime) -} + + if params != nil && params.Minutes != nil { + data.Set("Minutes", fmt.Sprint(*params.Minutes)) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + } + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + } + if params != nil && params.TaskChannel != nil { + data.Set("TaskChannel", *params.TaskChannel) + } + if params != nil && params.SplitByWaitTime != nil { + data.Set("SplitByWaitTime", *params.SplitByWaitTime) + } diff --git a/rest/taskrouter/v1/workspaces_task_channels.go b/rest/taskrouter/v1/workspaces_task_channels.go index a428e6b7a..d04ae824e 100644 --- a/rest/taskrouter/v1/workspaces_task_channels.go +++ b/rest/taskrouter/v1/workspaces_task_channels.go @@ -53,15 +53,16 @@ func (c *ApiService) CreateTaskChannel(WorkspaceSid string, params *CreateTaskCh 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) -} -if params != nil && params.ChannelOptimizedRouting != nil { - data.Set("ChannelOptimizedRouting", fmt.Sprint(*params.ChannelOptimizedRouting)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.ChannelOptimizedRouting != nil { + data.Set("ChannelOptimizedRouting", fmt.Sprint(*params.ChannelOptimizedRouting)) + } @@ -91,6 +92,7 @@ func (c *ApiService) DeleteTaskChannel(WorkspaceSid string, Sid string, ) (error + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -112,6 +114,7 @@ func (c *ApiService) FetchTaskChannel(WorkspaceSid string, Sid string, ) (*Taskr + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -152,9 +155,10 @@ func (c *ApiService) PageTaskChannel(WorkspaceSid string, params *ListTaskChanne data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -291,12 +295,13 @@ func (c *ApiService) UpdateTaskChannel(WorkspaceSid string, Sid string, params * data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.ChannelOptimizedRouting != nil { - data.Set("ChannelOptimizedRouting", fmt.Sprint(*params.ChannelOptimizedRouting)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.ChannelOptimizedRouting != nil { + data.Set("ChannelOptimizedRouting", fmt.Sprint(*params.ChannelOptimizedRouting)) + } diff --git a/rest/taskrouter/v1/workspaces_task_queues.go b/rest/taskrouter/v1/workspaces_task_queues.go index 787c172cc..a741a7638 100644 --- a/rest/taskrouter/v1/workspaces_task_queues.go +++ b/rest/taskrouter/v1/workspaces_task_queues.go @@ -71,24 +71,25 @@ func (c *ApiService) CreateTaskQueue(WorkspaceSid string, params *CreateTaskQueu data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.TargetWorkers != nil { - data.Set("TargetWorkers", *params.TargetWorkers) -} -if params != nil && params.MaxReservedWorkers != nil { - data.Set("MaxReservedWorkers", fmt.Sprint(*params.MaxReservedWorkers)) -} -if params != nil && params.TaskOrder != nil { - data.Set("TaskOrder", *params.TaskOrder) -} -if params != nil && params.ReservationActivitySid != nil { - data.Set("ReservationActivitySid", *params.ReservationActivitySid) -} -if params != nil && params.AssignmentActivitySid != nil { - data.Set("AssignmentActivitySid", *params.AssignmentActivitySid) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.TargetWorkers != nil { + data.Set("TargetWorkers", *params.TargetWorkers) + } + if params != nil && params.MaxReservedWorkers != nil { + data.Set("MaxReservedWorkers", fmt.Sprint(*params.MaxReservedWorkers)) + } + if params != nil && params.TaskOrder != nil { + data.Set("TaskOrder", *params.TaskOrder) + } + if params != nil && params.ReservationActivitySid != nil { + data.Set("ReservationActivitySid", *params.ReservationActivitySid) + } + if params != nil && params.AssignmentActivitySid != nil { + data.Set("AssignmentActivitySid", *params.AssignmentActivitySid) + } @@ -118,6 +119,7 @@ func (c *ApiService) DeleteTaskQueue(WorkspaceSid string, Sid string, ) (error) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -139,6 +141,7 @@ func (c *ApiService) FetchTaskQueue(WorkspaceSid string, Sid string, ) (*Taskrou + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -203,21 +206,22 @@ func (c *ApiService) PageTaskQueue(WorkspaceSid string, params *ListTaskQueuePar data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.EvaluateWorkerAttributes != nil { - data.Set("EvaluateWorkerAttributes", *params.EvaluateWorkerAttributes) -} -if params != nil && params.WorkerSid != nil { - data.Set("WorkerSid", *params.WorkerSid) -} -if params != nil && params.Ordering != nil { - data.Set("Ordering", *params.Ordering) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.EvaluateWorkerAttributes != nil { + data.Set("EvaluateWorkerAttributes", *params.EvaluateWorkerAttributes) + } + if params != nil && params.WorkerSid != nil { + data.Set("WorkerSid", *params.WorkerSid) + } + if params != nil && params.Ordering != nil { + data.Set("Ordering", *params.Ordering) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -378,24 +382,25 @@ func (c *ApiService) UpdateTaskQueue(WorkspaceSid string, Sid string, params *Up data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.TargetWorkers != nil { - data.Set("TargetWorkers", *params.TargetWorkers) -} -if params != nil && params.ReservationActivitySid != nil { - data.Set("ReservationActivitySid", *params.ReservationActivitySid) -} -if params != nil && params.AssignmentActivitySid != nil { - data.Set("AssignmentActivitySid", *params.AssignmentActivitySid) -} -if params != nil && params.MaxReservedWorkers != nil { - data.Set("MaxReservedWorkers", fmt.Sprint(*params.MaxReservedWorkers)) -} -if params != nil && params.TaskOrder != nil { - data.Set("TaskOrder", *params.TaskOrder) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.TargetWorkers != nil { + data.Set("TargetWorkers", *params.TargetWorkers) + } + if params != nil && params.ReservationActivitySid != nil { + data.Set("ReservationActivitySid", *params.ReservationActivitySid) + } + if params != nil && params.AssignmentActivitySid != nil { + data.Set("AssignmentActivitySid", *params.AssignmentActivitySid) + } + if params != nil && params.MaxReservedWorkers != nil { + data.Set("MaxReservedWorkers", fmt.Sprint(*params.MaxReservedWorkers)) + } + if params != nil && params.TaskOrder != nil { + data.Set("TaskOrder", *params.TaskOrder) + } diff --git a/rest/taskrouter/v1/workspaces_task_queues_cumulative_statistics.go b/rest/taskrouter/v1/workspaces_task_queues_cumulative_statistics.go index 438bd6f8b..b39ae5041 100644 --- a/rest/taskrouter/v1/workspaces_task_queues_cumulative_statistics.go +++ b/rest/taskrouter/v1/workspaces_task_queues_cumulative_statistics.go @@ -66,21 +66,22 @@ func (c *ApiService) FetchTaskQueueCumulativeStatistics(WorkspaceSid string, Tas data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) -} -if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) -} -if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) -} -if params != nil && params.SplitByWaitTime != nil { - data.Set("SplitByWaitTime", *params.SplitByWaitTime) -} + + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + } + if params != nil && params.Minutes != nil { + data.Set("Minutes", fmt.Sprint(*params.Minutes)) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + } + if params != nil && params.TaskChannel != nil { + data.Set("TaskChannel", *params.TaskChannel) + } + if params != nil && params.SplitByWaitTime != nil { + data.Set("SplitByWaitTime", *params.SplitByWaitTime) + } 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 864c0c617..0f838378c 100644 --- a/rest/taskrouter/v1/workspaces_task_queues_real_time_statistics.go +++ b/rest/taskrouter/v1/workspaces_task_queues_real_time_statistics.go @@ -33,6 +33,7 @@ func (c *ApiService) CreateTaskQueueBulkRealTimeStatistics(WorkspaceSid string, + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -67,9 +68,10 @@ func (c *ApiService) FetchTaskQueueRealTimeStatistics(WorkspaceSid string, TaskQ data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) -} + + if params != nil && params.TaskChannel != nil { + data.Set("TaskChannel", *params.TaskChannel) + } diff --git a/rest/taskrouter/v1/workspaces_task_queues_statistics.go b/rest/taskrouter/v1/workspaces_task_queues_statistics.go index 110f9b23c..8a9454587 100644 --- a/rest/taskrouter/v1/workspaces_task_queues_statistics.go +++ b/rest/taskrouter/v1/workspaces_task_queues_statistics.go @@ -66,21 +66,22 @@ func (c *ApiService) FetchTaskQueueStatistics(WorkspaceSid string, TaskQueueSid data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) -} -if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) -} -if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) -} -if params != nil && params.SplitByWaitTime != nil { - data.Set("SplitByWaitTime", *params.SplitByWaitTime) -} + + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + } + if params != nil && params.Minutes != nil { + data.Set("Minutes", fmt.Sprint(*params.Minutes)) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + } + if params != nil && params.TaskChannel != nil { + data.Set("TaskChannel", *params.TaskChannel) + } + if params != nil && params.SplitByWaitTime != nil { + data.Set("SplitByWaitTime", *params.SplitByWaitTime) + } @@ -160,27 +161,28 @@ func (c *ApiService) PageTaskQueuesStatistics(WorkspaceSid string, params *ListT data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) -} -if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) -} -if params != nil && params.SplitByWaitTime != nil { - data.Set("SplitByWaitTime", *params.SplitByWaitTime) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Minutes != nil { + data.Set("Minutes", fmt.Sprint(*params.Minutes)) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + } + if params != nil && params.TaskChannel != nil { + data.Set("TaskChannel", *params.TaskChannel) + } + if params != nil && params.SplitByWaitTime != nil { + data.Set("SplitByWaitTime", *params.SplitByWaitTime) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/taskrouter/v1/workspaces_tasks.go b/rest/taskrouter/v1/workspaces_tasks.go index 41740aa52..5702098fa 100644 --- a/rest/taskrouter/v1/workspaces_tasks.go +++ b/rest/taskrouter/v1/workspaces_tasks.go @@ -65,21 +65,22 @@ func (c *ApiService) CreateTask(WorkspaceSid string, params *CreateTaskParams) ( data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Timeout != nil { - data.Set("Timeout", fmt.Sprint(*params.Timeout)) -} -if params != nil && params.Priority != nil { - data.Set("Priority", fmt.Sprint(*params.Priority)) -} -if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) -} -if params != nil && params.WorkflowSid != nil { - data.Set("WorkflowSid", *params.WorkflowSid) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} + + if params != nil && params.Timeout != nil { + data.Set("Timeout", fmt.Sprint(*params.Timeout)) + } + if params != nil && params.Priority != nil { + data.Set("Priority", fmt.Sprint(*params.Priority)) + } + if params != nil && params.TaskChannel != nil { + data.Set("TaskChannel", *params.TaskChannel) + } + if params != nil && params.WorkflowSid != nil { + data.Set("WorkflowSid", *params.WorkflowSid) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } @@ -119,6 +120,7 @@ func (c *ApiService) DeleteTask(WorkspaceSid string, Sid string, params *DeleteT headers := make(map[string]interface{}) + if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } @@ -144,6 +146,7 @@ func (c *ApiService) FetchTask(WorkspaceSid string, Sid string, ) (*TaskrouterV1 + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -238,38 +241,39 @@ func (c *ApiService) PageTask(WorkspaceSid string, params *ListTaskParams, pageT data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Priority != nil { - data.Set("Priority", fmt.Sprint(*params.Priority)) -} -if params != nil && params.AssignmentStatus != nil { - for _, item := range *params.AssignmentStatus { - data.Add("AssignmentStatus", item) + + if params != nil && params.Priority != nil { + data.Set("Priority", fmt.Sprint(*params.Priority)) + } + if params != nil && params.AssignmentStatus != nil { + for _, item := range *params.AssignmentStatus { + data.Add("AssignmentStatus", item) + } + } + if params != nil && params.WorkflowSid != nil { + data.Set("WorkflowSid", *params.WorkflowSid) + } + if params != nil && params.WorkflowName != nil { + data.Set("WorkflowName", *params.WorkflowName) + } + if params != nil && params.TaskQueueSid != nil { + data.Set("TaskQueueSid", *params.TaskQueueSid) + } + if params != nil && params.TaskQueueName != nil { + data.Set("TaskQueueName", *params.TaskQueueName) + } + if params != nil && params.EvaluateTaskAttributes != nil { + data.Set("EvaluateTaskAttributes", *params.EvaluateTaskAttributes) + } + if params != nil && params.Ordering != nil { + data.Set("Ordering", *params.Ordering) + } + if params != nil && params.HasAddons != nil { + data.Set("HasAddons", fmt.Sprint(*params.HasAddons)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) } -} -if params != nil && params.WorkflowSid != nil { - data.Set("WorkflowSid", *params.WorkflowSid) -} -if params != nil && params.WorkflowName != nil { - data.Set("WorkflowName", *params.WorkflowName) -} -if params != nil && params.TaskQueueSid != nil { - data.Set("TaskQueueSid", *params.TaskQueueSid) -} -if params != nil && params.TaskQueueName != nil { - data.Set("TaskQueueName", *params.TaskQueueName) -} -if params != nil && params.EvaluateTaskAttributes != nil { - data.Set("EvaluateTaskAttributes", *params.EvaluateTaskAttributes) -} -if params != nil && params.Ordering != nil { - data.Set("Ordering", *params.Ordering) -} -if params != nil && params.HasAddons != nil { - data.Set("HasAddons", fmt.Sprint(*params.HasAddons)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} if pageToken != "" { data.Set("PageToken", pageToken) @@ -430,21 +434,22 @@ func (c *ApiService) UpdateTask(WorkspaceSid string, Sid string, params *UpdateT data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.AssignmentStatus != nil { - data.Set("AssignmentStatus", *params.AssignmentStatus) -} -if params != nil && params.Reason != nil { - data.Set("Reason", *params.Reason) -} -if params != nil && params.Priority != nil { - data.Set("Priority", fmt.Sprint(*params.Priority)) -} -if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) -} + + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.AssignmentStatus != nil { + data.Set("AssignmentStatus", *params.AssignmentStatus) + } + if params != nil && params.Reason != nil { + data.Set("Reason", *params.Reason) + } + if params != nil && params.Priority != nil { + data.Set("Priority", fmt.Sprint(*params.Priority)) + } + if params != nil && params.TaskChannel != nil { + data.Set("TaskChannel", *params.TaskChannel) + } if params != nil && params.IfMatch != nil { diff --git a/rest/taskrouter/v1/workspaces_tasks_reservations.go b/rest/taskrouter/v1/workspaces_tasks_reservations.go index 262ef11b6..e27ff6235 100644 --- a/rest/taskrouter/v1/workspaces_tasks_reservations.go +++ b/rest/taskrouter/v1/workspaces_tasks_reservations.go @@ -35,6 +35,7 @@ func (c *ApiService) FetchTaskReservation(WorkspaceSid string, TaskSid string, S + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -88,15 +89,16 @@ func (c *ApiService) PageTaskReservation(WorkspaceSid string, TaskSid string, pa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ReservationStatus != nil { - data.Set("ReservationStatus", *params.ReservationStatus) -} -if params != nil && params.WorkerSid != nil { - data.Set("WorkerSid", *params.WorkerSid) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.ReservationStatus != nil { + data.Set("ReservationStatus", *params.ReservationStatus) + } + if params != nil && params.WorkerSid != nil { + data.Set("WorkerSid", *params.WorkerSid) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -546,171 +548,172 @@ func (c *ApiService) UpdateTaskReservation(WorkspaceSid string, TaskSid string, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ReservationStatus != nil { - data.Set("ReservationStatus", *params.ReservationStatus) -} -if params != nil && params.WorkerActivitySid != nil { - data.Set("WorkerActivitySid", *params.WorkerActivitySid) -} -if params != nil && params.Instruction != nil { - data.Set("Instruction", *params.Instruction) -} -if params != nil && params.DequeuePostWorkActivitySid != nil { - data.Set("DequeuePostWorkActivitySid", *params.DequeuePostWorkActivitySid) -} -if params != nil && params.DequeueFrom != nil { - data.Set("DequeueFrom", *params.DequeueFrom) -} -if params != nil && params.DequeueRecord != nil { - data.Set("DequeueRecord", *params.DequeueRecord) -} -if params != nil && params.DequeueTimeout != nil { - data.Set("DequeueTimeout", fmt.Sprint(*params.DequeueTimeout)) -} -if params != nil && params.DequeueTo != nil { - data.Set("DequeueTo", *params.DequeueTo) -} -if params != nil && params.DequeueStatusCallbackUrl != nil { - data.Set("DequeueStatusCallbackUrl", *params.DequeueStatusCallbackUrl) -} -if params != nil && params.CallFrom != nil { - data.Set("CallFrom", *params.CallFrom) -} -if params != nil && params.CallRecord != nil { - data.Set("CallRecord", *params.CallRecord) -} -if params != nil && params.CallTimeout != nil { - data.Set("CallTimeout", fmt.Sprint(*params.CallTimeout)) -} -if params != nil && params.CallTo != nil { - data.Set("CallTo", *params.CallTo) -} -if params != nil && params.CallUrl != nil { - data.Set("CallUrl", *params.CallUrl) -} -if params != nil && params.CallStatusCallbackUrl != nil { - data.Set("CallStatusCallbackUrl", *params.CallStatusCallbackUrl) -} -if params != nil && params.CallAccept != nil { - data.Set("CallAccept", fmt.Sprint(*params.CallAccept)) -} -if params != nil && params.RedirectCallSid != nil { - data.Set("RedirectCallSid", *params.RedirectCallSid) -} -if params != nil && params.RedirectAccept != nil { - data.Set("RedirectAccept", fmt.Sprint(*params.RedirectAccept)) -} -if params != nil && params.RedirectUrl != nil { - data.Set("RedirectUrl", *params.RedirectUrl) -} -if params != nil && params.To != nil { - data.Set("To", *params.To) -} -if params != nil && params.From != nil { - data.Set("From", *params.From) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.StatusCallbackEvent != nil { - for _, item := range *params.StatusCallbackEvent { - data.Add("StatusCallbackEvent", item) + + if params != nil && params.ReservationStatus != nil { + data.Set("ReservationStatus", *params.ReservationStatus) } -} -if params != nil && params.Timeout != nil { - data.Set("Timeout", fmt.Sprint(*params.Timeout)) -} -if params != nil && params.Record != nil { - data.Set("Record", fmt.Sprint(*params.Record)) -} -if params != nil && params.Muted != nil { - data.Set("Muted", fmt.Sprint(*params.Muted)) -} -if params != nil && params.Beep != nil { - data.Set("Beep", *params.Beep) -} -if params != nil && params.StartConferenceOnEnter != nil { - data.Set("StartConferenceOnEnter", fmt.Sprint(*params.StartConferenceOnEnter)) -} -if params != nil && params.EndConferenceOnExit != nil { - data.Set("EndConferenceOnExit", fmt.Sprint(*params.EndConferenceOnExit)) -} -if params != nil && params.WaitUrl != nil { - data.Set("WaitUrl", *params.WaitUrl) -} -if params != nil && params.WaitMethod != nil { - data.Set("WaitMethod", *params.WaitMethod) -} -if params != nil && params.EarlyMedia != nil { - data.Set("EarlyMedia", fmt.Sprint(*params.EarlyMedia)) -} -if params != nil && params.MaxParticipants != nil { - data.Set("MaxParticipants", fmt.Sprint(*params.MaxParticipants)) -} -if params != nil && params.ConferenceStatusCallback != nil { - data.Set("ConferenceStatusCallback", *params.ConferenceStatusCallback) -} -if params != nil && params.ConferenceStatusCallbackMethod != nil { - data.Set("ConferenceStatusCallbackMethod", *params.ConferenceStatusCallbackMethod) -} -if params != nil && params.ConferenceStatusCallbackEvent != nil { - for _, item := range *params.ConferenceStatusCallbackEvent { - data.Add("ConferenceStatusCallbackEvent", item) + if params != nil && params.WorkerActivitySid != nil { + data.Set("WorkerActivitySid", *params.WorkerActivitySid) } -} -if params != nil && params.ConferenceRecord != nil { - data.Set("ConferenceRecord", *params.ConferenceRecord) -} -if params != nil && params.ConferenceTrim != nil { - data.Set("ConferenceTrim", *params.ConferenceTrim) -} -if params != nil && params.RecordingChannels != nil { - data.Set("RecordingChannels", *params.RecordingChannels) -} -if params != nil && params.RecordingStatusCallback != nil { - data.Set("RecordingStatusCallback", *params.RecordingStatusCallback) -} -if params != nil && params.RecordingStatusCallbackMethod != nil { - data.Set("RecordingStatusCallbackMethod", *params.RecordingStatusCallbackMethod) -} -if params != nil && params.ConferenceRecordingStatusCallback != nil { - data.Set("ConferenceRecordingStatusCallback", *params.ConferenceRecordingStatusCallback) -} -if params != nil && params.ConferenceRecordingStatusCallbackMethod != nil { - data.Set("ConferenceRecordingStatusCallbackMethod", *params.ConferenceRecordingStatusCallbackMethod) -} -if params != nil && params.Region != nil { - data.Set("Region", *params.Region) -} -if params != nil && params.SipAuthUsername != nil { - data.Set("SipAuthUsername", *params.SipAuthUsername) -} -if params != nil && params.SipAuthPassword != nil { - data.Set("SipAuthPassword", *params.SipAuthPassword) -} -if params != nil && params.DequeueStatusCallbackEvent != nil { - for _, item := range *params.DequeueStatusCallbackEvent { - data.Add("DequeueStatusCallbackEvent", item) + if params != nil && params.Instruction != nil { + data.Set("Instruction", *params.Instruction) + } + if params != nil && params.DequeuePostWorkActivitySid != nil { + data.Set("DequeuePostWorkActivitySid", *params.DequeuePostWorkActivitySid) + } + if params != nil && params.DequeueFrom != nil { + data.Set("DequeueFrom", *params.DequeueFrom) + } + if params != nil && params.DequeueRecord != nil { + data.Set("DequeueRecord", *params.DequeueRecord) + } + if params != nil && params.DequeueTimeout != nil { + data.Set("DequeueTimeout", fmt.Sprint(*params.DequeueTimeout)) + } + if params != nil && params.DequeueTo != nil { + data.Set("DequeueTo", *params.DequeueTo) + } + if params != nil && params.DequeueStatusCallbackUrl != nil { + data.Set("DequeueStatusCallbackUrl", *params.DequeueStatusCallbackUrl) + } + if params != nil && params.CallFrom != nil { + data.Set("CallFrom", *params.CallFrom) + } + if params != nil && params.CallRecord != nil { + data.Set("CallRecord", *params.CallRecord) + } + if params != nil && params.CallTimeout != nil { + data.Set("CallTimeout", fmt.Sprint(*params.CallTimeout)) + } + if params != nil && params.CallTo != nil { + data.Set("CallTo", *params.CallTo) + } + if params != nil && params.CallUrl != nil { + data.Set("CallUrl", *params.CallUrl) + } + if params != nil && params.CallStatusCallbackUrl != nil { + data.Set("CallStatusCallbackUrl", *params.CallStatusCallbackUrl) + } + if params != nil && params.CallAccept != nil { + data.Set("CallAccept", fmt.Sprint(*params.CallAccept)) + } + if params != nil && params.RedirectCallSid != nil { + data.Set("RedirectCallSid", *params.RedirectCallSid) + } + if params != nil && params.RedirectAccept != nil { + data.Set("RedirectAccept", fmt.Sprint(*params.RedirectAccept)) + } + if params != nil && params.RedirectUrl != nil { + data.Set("RedirectUrl", *params.RedirectUrl) + } + if params != nil && params.To != nil { + data.Set("To", *params.To) + } + if params != nil && params.From != nil { + data.Set("From", *params.From) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.StatusCallbackEvent != nil { + for _, item := range *params.StatusCallbackEvent { + data.Add("StatusCallbackEvent", item) + } + } + if params != nil && params.Timeout != nil { + data.Set("Timeout", fmt.Sprint(*params.Timeout)) + } + if params != nil && params.Record != nil { + data.Set("Record", fmt.Sprint(*params.Record)) + } + if params != nil && params.Muted != nil { + data.Set("Muted", fmt.Sprint(*params.Muted)) + } + if params != nil && params.Beep != nil { + data.Set("Beep", *params.Beep) + } + if params != nil && params.StartConferenceOnEnter != nil { + data.Set("StartConferenceOnEnter", fmt.Sprint(*params.StartConferenceOnEnter)) + } + if params != nil && params.EndConferenceOnExit != nil { + data.Set("EndConferenceOnExit", fmt.Sprint(*params.EndConferenceOnExit)) + } + if params != nil && params.WaitUrl != nil { + data.Set("WaitUrl", *params.WaitUrl) + } + if params != nil && params.WaitMethod != nil { + data.Set("WaitMethod", *params.WaitMethod) + } + if params != nil && params.EarlyMedia != nil { + data.Set("EarlyMedia", fmt.Sprint(*params.EarlyMedia)) + } + if params != nil && params.MaxParticipants != nil { + data.Set("MaxParticipants", fmt.Sprint(*params.MaxParticipants)) + } + if params != nil && params.ConferenceStatusCallback != nil { + data.Set("ConferenceStatusCallback", *params.ConferenceStatusCallback) + } + if params != nil && params.ConferenceStatusCallbackMethod != nil { + data.Set("ConferenceStatusCallbackMethod", *params.ConferenceStatusCallbackMethod) + } + if params != nil && params.ConferenceStatusCallbackEvent != nil { + for _, item := range *params.ConferenceStatusCallbackEvent { + data.Add("ConferenceStatusCallbackEvent", item) + } + } + if params != nil && params.ConferenceRecord != nil { + data.Set("ConferenceRecord", *params.ConferenceRecord) + } + if params != nil && params.ConferenceTrim != nil { + data.Set("ConferenceTrim", *params.ConferenceTrim) + } + if params != nil && params.RecordingChannels != nil { + data.Set("RecordingChannels", *params.RecordingChannels) + } + if params != nil && params.RecordingStatusCallback != nil { + data.Set("RecordingStatusCallback", *params.RecordingStatusCallback) + } + if params != nil && params.RecordingStatusCallbackMethod != nil { + data.Set("RecordingStatusCallbackMethod", *params.RecordingStatusCallbackMethod) + } + if params != nil && params.ConferenceRecordingStatusCallback != nil { + data.Set("ConferenceRecordingStatusCallback", *params.ConferenceRecordingStatusCallback) + } + if params != nil && params.ConferenceRecordingStatusCallbackMethod != nil { + data.Set("ConferenceRecordingStatusCallbackMethod", *params.ConferenceRecordingStatusCallbackMethod) + } + if params != nil && params.Region != nil { + data.Set("Region", *params.Region) + } + if params != nil && params.SipAuthUsername != nil { + data.Set("SipAuthUsername", *params.SipAuthUsername) + } + if params != nil && params.SipAuthPassword != nil { + data.Set("SipAuthPassword", *params.SipAuthPassword) + } + if params != nil && params.DequeueStatusCallbackEvent != nil { + for _, item := range *params.DequeueStatusCallbackEvent { + data.Add("DequeueStatusCallbackEvent", item) + } + } + if params != nil && params.PostWorkActivitySid != nil { + data.Set("PostWorkActivitySid", *params.PostWorkActivitySid) + } + if params != nil && params.SupervisorMode != nil { + data.Set("SupervisorMode", *params.SupervisorMode) + } + if params != nil && params.Supervisor != nil { + data.Set("Supervisor", *params.Supervisor) + } + if params != nil && params.EndConferenceOnCustomerExit != nil { + data.Set("EndConferenceOnCustomerExit", fmt.Sprint(*params.EndConferenceOnCustomerExit)) + } + if params != nil && params.BeepOnCustomerEntrance != nil { + data.Set("BeepOnCustomerEntrance", fmt.Sprint(*params.BeepOnCustomerEntrance)) } -} -if params != nil && params.PostWorkActivitySid != nil { - data.Set("PostWorkActivitySid", *params.PostWorkActivitySid) -} -if params != nil && params.SupervisorMode != nil { - data.Set("SupervisorMode", *params.SupervisorMode) -} -if params != nil && params.Supervisor != nil { - data.Set("Supervisor", *params.Supervisor) -} -if params != nil && params.EndConferenceOnCustomerExit != nil { - data.Set("EndConferenceOnCustomerExit", fmt.Sprint(*params.EndConferenceOnCustomerExit)) -} -if params != nil && params.BeepOnCustomerEntrance != nil { - data.Set("BeepOnCustomerEntrance", fmt.Sprint(*params.BeepOnCustomerEntrance)) -} if params != nil && params.IfMatch != nil { diff --git a/rest/taskrouter/v1/workspaces_workers.go b/rest/taskrouter/v1/workspaces_workers.go index 94f4df17e..c0d518ce9 100644 --- a/rest/taskrouter/v1/workspaces_workers.go +++ b/rest/taskrouter/v1/workspaces_workers.go @@ -53,15 +53,16 @@ func (c *ApiService) CreateWorker(WorkspaceSid string, params *CreateWorkerParam data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.ActivitySid != nil { - data.Set("ActivitySid", *params.ActivitySid) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.ActivitySid != nil { + data.Set("ActivitySid", *params.ActivitySid) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } @@ -101,6 +102,7 @@ func (c *ApiService) DeleteWorker(WorkspaceSid string, Sid string, params *Delet headers := make(map[string]interface{}) + if params != nil && params.IfMatch != nil { headers["If-Match"] = *params.IfMatch } @@ -126,6 +128,7 @@ func (c *ApiService) FetchWorker(WorkspaceSid string, Sid string, ) (*Taskrouter + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -214,33 +217,34 @@ func (c *ApiService) PageWorker(WorkspaceSid string, params *ListWorkerParams, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ActivityName != nil { - data.Set("ActivityName", *params.ActivityName) -} -if params != nil && params.ActivitySid != nil { - data.Set("ActivitySid", *params.ActivitySid) -} -if params != nil && params.Available != nil { - data.Set("Available", *params.Available) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.TargetWorkersExpression != nil { - data.Set("TargetWorkersExpression", *params.TargetWorkersExpression) -} -if params != nil && params.TaskQueueName != nil { - data.Set("TaskQueueName", *params.TaskQueueName) -} -if params != nil && params.TaskQueueSid != nil { - data.Set("TaskQueueSid", *params.TaskQueueSid) -} -if params != nil && params.Ordering != nil { - data.Set("Ordering", *params.Ordering) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.ActivityName != nil { + data.Set("ActivityName", *params.ActivityName) + } + if params != nil && params.ActivitySid != nil { + data.Set("ActivitySid", *params.ActivitySid) + } + if params != nil && params.Available != nil { + data.Set("Available", *params.Available) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.TargetWorkersExpression != nil { + data.Set("TargetWorkersExpression", *params.TargetWorkersExpression) + } + if params != nil && params.TaskQueueName != nil { + data.Set("TaskQueueName", *params.TaskQueueName) + } + if params != nil && params.TaskQueueSid != nil { + data.Set("TaskQueueSid", *params.TaskQueueSid) + } + if params != nil && params.Ordering != nil { + data.Set("Ordering", *params.Ordering) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -395,18 +399,19 @@ func (c *ApiService) UpdateWorker(WorkspaceSid string, Sid string, params *Updat data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ActivitySid != nil { - data.Set("ActivitySid", *params.ActivitySid) -} -if params != nil && params.Attributes != nil { - data.Set("Attributes", *params.Attributes) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.RejectPendingReservations != nil { - data.Set("RejectPendingReservations", fmt.Sprint(*params.RejectPendingReservations)) -} + + if params != nil && params.ActivitySid != nil { + data.Set("ActivitySid", *params.ActivitySid) + } + if params != nil && params.Attributes != nil { + data.Set("Attributes", *params.Attributes) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.RejectPendingReservations != nil { + data.Set("RejectPendingReservations", fmt.Sprint(*params.RejectPendingReservations)) + } if params != nil && params.IfMatch != nil { diff --git a/rest/taskrouter/v1/workspaces_workers_channels.go b/rest/taskrouter/v1/workspaces_workers_channels.go index 4ef7992eb..7639d163b 100644 --- a/rest/taskrouter/v1/workspaces_workers_channels.go +++ b/rest/taskrouter/v1/workspaces_workers_channels.go @@ -35,6 +35,7 @@ func (c *ApiService) FetchWorkerChannel(WorkspaceSid string, WorkerSid string, S + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -76,9 +77,10 @@ func (c *ApiService) PageWorkerChannel(WorkspaceSid string, WorkerSid string, pa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -216,12 +218,13 @@ func (c *ApiService) UpdateWorkerChannel(WorkspaceSid string, WorkerSid string, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Capacity != nil { - data.Set("Capacity", fmt.Sprint(*params.Capacity)) -} -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)) + } + if params != nil && params.Available != nil { + data.Set("Available", fmt.Sprint(*params.Available)) + } diff --git a/rest/taskrouter/v1/workspaces_workers_cumulative_statistics.go b/rest/taskrouter/v1/workspaces_workers_cumulative_statistics.go index 1cd3fb551..6e570895f 100644 --- a/rest/taskrouter/v1/workspaces_workers_cumulative_statistics.go +++ b/rest/taskrouter/v1/workspaces_workers_cumulative_statistics.go @@ -59,18 +59,19 @@ func (c *ApiService) FetchWorkersCumulativeStatistics(WorkspaceSid string, param data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) -} -if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) -} -if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) -} + + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + } + if params != nil && params.Minutes != nil { + data.Set("Minutes", fmt.Sprint(*params.Minutes)) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + } + if params != nil && params.TaskChannel != nil { + data.Set("TaskChannel", *params.TaskChannel) + } diff --git a/rest/taskrouter/v1/workspaces_workers_real_time_statistics.go b/rest/taskrouter/v1/workspaces_workers_real_time_statistics.go index 44d6b6ba1..714e32902 100644 --- a/rest/taskrouter/v1/workspaces_workers_real_time_statistics.go +++ b/rest/taskrouter/v1/workspaces_workers_real_time_statistics.go @@ -41,9 +41,10 @@ func (c *ApiService) FetchWorkersRealTimeStatistics(WorkspaceSid string, params data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) -} + + if params != nil && params.TaskChannel != nil { + data.Set("TaskChannel", *params.TaskChannel) + } diff --git a/rest/taskrouter/v1/workspaces_workers_reservations.go b/rest/taskrouter/v1/workspaces_workers_reservations.go index 2605bef8f..a739e8293 100644 --- a/rest/taskrouter/v1/workspaces_workers_reservations.go +++ b/rest/taskrouter/v1/workspaces_workers_reservations.go @@ -35,6 +35,7 @@ func (c *ApiService) FetchWorkerReservation(WorkspaceSid string, WorkerSid strin + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -82,12 +83,13 @@ func (c *ApiService) PageWorkerReservation(WorkspaceSid string, WorkerSid string 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)) -} + + if params != nil && params.ReservationStatus != nil { + data.Set("ReservationStatus", *params.ReservationStatus) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -525,165 +527,166 @@ func (c *ApiService) UpdateWorkerReservation(WorkspaceSid string, WorkerSid stri data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ReservationStatus != nil { - data.Set("ReservationStatus", *params.ReservationStatus) -} -if params != nil && params.WorkerActivitySid != nil { - data.Set("WorkerActivitySid", *params.WorkerActivitySid) -} -if params != nil && params.Instruction != nil { - data.Set("Instruction", *params.Instruction) -} -if params != nil && params.DequeuePostWorkActivitySid != nil { - data.Set("DequeuePostWorkActivitySid", *params.DequeuePostWorkActivitySid) -} -if params != nil && params.DequeueFrom != nil { - data.Set("DequeueFrom", *params.DequeueFrom) -} -if params != nil && params.DequeueRecord != nil { - data.Set("DequeueRecord", *params.DequeueRecord) -} -if params != nil && params.DequeueTimeout != nil { - data.Set("DequeueTimeout", fmt.Sprint(*params.DequeueTimeout)) -} -if params != nil && params.DequeueTo != nil { - data.Set("DequeueTo", *params.DequeueTo) -} -if params != nil && params.DequeueStatusCallbackUrl != nil { - data.Set("DequeueStatusCallbackUrl", *params.DequeueStatusCallbackUrl) -} -if params != nil && params.CallFrom != nil { - data.Set("CallFrom", *params.CallFrom) -} -if params != nil && params.CallRecord != nil { - data.Set("CallRecord", *params.CallRecord) -} -if params != nil && params.CallTimeout != nil { - data.Set("CallTimeout", fmt.Sprint(*params.CallTimeout)) -} -if params != nil && params.CallTo != nil { - data.Set("CallTo", *params.CallTo) -} -if params != nil && params.CallUrl != nil { - data.Set("CallUrl", *params.CallUrl) -} -if params != nil && params.CallStatusCallbackUrl != nil { - data.Set("CallStatusCallbackUrl", *params.CallStatusCallbackUrl) -} -if params != nil && params.CallAccept != nil { - data.Set("CallAccept", fmt.Sprint(*params.CallAccept)) -} -if params != nil && params.RedirectCallSid != nil { - data.Set("RedirectCallSid", *params.RedirectCallSid) -} -if params != nil && params.RedirectAccept != nil { - data.Set("RedirectAccept", fmt.Sprint(*params.RedirectAccept)) -} -if params != nil && params.RedirectUrl != nil { - data.Set("RedirectUrl", *params.RedirectUrl) -} -if params != nil && params.To != nil { - data.Set("To", *params.To) -} -if params != nil && params.From != nil { - data.Set("From", *params.From) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.StatusCallbackEvent != nil { - for _, item := range *params.StatusCallbackEvent { - data.Add("StatusCallbackEvent", item) + + if params != nil && params.ReservationStatus != nil { + data.Set("ReservationStatus", *params.ReservationStatus) } -} -if params != nil && params.Timeout != nil { - data.Set("Timeout", fmt.Sprint(*params.Timeout)) -} -if params != nil && params.Record != nil { - data.Set("Record", fmt.Sprint(*params.Record)) -} -if params != nil && params.Muted != nil { - data.Set("Muted", fmt.Sprint(*params.Muted)) -} -if params != nil && params.Beep != nil { - data.Set("Beep", *params.Beep) -} -if params != nil && params.StartConferenceOnEnter != nil { - data.Set("StartConferenceOnEnter", fmt.Sprint(*params.StartConferenceOnEnter)) -} -if params != nil && params.EndConferenceOnExit != nil { - data.Set("EndConferenceOnExit", fmt.Sprint(*params.EndConferenceOnExit)) -} -if params != nil && params.WaitUrl != nil { - data.Set("WaitUrl", *params.WaitUrl) -} -if params != nil && params.WaitMethod != nil { - data.Set("WaitMethod", *params.WaitMethod) -} -if params != nil && params.EarlyMedia != nil { - data.Set("EarlyMedia", fmt.Sprint(*params.EarlyMedia)) -} -if params != nil && params.MaxParticipants != nil { - data.Set("MaxParticipants", fmt.Sprint(*params.MaxParticipants)) -} -if params != nil && params.ConferenceStatusCallback != nil { - data.Set("ConferenceStatusCallback", *params.ConferenceStatusCallback) -} -if params != nil && params.ConferenceStatusCallbackMethod != nil { - data.Set("ConferenceStatusCallbackMethod", *params.ConferenceStatusCallbackMethod) -} -if params != nil && params.ConferenceStatusCallbackEvent != nil { - for _, item := range *params.ConferenceStatusCallbackEvent { - data.Add("ConferenceStatusCallbackEvent", item) + if params != nil && params.WorkerActivitySid != nil { + data.Set("WorkerActivitySid", *params.WorkerActivitySid) } -} -if params != nil && params.ConferenceRecord != nil { - data.Set("ConferenceRecord", *params.ConferenceRecord) -} -if params != nil && params.ConferenceTrim != nil { - data.Set("ConferenceTrim", *params.ConferenceTrim) -} -if params != nil && params.RecordingChannels != nil { - data.Set("RecordingChannels", *params.RecordingChannels) -} -if params != nil && params.RecordingStatusCallback != nil { - data.Set("RecordingStatusCallback", *params.RecordingStatusCallback) -} -if params != nil && params.RecordingStatusCallbackMethod != nil { - data.Set("RecordingStatusCallbackMethod", *params.RecordingStatusCallbackMethod) -} -if params != nil && params.ConferenceRecordingStatusCallback != nil { - data.Set("ConferenceRecordingStatusCallback", *params.ConferenceRecordingStatusCallback) -} -if params != nil && params.ConferenceRecordingStatusCallbackMethod != nil { - data.Set("ConferenceRecordingStatusCallbackMethod", *params.ConferenceRecordingStatusCallbackMethod) -} -if params != nil && params.Region != nil { - data.Set("Region", *params.Region) -} -if params != nil && params.SipAuthUsername != nil { - data.Set("SipAuthUsername", *params.SipAuthUsername) -} -if params != nil && params.SipAuthPassword != nil { - data.Set("SipAuthPassword", *params.SipAuthPassword) -} -if params != nil && params.DequeueStatusCallbackEvent != nil { - for _, item := range *params.DequeueStatusCallbackEvent { - data.Add("DequeueStatusCallbackEvent", item) + if params != nil && params.Instruction != nil { + data.Set("Instruction", *params.Instruction) + } + if params != nil && params.DequeuePostWorkActivitySid != nil { + data.Set("DequeuePostWorkActivitySid", *params.DequeuePostWorkActivitySid) + } + if params != nil && params.DequeueFrom != nil { + data.Set("DequeueFrom", *params.DequeueFrom) + } + if params != nil && params.DequeueRecord != nil { + data.Set("DequeueRecord", *params.DequeueRecord) + } + if params != nil && params.DequeueTimeout != nil { + data.Set("DequeueTimeout", fmt.Sprint(*params.DequeueTimeout)) + } + if params != nil && params.DequeueTo != nil { + data.Set("DequeueTo", *params.DequeueTo) + } + if params != nil && params.DequeueStatusCallbackUrl != nil { + data.Set("DequeueStatusCallbackUrl", *params.DequeueStatusCallbackUrl) + } + if params != nil && params.CallFrom != nil { + data.Set("CallFrom", *params.CallFrom) + } + if params != nil && params.CallRecord != nil { + data.Set("CallRecord", *params.CallRecord) + } + if params != nil && params.CallTimeout != nil { + data.Set("CallTimeout", fmt.Sprint(*params.CallTimeout)) + } + if params != nil && params.CallTo != nil { + data.Set("CallTo", *params.CallTo) + } + if params != nil && params.CallUrl != nil { + data.Set("CallUrl", *params.CallUrl) + } + if params != nil && params.CallStatusCallbackUrl != nil { + data.Set("CallStatusCallbackUrl", *params.CallStatusCallbackUrl) + } + if params != nil && params.CallAccept != nil { + data.Set("CallAccept", fmt.Sprint(*params.CallAccept)) + } + if params != nil && params.RedirectCallSid != nil { + data.Set("RedirectCallSid", *params.RedirectCallSid) + } + if params != nil && params.RedirectAccept != nil { + data.Set("RedirectAccept", fmt.Sprint(*params.RedirectAccept)) + } + if params != nil && params.RedirectUrl != nil { + data.Set("RedirectUrl", *params.RedirectUrl) + } + if params != nil && params.To != nil { + data.Set("To", *params.To) + } + if params != nil && params.From != nil { + data.Set("From", *params.From) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.StatusCallbackEvent != nil { + for _, item := range *params.StatusCallbackEvent { + data.Add("StatusCallbackEvent", item) + } + } + if params != nil && params.Timeout != nil { + data.Set("Timeout", fmt.Sprint(*params.Timeout)) + } + if params != nil && params.Record != nil { + data.Set("Record", fmt.Sprint(*params.Record)) + } + if params != nil && params.Muted != nil { + data.Set("Muted", fmt.Sprint(*params.Muted)) + } + if params != nil && params.Beep != nil { + data.Set("Beep", *params.Beep) + } + if params != nil && params.StartConferenceOnEnter != nil { + data.Set("StartConferenceOnEnter", fmt.Sprint(*params.StartConferenceOnEnter)) + } + if params != nil && params.EndConferenceOnExit != nil { + data.Set("EndConferenceOnExit", fmt.Sprint(*params.EndConferenceOnExit)) + } + if params != nil && params.WaitUrl != nil { + data.Set("WaitUrl", *params.WaitUrl) + } + if params != nil && params.WaitMethod != nil { + data.Set("WaitMethod", *params.WaitMethod) + } + if params != nil && params.EarlyMedia != nil { + data.Set("EarlyMedia", fmt.Sprint(*params.EarlyMedia)) + } + if params != nil && params.MaxParticipants != nil { + data.Set("MaxParticipants", fmt.Sprint(*params.MaxParticipants)) + } + if params != nil && params.ConferenceStatusCallback != nil { + data.Set("ConferenceStatusCallback", *params.ConferenceStatusCallback) + } + if params != nil && params.ConferenceStatusCallbackMethod != nil { + data.Set("ConferenceStatusCallbackMethod", *params.ConferenceStatusCallbackMethod) + } + if params != nil && params.ConferenceStatusCallbackEvent != nil { + for _, item := range *params.ConferenceStatusCallbackEvent { + data.Add("ConferenceStatusCallbackEvent", item) + } + } + if params != nil && params.ConferenceRecord != nil { + data.Set("ConferenceRecord", *params.ConferenceRecord) + } + if params != nil && params.ConferenceTrim != nil { + data.Set("ConferenceTrim", *params.ConferenceTrim) + } + if params != nil && params.RecordingChannels != nil { + data.Set("RecordingChannels", *params.RecordingChannels) + } + if params != nil && params.RecordingStatusCallback != nil { + data.Set("RecordingStatusCallback", *params.RecordingStatusCallback) + } + if params != nil && params.RecordingStatusCallbackMethod != nil { + data.Set("RecordingStatusCallbackMethod", *params.RecordingStatusCallbackMethod) + } + if params != nil && params.ConferenceRecordingStatusCallback != nil { + data.Set("ConferenceRecordingStatusCallback", *params.ConferenceRecordingStatusCallback) + } + if params != nil && params.ConferenceRecordingStatusCallbackMethod != nil { + data.Set("ConferenceRecordingStatusCallbackMethod", *params.ConferenceRecordingStatusCallbackMethod) + } + if params != nil && params.Region != nil { + data.Set("Region", *params.Region) + } + if params != nil && params.SipAuthUsername != nil { + data.Set("SipAuthUsername", *params.SipAuthUsername) + } + if params != nil && params.SipAuthPassword != nil { + data.Set("SipAuthPassword", *params.SipAuthPassword) + } + if params != nil && params.DequeueStatusCallbackEvent != nil { + for _, item := range *params.DequeueStatusCallbackEvent { + data.Add("DequeueStatusCallbackEvent", item) + } + } + if params != nil && params.PostWorkActivitySid != nil { + data.Set("PostWorkActivitySid", *params.PostWorkActivitySid) + } + if params != nil && params.EndConferenceOnCustomerExit != nil { + data.Set("EndConferenceOnCustomerExit", fmt.Sprint(*params.EndConferenceOnCustomerExit)) + } + if params != nil && params.BeepOnCustomerEntrance != nil { + data.Set("BeepOnCustomerEntrance", fmt.Sprint(*params.BeepOnCustomerEntrance)) } -} -if params != nil && params.PostWorkActivitySid != nil { - data.Set("PostWorkActivitySid", *params.PostWorkActivitySid) -} -if params != nil && params.EndConferenceOnCustomerExit != nil { - data.Set("EndConferenceOnCustomerExit", fmt.Sprint(*params.EndConferenceOnCustomerExit)) -} -if params != nil && params.BeepOnCustomerEntrance != nil { - data.Set("BeepOnCustomerEntrance", fmt.Sprint(*params.BeepOnCustomerEntrance)) -} if params != nil && params.IfMatch != nil { diff --git a/rest/taskrouter/v1/workspaces_workers_statistics.go b/rest/taskrouter/v1/workspaces_workers_statistics.go index d124f1084..69099c272 100644 --- a/rest/taskrouter/v1/workspaces_workers_statistics.go +++ b/rest/taskrouter/v1/workspaces_workers_statistics.go @@ -60,18 +60,19 @@ func (c *ApiService) FetchWorkerInstanceStatistics(WorkspaceSid string, WorkerSi data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) -} -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) -} -if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) -} + + if params != nil && params.Minutes != nil { + data.Set("Minutes", fmt.Sprint(*params.Minutes)) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + } + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + } + if params != nil && params.TaskChannel != nil { + data.Set("TaskChannel", *params.TaskChannel) + } @@ -144,27 +145,28 @@ func (c *ApiService) FetchWorkerStatistics(WorkspaceSid string, params *FetchWor data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) -} -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) -} -if params != nil && params.TaskQueueSid != nil { - data.Set("TaskQueueSid", *params.TaskQueueSid) -} -if params != nil && params.TaskQueueName != nil { - data.Set("TaskQueueName", *params.TaskQueueName) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) -} + + if params != nil && params.Minutes != nil { + data.Set("Minutes", fmt.Sprint(*params.Minutes)) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + } + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + } + if params != nil && params.TaskQueueSid != nil { + data.Set("TaskQueueSid", *params.TaskQueueSid) + } + if params != nil && params.TaskQueueName != nil { + data.Set("TaskQueueName", *params.TaskQueueName) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.TaskChannel != nil { + data.Set("TaskChannel", *params.TaskChannel) + } diff --git a/rest/taskrouter/v1/workspaces_workflows.go b/rest/taskrouter/v1/workspaces_workflows.go index 22322d410..ba65d00b4 100644 --- a/rest/taskrouter/v1/workspaces_workflows.go +++ b/rest/taskrouter/v1/workspaces_workflows.go @@ -65,21 +65,22 @@ func (c *ApiService) CreateWorkflow(WorkspaceSid string, params *CreateWorkflowP data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Configuration != nil { - data.Set("Configuration", *params.Configuration) -} -if params != nil && params.AssignmentCallbackUrl != nil { - data.Set("AssignmentCallbackUrl", *params.AssignmentCallbackUrl) -} -if params != nil && params.FallbackAssignmentCallbackUrl != nil { - data.Set("FallbackAssignmentCallbackUrl", *params.FallbackAssignmentCallbackUrl) -} -if params != nil && params.TaskReservationTimeout != nil { - data.Set("TaskReservationTimeout", fmt.Sprint(*params.TaskReservationTimeout)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Configuration != nil { + data.Set("Configuration", *params.Configuration) + } + if params != nil && params.AssignmentCallbackUrl != nil { + data.Set("AssignmentCallbackUrl", *params.AssignmentCallbackUrl) + } + if params != nil && params.FallbackAssignmentCallbackUrl != nil { + data.Set("FallbackAssignmentCallbackUrl", *params.FallbackAssignmentCallbackUrl) + } + if params != nil && params.TaskReservationTimeout != nil { + data.Set("TaskReservationTimeout", fmt.Sprint(*params.TaskReservationTimeout)) + } @@ -109,6 +110,7 @@ func (c *ApiService) DeleteWorkflow(WorkspaceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -130,6 +132,7 @@ func (c *ApiService) FetchWorkflow(WorkspaceSid string, Sid string, ) (*Taskrout + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -176,12 +179,13 @@ func (c *ApiService) PageWorkflow(WorkspaceSid string, params *ListWorkflowParam 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)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -342,24 +346,25 @@ func (c *ApiService) UpdateWorkflow(WorkspaceSid string, Sid string, params *Upd data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.AssignmentCallbackUrl != nil { - data.Set("AssignmentCallbackUrl", *params.AssignmentCallbackUrl) -} -if params != nil && params.FallbackAssignmentCallbackUrl != nil { - data.Set("FallbackAssignmentCallbackUrl", *params.FallbackAssignmentCallbackUrl) -} -if params != nil && params.Configuration != nil { - data.Set("Configuration", *params.Configuration) -} -if params != nil && params.TaskReservationTimeout != nil { - data.Set("TaskReservationTimeout", fmt.Sprint(*params.TaskReservationTimeout)) -} -if params != nil && params.ReEvaluateTasks != nil { - data.Set("ReEvaluateTasks", *params.ReEvaluateTasks) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.AssignmentCallbackUrl != nil { + data.Set("AssignmentCallbackUrl", *params.AssignmentCallbackUrl) + } + if params != nil && params.FallbackAssignmentCallbackUrl != nil { + data.Set("FallbackAssignmentCallbackUrl", *params.FallbackAssignmentCallbackUrl) + } + if params != nil && params.Configuration != nil { + data.Set("Configuration", *params.Configuration) + } + if params != nil && params.TaskReservationTimeout != nil { + data.Set("TaskReservationTimeout", fmt.Sprint(*params.TaskReservationTimeout)) + } + if params != nil && params.ReEvaluateTasks != nil { + data.Set("ReEvaluateTasks", *params.ReEvaluateTasks) + } diff --git a/rest/taskrouter/v1/workspaces_workflows_cumulative_statistics.go b/rest/taskrouter/v1/workspaces_workflows_cumulative_statistics.go index 70c05a7b6..0e7be0849 100644 --- a/rest/taskrouter/v1/workspaces_workflows_cumulative_statistics.go +++ b/rest/taskrouter/v1/workspaces_workflows_cumulative_statistics.go @@ -66,21 +66,22 @@ func (c *ApiService) FetchWorkflowCumulativeStatistics(WorkspaceSid string, Work data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) -} -if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) -} -if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) -} -if params != nil && params.SplitByWaitTime != nil { - data.Set("SplitByWaitTime", *params.SplitByWaitTime) -} + + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + } + if params != nil && params.Minutes != nil { + data.Set("Minutes", fmt.Sprint(*params.Minutes)) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + } + if params != nil && params.TaskChannel != nil { + data.Set("TaskChannel", *params.TaskChannel) + } + if params != nil && params.SplitByWaitTime != nil { + data.Set("SplitByWaitTime", *params.SplitByWaitTime) + } diff --git a/rest/taskrouter/v1/workspaces_workflows_real_time_statistics.go b/rest/taskrouter/v1/workspaces_workflows_real_time_statistics.go index 2ff358dbf..6f4ee227c 100644 --- a/rest/taskrouter/v1/workspaces_workflows_real_time_statistics.go +++ b/rest/taskrouter/v1/workspaces_workflows_real_time_statistics.go @@ -42,9 +42,10 @@ func (c *ApiService) FetchWorkflowRealTimeStatistics(WorkspaceSid string, Workfl data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) -} + + if params != nil && params.TaskChannel != nil { + data.Set("TaskChannel", *params.TaskChannel) + } diff --git a/rest/taskrouter/v1/workspaces_workflows_statistics.go b/rest/taskrouter/v1/workspaces_workflows_statistics.go index 1cae71618..3f0e826dc 100644 --- a/rest/taskrouter/v1/workspaces_workflows_statistics.go +++ b/rest/taskrouter/v1/workspaces_workflows_statistics.go @@ -66,21 +66,22 @@ func (c *ApiService) FetchWorkflowStatistics(WorkspaceSid string, WorkflowSid st data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Minutes != nil { - data.Set("Minutes", fmt.Sprint(*params.Minutes)) -} -if params != nil && params.StartDate != nil { - data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) -} -if params != nil && params.EndDate != nil { - data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) -} -if params != nil && params.TaskChannel != nil { - data.Set("TaskChannel", *params.TaskChannel) -} -if params != nil && params.SplitByWaitTime != nil { - data.Set("SplitByWaitTime", *params.SplitByWaitTime) -} + + if params != nil && params.Minutes != nil { + data.Set("Minutes", fmt.Sprint(*params.Minutes)) + } + if params != nil && params.StartDate != nil { + data.Set("StartDate", fmt.Sprint((*params.StartDate).Format(time.RFC3339))) + } + if params != nil && params.EndDate != nil { + data.Set("EndDate", fmt.Sprint((*params.EndDate).Format(time.RFC3339))) + } + if params != nil && params.TaskChannel != nil { + data.Set("TaskChannel", *params.TaskChannel) + } + if params != nil && params.SplitByWaitTime != nil { + data.Set("SplitByWaitTime", *params.SplitByWaitTime) + } diff --git a/rest/trunking/v1/trunks.go b/rest/trunking/v1/trunks.go index 4b7f445a8..60183e5fc 100644 --- a/rest/trunking/v1/trunks.go +++ b/rest/trunking/v1/trunks.go @@ -82,30 +82,31 @@ func (c *ApiService) CreateTrunk(params *CreateTrunkParams) (*TrunkingV1Trunk, e data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.DomainName != nil { - data.Set("DomainName", *params.DomainName) -} -if params != nil && params.DisasterRecoveryUrl != nil { - data.Set("DisasterRecoveryUrl", *params.DisasterRecoveryUrl) -} -if params != nil && params.DisasterRecoveryMethod != nil { - data.Set("DisasterRecoveryMethod", *params.DisasterRecoveryMethod) -} -if params != nil && params.TransferMode != nil { - data.Set("TransferMode", *params.TransferMode) -} -if params != nil && params.Secure != nil { - data.Set("Secure", fmt.Sprint(*params.Secure)) -} -if params != nil && params.CnamLookupEnabled != nil { - data.Set("CnamLookupEnabled", fmt.Sprint(*params.CnamLookupEnabled)) -} -if params != nil && params.TransferCallerId != nil { - data.Set("TransferCallerId", *params.TransferCallerId) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.DomainName != nil { + data.Set("DomainName", *params.DomainName) + } + if params != nil && params.DisasterRecoveryUrl != nil { + data.Set("DisasterRecoveryUrl", *params.DisasterRecoveryUrl) + } + if params != nil && params.DisasterRecoveryMethod != nil { + data.Set("DisasterRecoveryMethod", *params.DisasterRecoveryMethod) + } + if params != nil && params.TransferMode != nil { + data.Set("TransferMode", *params.TransferMode) + } + if params != nil && params.Secure != nil { + data.Set("Secure", fmt.Sprint(*params.Secure)) + } + if params != nil && params.CnamLookupEnabled != nil { + data.Set("CnamLookupEnabled", fmt.Sprint(*params.CnamLookupEnabled)) + } + if params != nil && params.TransferCallerId != nil { + data.Set("TransferCallerId", *params.TransferCallerId) + } @@ -134,6 +135,7 @@ func (c *ApiService) DeleteTrunk(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -154,6 +156,7 @@ func (c *ApiService) FetchTrunk(Sid string, ) (*TrunkingV1Trunk, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -193,9 +196,10 @@ func (c *ApiService) PageTrunk(params *ListTrunkParams, pageToken, pageNumber st data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -367,30 +371,31 @@ func (c *ApiService) UpdateTrunk(Sid string, params *UpdateTrunkParams) (*Trunki data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.DomainName != nil { - data.Set("DomainName", *params.DomainName) -} -if params != nil && params.DisasterRecoveryUrl != nil { - data.Set("DisasterRecoveryUrl", *params.DisasterRecoveryUrl) -} -if params != nil && params.DisasterRecoveryMethod != nil { - data.Set("DisasterRecoveryMethod", *params.DisasterRecoveryMethod) -} -if params != nil && params.TransferMode != nil { - data.Set("TransferMode", *params.TransferMode) -} -if params != nil && params.Secure != nil { - data.Set("Secure", fmt.Sprint(*params.Secure)) -} -if params != nil && params.CnamLookupEnabled != nil { - data.Set("CnamLookupEnabled", fmt.Sprint(*params.CnamLookupEnabled)) -} -if params != nil && params.TransferCallerId != nil { - data.Set("TransferCallerId", *params.TransferCallerId) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.DomainName != nil { + data.Set("DomainName", *params.DomainName) + } + if params != nil && params.DisasterRecoveryUrl != nil { + data.Set("DisasterRecoveryUrl", *params.DisasterRecoveryUrl) + } + if params != nil && params.DisasterRecoveryMethod != nil { + data.Set("DisasterRecoveryMethod", *params.DisasterRecoveryMethod) + } + if params != nil && params.TransferMode != nil { + data.Set("TransferMode", *params.TransferMode) + } + if params != nil && params.Secure != nil { + data.Set("Secure", fmt.Sprint(*params.Secure)) + } + if params != nil && params.CnamLookupEnabled != nil { + data.Set("CnamLookupEnabled", fmt.Sprint(*params.CnamLookupEnabled)) + } + if params != nil && params.TransferCallerId != nil { + data.Set("TransferCallerId", *params.TransferCallerId) + } diff --git a/rest/trunking/v1/trunks_credential_lists.go b/rest/trunking/v1/trunks_credential_lists.go index 2436a49ad..c4ec4d250 100644 --- a/rest/trunking/v1/trunks_credential_lists.go +++ b/rest/trunking/v1/trunks_credential_lists.go @@ -41,9 +41,10 @@ func (c *ApiService) CreateCredentialList(TrunkSid string, params *CreateCredent data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.CredentialListSid != nil { - data.Set("CredentialListSid", *params.CredentialListSid) -} + + if params != nil && params.CredentialListSid != nil { + data.Set("CredentialListSid", *params.CredentialListSid) + } @@ -73,6 +74,7 @@ func (c *ApiService) DeleteCredentialList(TrunkSid string, Sid string, ) (error) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -94,6 +96,7 @@ func (c *ApiService) FetchCredentialList(TrunkSid string, Sid string, ) (*Trunki + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -134,9 +137,10 @@ func (c *ApiService) PageCredentialList(TrunkSid string, params *ListCredentialL data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trunking/v1/trunks_ip_access_control_lists.go b/rest/trunking/v1/trunks_ip_access_control_lists.go index 31363977f..5bd1a9172 100644 --- a/rest/trunking/v1/trunks_ip_access_control_lists.go +++ b/rest/trunking/v1/trunks_ip_access_control_lists.go @@ -41,9 +41,10 @@ func (c *ApiService) CreateIpAccessControlList(TrunkSid string, params *CreateIp data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.IpAccessControlListSid != nil { - data.Set("IpAccessControlListSid", *params.IpAccessControlListSid) -} + + if params != nil && params.IpAccessControlListSid != nil { + data.Set("IpAccessControlListSid", *params.IpAccessControlListSid) + } @@ -73,6 +74,7 @@ func (c *ApiService) DeleteIpAccessControlList(TrunkSid string, Sid string, ) (e + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -94,6 +96,7 @@ func (c *ApiService) FetchIpAccessControlList(TrunkSid string, Sid string, ) (*T + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -134,9 +137,10 @@ func (c *ApiService) PageIpAccessControlList(TrunkSid string, params *ListIpAcce data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trunking/v1/trunks_origination_urls.go b/rest/trunking/v1/trunks_origination_urls.go index 266c15c2f..23cffa7ee 100644 --- a/rest/trunking/v1/trunks_origination_urls.go +++ b/rest/trunking/v1/trunks_origination_urls.go @@ -65,21 +65,22 @@ func (c *ApiService) CreateOriginationUrl(TrunkSid string, params *CreateOrigina data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Weight != nil { - data.Set("Weight", fmt.Sprint(*params.Weight)) -} -if params != nil && params.Priority != nil { - data.Set("Priority", fmt.Sprint(*params.Priority)) -} -if params != nil && params.Enabled != nil { - data.Set("Enabled", fmt.Sprint(*params.Enabled)) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.SipUrl != nil { - data.Set("SipUrl", *params.SipUrl) -} + + if params != nil && params.Weight != nil { + data.Set("Weight", fmt.Sprint(*params.Weight)) + } + if params != nil && params.Priority != nil { + data.Set("Priority", fmt.Sprint(*params.Priority)) + } + if params != nil && params.Enabled != nil { + data.Set("Enabled", fmt.Sprint(*params.Enabled)) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.SipUrl != nil { + data.Set("SipUrl", *params.SipUrl) + } @@ -109,6 +110,7 @@ func (c *ApiService) DeleteOriginationUrl(TrunkSid string, Sid string, ) (error) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -130,6 +132,7 @@ func (c *ApiService) FetchOriginationUrl(TrunkSid string, Sid string, ) (*Trunki + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -170,9 +173,10 @@ func (c *ApiService) PageOriginationUrl(TrunkSid string, params *ListOrigination data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -327,21 +331,22 @@ func (c *ApiService) UpdateOriginationUrl(TrunkSid string, Sid string, params *U data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Weight != nil { - data.Set("Weight", fmt.Sprint(*params.Weight)) -} -if params != nil && params.Priority != nil { - data.Set("Priority", fmt.Sprint(*params.Priority)) -} -if params != nil && params.Enabled != nil { - data.Set("Enabled", fmt.Sprint(*params.Enabled)) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.SipUrl != nil { - data.Set("SipUrl", *params.SipUrl) -} + + if params != nil && params.Weight != nil { + data.Set("Weight", fmt.Sprint(*params.Weight)) + } + if params != nil && params.Priority != nil { + data.Set("Priority", fmt.Sprint(*params.Priority)) + } + if params != nil && params.Enabled != nil { + data.Set("Enabled", fmt.Sprint(*params.Enabled)) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.SipUrl != nil { + data.Set("SipUrl", *params.SipUrl) + } diff --git a/rest/trunking/v1/trunks_phone_numbers.go b/rest/trunking/v1/trunks_phone_numbers.go index 60c145a13..ac346bab0 100644 --- a/rest/trunking/v1/trunks_phone_numbers.go +++ b/rest/trunking/v1/trunks_phone_numbers.go @@ -41,9 +41,10 @@ func (c *ApiService) CreatePhoneNumber(TrunkSid string, params *CreatePhoneNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PhoneNumberSid != nil { - data.Set("PhoneNumberSid", *params.PhoneNumberSid) -} + + if params != nil && params.PhoneNumberSid != nil { + data.Set("PhoneNumberSid", *params.PhoneNumberSid) + } @@ -73,6 +74,7 @@ func (c *ApiService) DeletePhoneNumber(TrunkSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -94,6 +96,7 @@ func (c *ApiService) FetchPhoneNumber(TrunkSid string, Sid string, ) (*TrunkingV + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -134,9 +137,10 @@ func (c *ApiService) PagePhoneNumber(TrunkSid string, params *ListPhoneNumberPar data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trunking/v1/trunks_recording.go b/rest/trunking/v1/trunks_recording.go index 6ce757d31..65cc744ba 100644 --- a/rest/trunking/v1/trunks_recording.go +++ b/rest/trunking/v1/trunks_recording.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchRecording(TrunkSid string, ) (*TrunkingV1Recording, er + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -72,12 +73,13 @@ func (c *ApiService) UpdateRecording(TrunkSid string, params *UpdateRecordingPar 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) -} + + if params != nil && params.Mode != nil { + data.Set("Mode", *params.Mode) + } + if params != nil && params.Trim != nil { + data.Set("Trim", *params.Trim) + } diff --git a/rest/trusthub/v1/compliance_inquiries_customers_initialize.go b/rest/trusthub/v1/compliance_inquiries_customers_initialize.go index 4fdc6ad6d..88d7d93f0 100644 --- a/rest/trusthub/v1/compliance_inquiries_customers_initialize.go +++ b/rest/trusthub/v1/compliance_inquiries_customers_initialize.go @@ -40,9 +40,10 @@ func (c *ApiService) CreateComplianceInquiry(params *CreateComplianceInquiryPara data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PrimaryProfileSid != nil { - data.Set("PrimaryProfileSid", *params.PrimaryProfileSid) -} + + if params != nil && params.PrimaryProfileSid != nil { + data.Set("PrimaryProfileSid", *params.PrimaryProfileSid) + } @@ -79,9 +80,10 @@ func (c *ApiService) UpdateComplianceInquiry(CustomerId string, params *UpdateCo data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PrimaryProfileSid != nil { - data.Set("PrimaryProfileSid", *params.PrimaryProfileSid) -} + + if params != nil && params.PrimaryProfileSid != nil { + data.Set("PrimaryProfileSid", *params.PrimaryProfileSid) + } diff --git a/rest/trusthub/v1/customer_profiles.go b/rest/trusthub/v1/customer_profiles.go index 3b6a139da..d96ef9e1e 100644 --- a/rest/trusthub/v1/customer_profiles.go +++ b/rest/trusthub/v1/customer_profiles.go @@ -58,18 +58,19 @@ func (c *ApiService) CreateCustomerProfile(params *CreateCustomerProfileParams) data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Email != nil { - data.Set("Email", *params.Email) -} -if params != nil && params.PolicySid != nil { - data.Set("PolicySid", *params.PolicySid) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Email != nil { + data.Set("Email", *params.Email) + } + if params != nil && params.PolicySid != nil { + data.Set("PolicySid", *params.PolicySid) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } @@ -98,6 +99,7 @@ func (c *ApiService) DeleteCustomerProfile(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -118,6 +120,7 @@ func (c *ApiService) FetchCustomerProfile(Sid string, ) (*TrusthubV1CustomerProf + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -175,18 +178,19 @@ func (c *ApiService) PageCustomerProfile(params *ListCustomerProfileParams, page data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.PolicySid != nil { - data.Set("PolicySid", *params.PolicySid) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.PolicySid != nil { + data.Set("PolicySid", *params.PolicySid) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -334,18 +338,19 @@ func (c *ApiService) UpdateCustomerProfile(Sid string, params *UpdateCustomerPro data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Email != nil { - data.Set("Email", *params.Email) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Email != nil { + data.Set("Email", *params.Email) + } diff --git a/rest/trusthub/v1/customer_profiles_channel_endpoint_assignments.go b/rest/trusthub/v1/customer_profiles_channel_endpoint_assignments.go index 21a2e8a1b..02788bfbf 100644 --- a/rest/trusthub/v1/customer_profiles_channel_endpoint_assignments.go +++ b/rest/trusthub/v1/customer_profiles_channel_endpoint_assignments.go @@ -47,12 +47,13 @@ func (c *ApiService) CreateCustomerProfileChannelEndpointAssignment(CustomerProf data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ChannelEndpointType != nil { - data.Set("ChannelEndpointType", *params.ChannelEndpointType) -} -if params != nil && params.ChannelEndpointSid != nil { - data.Set("ChannelEndpointSid", *params.ChannelEndpointSid) -} + + if params != nil && params.ChannelEndpointType != nil { + data.Set("ChannelEndpointType", *params.ChannelEndpointType) + } + if params != nil && params.ChannelEndpointSid != nil { + data.Set("ChannelEndpointSid", *params.ChannelEndpointSid) + } @@ -82,6 +83,7 @@ func (c *ApiService) DeleteCustomerProfileChannelEndpointAssignment(CustomerProf + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -103,6 +105,7 @@ func (c *ApiService) FetchCustomerProfileChannelEndpointAssignment(CustomerProfi + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -155,15 +158,16 @@ func (c *ApiService) PageCustomerProfileChannelEndpointAssignment(CustomerProfil data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ChannelEndpointSid != nil { - data.Set("ChannelEndpointSid", *params.ChannelEndpointSid) -} -if params != nil && params.ChannelEndpointSids != nil { - data.Set("ChannelEndpointSids", *params.ChannelEndpointSids) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.ChannelEndpointSid != nil { + data.Set("ChannelEndpointSid", *params.ChannelEndpointSid) + } + if params != nil && params.ChannelEndpointSids != nil { + data.Set("ChannelEndpointSids", *params.ChannelEndpointSids) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trusthub/v1/customer_profiles_entity_assignments.go b/rest/trusthub/v1/customer_profiles_entity_assignments.go index f6c0d7735..2046c7ffa 100644 --- a/rest/trusthub/v1/customer_profiles_entity_assignments.go +++ b/rest/trusthub/v1/customer_profiles_entity_assignments.go @@ -41,9 +41,10 @@ func (c *ApiService) CreateCustomerProfileEntityAssignment(CustomerProfileSid st data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ObjectSid != nil { - data.Set("ObjectSid", *params.ObjectSid) -} + + if params != nil && params.ObjectSid != nil { + data.Set("ObjectSid", *params.ObjectSid) + } @@ -73,6 +74,7 @@ func (c *ApiService) DeleteCustomerProfileEntityAssignment(CustomerProfileSid st + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -94,6 +96,7 @@ func (c *ApiService) FetchCustomerProfileEntityAssignment(CustomerProfileSid str + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -134,9 +137,10 @@ func (c *ApiService) PageCustomerProfileEntityAssignment(CustomerProfileSid stri data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trusthub/v1/customer_profiles_evaluations.go b/rest/trusthub/v1/customer_profiles_evaluations.go index 16a05591f..04a372cc0 100644 --- a/rest/trusthub/v1/customer_profiles_evaluations.go +++ b/rest/trusthub/v1/customer_profiles_evaluations.go @@ -41,9 +41,10 @@ func (c *ApiService) CreateCustomerProfileEvaluation(CustomerProfileSid string, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PolicySid != nil { - data.Set("PolicySid", *params.PolicySid) -} + + if params != nil && params.PolicySid != nil { + data.Set("PolicySid", *params.PolicySid) + } @@ -73,6 +74,7 @@ func (c *ApiService) FetchCustomerProfileEvaluation(CustomerProfileSid string, S + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -113,9 +115,10 @@ func (c *ApiService) PageCustomerProfileEvaluation(CustomerProfileSid string, pa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trusthub/v1/end_user_types.go b/rest/trusthub/v1/end_user_types.go index 85643cd38..419ab0134 100644 --- a/rest/trusthub/v1/end_user_types.go +++ b/rest/trusthub/v1/end_user_types.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchEndUserType(Sid string, ) (*TrusthubV1EndUserType, err + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -72,9 +73,10 @@ func (c *ApiService) PageEndUserType(params *ListEndUserTypeParams, pageToken, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trusthub/v1/end_users.go b/rest/trusthub/v1/end_users.go index cd85a5fb3..32ddc997d 100644 --- a/rest/trusthub/v1/end_users.go +++ b/rest/trusthub/v1/end_users.go @@ -52,21 +52,22 @@ func (c *ApiService) CreateEndUser(params *CreateEndUserParams) (*TrusthubV1EndU data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.Attributes != nil { - v, err := json.Marshal(params.Attributes) - if err != nil { - return nil, err + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) } + if params != nil && params.Attributes != nil { + v, err := json.Marshal(params.Attributes) - data.Set("Attributes", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Attributes", string(v)) + } @@ -95,6 +96,7 @@ func (c *ApiService) DeleteEndUser(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -115,6 +117,7 @@ func (c *ApiService) FetchEndUser(Sid string, ) (*TrusthubV1EndUser, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -154,9 +157,10 @@ func (c *ApiService) PageEndUser(params *ListEndUserParams, pageToken, pageNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -292,18 +296,19 @@ func (c *ApiService) UpdateEndUser(Sid string, params *UpdateEndUserParams) (*Tr data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Attributes != nil { - v, err := json.Marshal(params.Attributes) - if err != nil { - return nil, err + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) } + if params != nil && params.Attributes != nil { + v, err := json.Marshal(params.Attributes) - data.Set("Attributes", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Attributes", string(v)) + } diff --git a/rest/trusthub/v1/policies.go b/rest/trusthub/v1/policies.go index 3bfa9cb37..249df638a 100644 --- a/rest/trusthub/v1/policies.go +++ b/rest/trusthub/v1/policies.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchPolicies(Sid string, ) (*TrusthubV1Policies, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -72,9 +73,10 @@ func (c *ApiService) PagePolicies(params *ListPoliciesParams, pageToken, pageNum data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trusthub/v1/supporting_document_types.go b/rest/trusthub/v1/supporting_document_types.go index 5bc223a76..7d78d322d 100644 --- a/rest/trusthub/v1/supporting_document_types.go +++ b/rest/trusthub/v1/supporting_document_types.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchSupportingDocumentType(Sid string, ) (*TrusthubV1Suppo + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -72,9 +73,10 @@ func (c *ApiService) PageSupportingDocumentType(params *ListSupportingDocumentTy data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trusthub/v1/supporting_documents.go b/rest/trusthub/v1/supporting_documents.go index ce490f8b6..c6637b653 100644 --- a/rest/trusthub/v1/supporting_documents.go +++ b/rest/trusthub/v1/supporting_documents.go @@ -52,21 +52,22 @@ func (c *ApiService) CreateSupportingDocument(params *CreateSupportingDocumentPa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.Attributes != nil { - v, err := json.Marshal(params.Attributes) - if err != nil { - return nil, err + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) } + if params != nil && params.Attributes != nil { + v, err := json.Marshal(params.Attributes) - data.Set("Attributes", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Attributes", string(v)) + } @@ -95,6 +96,7 @@ func (c *ApiService) DeleteSupportingDocument(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -115,6 +117,7 @@ func (c *ApiService) FetchSupportingDocument(Sid string, ) (*TrusthubV1Supportin + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -154,9 +157,10 @@ func (c *ApiService) PageSupportingDocument(params *ListSupportingDocumentParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -292,18 +296,19 @@ func (c *ApiService) UpdateSupportingDocument(Sid string, params *UpdateSupporti data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Attributes != nil { - v, err := json.Marshal(params.Attributes) - if err != nil { - return nil, err + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) } + if params != nil && params.Attributes != nil { + v, err := json.Marshal(params.Attributes) - data.Set("Attributes", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Attributes", string(v)) + } diff --git a/rest/trusthub/v1/trust_products.go b/rest/trusthub/v1/trust_products.go index ae2e6990c..d4f95b192 100644 --- a/rest/trusthub/v1/trust_products.go +++ b/rest/trusthub/v1/trust_products.go @@ -58,18 +58,19 @@ func (c *ApiService) CreateTrustProduct(params *CreateTrustProductParams) (*Trus data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Email != nil { - data.Set("Email", *params.Email) -} -if params != nil && params.PolicySid != nil { - data.Set("PolicySid", *params.PolicySid) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Email != nil { + data.Set("Email", *params.Email) + } + if params != nil && params.PolicySid != nil { + data.Set("PolicySid", *params.PolicySid) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } @@ -98,6 +99,7 @@ func (c *ApiService) DeleteTrustProduct(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -118,6 +120,7 @@ func (c *ApiService) FetchTrustProduct(Sid string, ) (*TrusthubV1TrustProduct, e + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -175,18 +178,19 @@ func (c *ApiService) PageTrustProduct(params *ListTrustProductParams, pageToken, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.PolicySid != nil { - data.Set("PolicySid", *params.PolicySid) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.PolicySid != nil { + data.Set("PolicySid", *params.PolicySid) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -334,18 +338,19 @@ func (c *ApiService) UpdateTrustProduct(Sid string, params *UpdateTrustProductPa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Email != nil { - data.Set("Email", *params.Email) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Email != nil { + data.Set("Email", *params.Email) + } diff --git a/rest/trusthub/v1/trust_products_channel_endpoint_assignments.go b/rest/trusthub/v1/trust_products_channel_endpoint_assignments.go index d3da5931b..9344c3aa6 100644 --- a/rest/trusthub/v1/trust_products_channel_endpoint_assignments.go +++ b/rest/trusthub/v1/trust_products_channel_endpoint_assignments.go @@ -47,12 +47,13 @@ func (c *ApiService) CreateTrustProductChannelEndpointAssignment(TrustProductSid data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ChannelEndpointType != nil { - data.Set("ChannelEndpointType", *params.ChannelEndpointType) -} -if params != nil && params.ChannelEndpointSid != nil { - data.Set("ChannelEndpointSid", *params.ChannelEndpointSid) -} + + if params != nil && params.ChannelEndpointType != nil { + data.Set("ChannelEndpointType", *params.ChannelEndpointType) + } + if params != nil && params.ChannelEndpointSid != nil { + data.Set("ChannelEndpointSid", *params.ChannelEndpointSid) + } @@ -82,6 +83,7 @@ func (c *ApiService) DeleteTrustProductChannelEndpointAssignment(TrustProductSid + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -103,6 +105,7 @@ func (c *ApiService) FetchTrustProductChannelEndpointAssignment(TrustProductSid + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -155,15 +158,16 @@ func (c *ApiService) PageTrustProductChannelEndpointAssignment(TrustProductSid s data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ChannelEndpointSid != nil { - data.Set("ChannelEndpointSid", *params.ChannelEndpointSid) -} -if params != nil && params.ChannelEndpointSids != nil { - data.Set("ChannelEndpointSids", *params.ChannelEndpointSids) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.ChannelEndpointSid != nil { + data.Set("ChannelEndpointSid", *params.ChannelEndpointSid) + } + if params != nil && params.ChannelEndpointSids != nil { + data.Set("ChannelEndpointSids", *params.ChannelEndpointSids) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trusthub/v1/trust_products_entity_assignments.go b/rest/trusthub/v1/trust_products_entity_assignments.go index ca1fcd960..34eaff9e2 100644 --- a/rest/trusthub/v1/trust_products_entity_assignments.go +++ b/rest/trusthub/v1/trust_products_entity_assignments.go @@ -41,9 +41,10 @@ func (c *ApiService) CreateTrustProductEntityAssignment(TrustProductSid string, data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.ObjectSid != nil { - data.Set("ObjectSid", *params.ObjectSid) -} + + if params != nil && params.ObjectSid != nil { + data.Set("ObjectSid", *params.ObjectSid) + } @@ -73,6 +74,7 @@ func (c *ApiService) DeleteTrustProductEntityAssignment(TrustProductSid string, + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -94,6 +96,7 @@ func (c *ApiService) FetchTrustProductEntityAssignment(TrustProductSid string, S + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -134,9 +137,10 @@ func (c *ApiService) PageTrustProductEntityAssignment(TrustProductSid string, pa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/trusthub/v1/trust_products_evaluations.go b/rest/trusthub/v1/trust_products_evaluations.go index 317c53ce6..a3fdd28e6 100644 --- a/rest/trusthub/v1/trust_products_evaluations.go +++ b/rest/trusthub/v1/trust_products_evaluations.go @@ -41,9 +41,10 @@ func (c *ApiService) CreateTrustProductEvaluation(TrustProductSid string, params data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PolicySid != nil { - data.Set("PolicySid", *params.PolicySid) -} + + if params != nil && params.PolicySid != nil { + data.Set("PolicySid", *params.PolicySid) + } @@ -73,6 +74,7 @@ func (c *ApiService) FetchTrustProductEvaluation(TrustProductSid string, Sid str + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -113,9 +115,10 @@ func (c *ApiService) PageTrustProductEvaluation(TrustProductSid string, params * data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/verify/v2/attempts.go b/rest/verify/v2/attempts.go index ab9da1391..dae93fda3 100644 --- a/rest/verify/v2/attempts.go +++ b/rest/verify/v2/attempts.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchVerificationAttempt(Sid string, ) (*VerifyV2Verificati + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -120,33 +121,34 @@ func (c *ApiService) PageVerificationAttempt(params *ListVerificationAttemptPara data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) -} -if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) -} -if params != nil && params.ChannelDataTo != nil { - data.Set("ChannelData.To", *params.ChannelDataTo) -} -if params != nil && params.Country != nil { - data.Set("Country", *params.Country) -} -if params != nil && params.Channel != nil { - data.Set("Channel", *params.Channel) -} -if params != nil && params.VerifyServiceSid != nil { - data.Set("VerifyServiceSid", *params.VerifyServiceSid) -} -if params != nil && params.VerificationSid != nil { - data.Set("VerificationSid", *params.VerificationSid) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.DateCreatedAfter != nil { + data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) + } + if params != nil && params.DateCreatedBefore != nil { + data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) + } + if params != nil && params.ChannelDataTo != nil { + data.Set("ChannelData.To", *params.ChannelDataTo) + } + if params != nil && params.Country != nil { + data.Set("Country", *params.Country) + } + if params != nil && params.Channel != nil { + data.Set("Channel", *params.Channel) + } + if params != nil && params.VerifyServiceSid != nil { + data.Set("VerifyServiceSid", *params.VerifyServiceSid) + } + if params != nil && params.VerificationSid != nil { + data.Set("VerificationSid", *params.VerificationSid) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/verify/v2/attempts_summary.go b/rest/verify/v2/attempts_summary.go index a0798ee7d..fbea6d978 100644 --- a/rest/verify/v2/attempts_summary.go +++ b/rest/verify/v2/attempts_summary.go @@ -70,24 +70,25 @@ func (c *ApiService) FetchVerificationAttemptsSummary(params *FetchVerificationA data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.VerifyServiceSid != nil { - data.Set("VerifyServiceSid", *params.VerifyServiceSid) -} -if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) -} -if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) -} -if params != nil && params.Country != nil { - data.Set("Country", *params.Country) -} -if params != nil && params.Channel != nil { - data.Set("Channel", *params.Channel) -} -if params != nil && params.DestinationPrefix != nil { - data.Set("DestinationPrefix", *params.DestinationPrefix) -} + + if params != nil && params.VerifyServiceSid != nil { + data.Set("VerifyServiceSid", *params.VerifyServiceSid) + } + if params != nil && params.DateCreatedAfter != nil { + data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) + } + if params != nil && params.DateCreatedBefore != nil { + data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) + } + if params != nil && params.Country != nil { + data.Set("Country", *params.Country) + } + if params != nil && params.Channel != nil { + data.Set("Channel", *params.Channel) + } + if params != nil && params.DestinationPrefix != nil { + data.Set("DestinationPrefix", *params.DestinationPrefix) + } diff --git a/rest/verify/v2/forms.go b/rest/verify/v2/forms.go index d6f457b82..cf0d6398a 100644 --- a/rest/verify/v2/forms.go +++ b/rest/verify/v2/forms.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchForm(FormType string, ) (*VerifyV2Form, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/verify/v2/safe_list_numbers.go b/rest/verify/v2/safe_list_numbers.go index 25d98dc01..8cab5d04b 100644 --- a/rest/verify/v2/safe_list_numbers.go +++ b/rest/verify/v2/safe_list_numbers.go @@ -40,9 +40,10 @@ func (c *ApiService) CreateSafelist(params *CreateSafelistParams) (*VerifyV2Safe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PhoneNumber != nil { - data.Set("PhoneNumber", *params.PhoneNumber) -} + + if params != nil && params.PhoneNumber != nil { + data.Set("PhoneNumber", *params.PhoneNumber) + } @@ -71,6 +72,7 @@ func (c *ApiService) DeleteSafelist(PhoneNumber string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -91,6 +93,7 @@ func (c *ApiService) FetchSafelist(PhoneNumber string, ) (*VerifyV2Safelist, err + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/verify/v2/services.go b/rest/verify/v2/services.go index 052b8927e..0c7f6de31 100644 --- a/rest/verify/v2/services.go +++ b/rest/verify/v2/services.go @@ -136,57 +136,58 @@ func (c *ApiService) CreateService(params *CreateServiceParams) (*VerifyV2Servic data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.CodeLength != nil { - data.Set("CodeLength", fmt.Sprint(*params.CodeLength)) -} -if params != nil && params.LookupEnabled != nil { - data.Set("LookupEnabled", fmt.Sprint(*params.LookupEnabled)) -} -if params != nil && params.SkipSmsToLandlines != nil { - data.Set("SkipSmsToLandlines", fmt.Sprint(*params.SkipSmsToLandlines)) -} -if params != nil && params.DtmfInputRequired != nil { - data.Set("DtmfInputRequired", fmt.Sprint(*params.DtmfInputRequired)) -} -if params != nil && params.TtsName != nil { - data.Set("TtsName", *params.TtsName) -} -if params != nil && params.Psd2Enabled != nil { - data.Set("Psd2Enabled", fmt.Sprint(*params.Psd2Enabled)) -} -if params != nil && params.DoNotShareWarningEnabled != nil { - data.Set("DoNotShareWarningEnabled", fmt.Sprint(*params.DoNotShareWarningEnabled)) -} -if params != nil && params.CustomCodeEnabled != nil { - data.Set("CustomCodeEnabled", fmt.Sprint(*params.CustomCodeEnabled)) -} -if params != nil && params.PushIncludeDate != nil { - data.Set("Push.IncludeDate", fmt.Sprint(*params.PushIncludeDate)) -} -if params != nil && params.PushApnCredentialSid != nil { - data.Set("Push.ApnCredentialSid", *params.PushApnCredentialSid) -} -if params != nil && params.PushFcmCredentialSid != nil { - data.Set("Push.FcmCredentialSid", *params.PushFcmCredentialSid) -} -if params != nil && params.TotpIssuer != nil { - data.Set("Totp.Issuer", *params.TotpIssuer) -} -if params != nil && params.TotpTimeStep != nil { - data.Set("Totp.TimeStep", fmt.Sprint(*params.TotpTimeStep)) -} -if params != nil && params.TotpCodeLength != nil { - data.Set("Totp.CodeLength", fmt.Sprint(*params.TotpCodeLength)) -} -if params != nil && params.TotpSkew != nil { - data.Set("Totp.Skew", fmt.Sprint(*params.TotpSkew)) -} -if params != nil && params.DefaultTemplateSid != nil { - data.Set("DefaultTemplateSid", *params.DefaultTemplateSid) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.CodeLength != nil { + data.Set("CodeLength", fmt.Sprint(*params.CodeLength)) + } + if params != nil && params.LookupEnabled != nil { + data.Set("LookupEnabled", fmt.Sprint(*params.LookupEnabled)) + } + if params != nil && params.SkipSmsToLandlines != nil { + data.Set("SkipSmsToLandlines", fmt.Sprint(*params.SkipSmsToLandlines)) + } + if params != nil && params.DtmfInputRequired != nil { + data.Set("DtmfInputRequired", fmt.Sprint(*params.DtmfInputRequired)) + } + if params != nil && params.TtsName != nil { + data.Set("TtsName", *params.TtsName) + } + if params != nil && params.Psd2Enabled != nil { + data.Set("Psd2Enabled", fmt.Sprint(*params.Psd2Enabled)) + } + if params != nil && params.DoNotShareWarningEnabled != nil { + data.Set("DoNotShareWarningEnabled", fmt.Sprint(*params.DoNotShareWarningEnabled)) + } + if params != nil && params.CustomCodeEnabled != nil { + data.Set("CustomCodeEnabled", fmt.Sprint(*params.CustomCodeEnabled)) + } + if params != nil && params.PushIncludeDate != nil { + data.Set("Push.IncludeDate", fmt.Sprint(*params.PushIncludeDate)) + } + if params != nil && params.PushApnCredentialSid != nil { + data.Set("Push.ApnCredentialSid", *params.PushApnCredentialSid) + } + if params != nil && params.PushFcmCredentialSid != nil { + data.Set("Push.FcmCredentialSid", *params.PushFcmCredentialSid) + } + if params != nil && params.TotpIssuer != nil { + data.Set("Totp.Issuer", *params.TotpIssuer) + } + if params != nil && params.TotpTimeStep != nil { + data.Set("Totp.TimeStep", fmt.Sprint(*params.TotpTimeStep)) + } + if params != nil && params.TotpCodeLength != nil { + data.Set("Totp.CodeLength", fmt.Sprint(*params.TotpCodeLength)) + } + if params != nil && params.TotpSkew != nil { + data.Set("Totp.Skew", fmt.Sprint(*params.TotpSkew)) + } + if params != nil && params.DefaultTemplateSid != nil { + data.Set("DefaultTemplateSid", *params.DefaultTemplateSid) + } @@ -215,6 +216,7 @@ func (c *ApiService) DeleteService(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -235,6 +237,7 @@ func (c *ApiService) FetchService(Sid string, ) (*VerifyV2Service, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -274,9 +277,10 @@ func (c *ApiService) PageService(params *ListServiceParams, pageToken, pageNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -502,57 +506,58 @@ func (c *ApiService) UpdateService(Sid string, params *UpdateServiceParams) (*Ve data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.CodeLength != nil { - data.Set("CodeLength", fmt.Sprint(*params.CodeLength)) -} -if params != nil && params.LookupEnabled != nil { - data.Set("LookupEnabled", fmt.Sprint(*params.LookupEnabled)) -} -if params != nil && params.SkipSmsToLandlines != nil { - data.Set("SkipSmsToLandlines", fmt.Sprint(*params.SkipSmsToLandlines)) -} -if params != nil && params.DtmfInputRequired != nil { - data.Set("DtmfInputRequired", fmt.Sprint(*params.DtmfInputRequired)) -} -if params != nil && params.TtsName != nil { - data.Set("TtsName", *params.TtsName) -} -if params != nil && params.Psd2Enabled != nil { - data.Set("Psd2Enabled", fmt.Sprint(*params.Psd2Enabled)) -} -if params != nil && params.DoNotShareWarningEnabled != nil { - data.Set("DoNotShareWarningEnabled", fmt.Sprint(*params.DoNotShareWarningEnabled)) -} -if params != nil && params.CustomCodeEnabled != nil { - data.Set("CustomCodeEnabled", fmt.Sprint(*params.CustomCodeEnabled)) -} -if params != nil && params.PushIncludeDate != nil { - data.Set("Push.IncludeDate", fmt.Sprint(*params.PushIncludeDate)) -} -if params != nil && params.PushApnCredentialSid != nil { - data.Set("Push.ApnCredentialSid", *params.PushApnCredentialSid) -} -if params != nil && params.PushFcmCredentialSid != nil { - data.Set("Push.FcmCredentialSid", *params.PushFcmCredentialSid) -} -if params != nil && params.TotpIssuer != nil { - data.Set("Totp.Issuer", *params.TotpIssuer) -} -if params != nil && params.TotpTimeStep != nil { - data.Set("Totp.TimeStep", fmt.Sprint(*params.TotpTimeStep)) -} -if params != nil && params.TotpCodeLength != nil { - data.Set("Totp.CodeLength", fmt.Sprint(*params.TotpCodeLength)) -} -if params != nil && params.TotpSkew != nil { - data.Set("Totp.Skew", fmt.Sprint(*params.TotpSkew)) -} -if params != nil && params.DefaultTemplateSid != nil { - data.Set("DefaultTemplateSid", *params.DefaultTemplateSid) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.CodeLength != nil { + data.Set("CodeLength", fmt.Sprint(*params.CodeLength)) + } + if params != nil && params.LookupEnabled != nil { + data.Set("LookupEnabled", fmt.Sprint(*params.LookupEnabled)) + } + if params != nil && params.SkipSmsToLandlines != nil { + data.Set("SkipSmsToLandlines", fmt.Sprint(*params.SkipSmsToLandlines)) + } + if params != nil && params.DtmfInputRequired != nil { + data.Set("DtmfInputRequired", fmt.Sprint(*params.DtmfInputRequired)) + } + if params != nil && params.TtsName != nil { + data.Set("TtsName", *params.TtsName) + } + if params != nil && params.Psd2Enabled != nil { + data.Set("Psd2Enabled", fmt.Sprint(*params.Psd2Enabled)) + } + if params != nil && params.DoNotShareWarningEnabled != nil { + data.Set("DoNotShareWarningEnabled", fmt.Sprint(*params.DoNotShareWarningEnabled)) + } + if params != nil && params.CustomCodeEnabled != nil { + data.Set("CustomCodeEnabled", fmt.Sprint(*params.CustomCodeEnabled)) + } + if params != nil && params.PushIncludeDate != nil { + data.Set("Push.IncludeDate", fmt.Sprint(*params.PushIncludeDate)) + } + if params != nil && params.PushApnCredentialSid != nil { + data.Set("Push.ApnCredentialSid", *params.PushApnCredentialSid) + } + if params != nil && params.PushFcmCredentialSid != nil { + data.Set("Push.FcmCredentialSid", *params.PushFcmCredentialSid) + } + if params != nil && params.TotpIssuer != nil { + data.Set("Totp.Issuer", *params.TotpIssuer) + } + if params != nil && params.TotpTimeStep != nil { + data.Set("Totp.TimeStep", fmt.Sprint(*params.TotpTimeStep)) + } + if params != nil && params.TotpCodeLength != nil { + data.Set("Totp.CodeLength", fmt.Sprint(*params.TotpCodeLength)) + } + if params != nil && params.TotpSkew != nil { + data.Set("Totp.Skew", fmt.Sprint(*params.TotpSkew)) + } + if params != nil && params.DefaultTemplateSid != nil { + data.Set("DefaultTemplateSid", *params.DefaultTemplateSid) + } diff --git a/rest/verify/v2/services_access_tokens.go b/rest/verify/v2/services_access_tokens.go index a7e2944cd..48e0bd746 100644 --- a/rest/verify/v2/services_access_tokens.go +++ b/rest/verify/v2/services_access_tokens.go @@ -59,18 +59,19 @@ func (c *ApiService) CreateAccessToken(ServiceSid string, params *CreateAccessTo data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Identity != nil { - data.Set("Identity", *params.Identity) -} -if params != nil && params.FactorType != nil { - data.Set("FactorType", *params.FactorType) -} -if params != nil && params.FactorFriendlyName != nil { - data.Set("FactorFriendlyName", *params.FactorFriendlyName) -} -if params != nil && params.Ttl != nil { - data.Set("Ttl", fmt.Sprint(*params.Ttl)) -} + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.FactorType != nil { + data.Set("FactorType", *params.FactorType) + } + if params != nil && params.FactorFriendlyName != nil { + data.Set("FactorFriendlyName", *params.FactorFriendlyName) + } + if params != nil && params.Ttl != nil { + data.Set("Ttl", fmt.Sprint(*params.Ttl)) + } @@ -100,6 +101,7 @@ func (c *ApiService) FetchAccessToken(ServiceSid string, Sid string, ) (*VerifyV + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/verify/v2/services_entities.go b/rest/verify/v2/services_entities.go index a127c62a5..ec4240d90 100644 --- a/rest/verify/v2/services_entities.go +++ b/rest/verify/v2/services_entities.go @@ -41,9 +41,10 @@ func (c *ApiService) CreateEntity(ServiceSid string, params *CreateEntityParams) data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Identity != nil { - data.Set("Identity", *params.Identity) -} + + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } @@ -73,6 +74,7 @@ func (c *ApiService) DeleteEntity(ServiceSid string, Identity string, ) (error) + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -94,6 +96,7 @@ func (c *ApiService) FetchEntity(ServiceSid string, Identity string, ) (*VerifyV + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -134,9 +137,10 @@ func (c *ApiService) PageEntity(ServiceSid string, params *ListEntityParams, pag data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/verify/v2/services_entities_challenges.go b/rest/verify/v2/services_entities_challenges.go index 5d132af63..f7bae8608 100644 --- a/rest/verify/v2/services_entities_challenges.go +++ b/rest/verify/v2/services_entities_challenges.go @@ -72,39 +72,40 @@ func (c *ApiService) CreateChallenge(ServiceSid string, Identity string, params data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FactorSid != nil { - data.Set("FactorSid", *params.FactorSid) -} -if params != nil && params.ExpirationDate != nil { - data.Set("ExpirationDate", fmt.Sprint((*params.ExpirationDate).Format(time.RFC3339))) -} -if params != nil && params.DetailsMessage != nil { - data.Set("Details.Message", *params.DetailsMessage) -} -if params != nil && params.DetailsFields != nil { - for _, item := range *params.DetailsFields { - v, err := json.Marshal(item) + + if params != nil && params.FactorSid != nil { + data.Set("FactorSid", *params.FactorSid) + } + if params != nil && params.ExpirationDate != nil { + data.Set("ExpirationDate", fmt.Sprint((*params.ExpirationDate).Format(time.RFC3339))) + } + if params != nil && params.DetailsMessage != nil { + data.Set("Details.Message", *params.DetailsMessage) + } + if params != nil && params.DetailsFields != nil { + for _, item := range *params.DetailsFields { + v, err := json.Marshal(item) + + if err != nil { + return nil, err + } + + data.Add("Details.Fields", string(v)) + } + } + if params != nil && params.HiddenDetails != nil { + v, err := json.Marshal(params.HiddenDetails) if err != nil { return nil, err } - data.Add("Details.Fields", string(v)) + data.Set("HiddenDetails", string(v)) } -} -if params != nil && params.HiddenDetails != nil { - v, err := json.Marshal(params.HiddenDetails) - - if err != nil { - return nil, err + if params != nil && params.AuthPayload != nil { + data.Set("AuthPayload", *params.AuthPayload) } - data.Set("HiddenDetails", string(v)) -} -if params != nil && params.AuthPayload != nil { - data.Set("AuthPayload", *params.AuthPayload) -} - resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) @@ -134,6 +135,7 @@ func (c *ApiService) FetchChallenge(ServiceSid string, Identity string, Sid stri + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -193,18 +195,19 @@ func (c *ApiService) PageChallenge(ServiceSid string, Identity string, params *L data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FactorSid != nil { - data.Set("FactorSid", *params.FactorSid) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.Order != nil { - data.Set("Order", *params.Order) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.FactorSid != nil { + data.Set("FactorSid", *params.FactorSid) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.Order != nil { + data.Set("Order", *params.Order) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -342,18 +345,19 @@ func (c *ApiService) UpdateChallenge(ServiceSid string, Identity string, Sid str data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.AuthPayload != nil { - data.Set("AuthPayload", *params.AuthPayload) -} -if params != nil && params.Metadata != nil { - v, err := json.Marshal(params.Metadata) - if err != nil { - return nil, err + if params != nil && params.AuthPayload != nil { + data.Set("AuthPayload", *params.AuthPayload) } + if params != nil && params.Metadata != nil { + v, err := json.Marshal(params.Metadata) - data.Set("Metadata", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Metadata", string(v)) + } diff --git a/rest/verify/v2/services_entities_challenges_notifications.go b/rest/verify/v2/services_entities_challenges_notifications.go index cd2b1cea8..064ee02c7 100644 --- a/rest/verify/v2/services_entities_challenges_notifications.go +++ b/rest/verify/v2/services_entities_challenges_notifications.go @@ -43,9 +43,10 @@ func (c *ApiService) CreateNotification(ServiceSid string, Identity string, Chal 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.Ttl != nil { + data.Set("Ttl", fmt.Sprint(*params.Ttl)) + } diff --git a/rest/verify/v2/services_entities_factors.go b/rest/verify/v2/services_entities_factors.go index 47542b31b..1e413c883 100644 --- a/rest/verify/v2/services_entities_factors.go +++ b/rest/verify/v2/services_entities_factors.go @@ -120,54 +120,55 @@ func (c *ApiService) CreateNewFactor(ServiceSid string, Identity string, params data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.FactorType != nil { - data.Set("FactorType", *params.FactorType) -} -if params != nil && params.BindingAlg != nil { - data.Set("Binding.Alg", *params.BindingAlg) -} -if params != nil && params.BindingPublicKey != nil { - data.Set("Binding.PublicKey", *params.BindingPublicKey) -} -if params != nil && params.ConfigAppId != nil { - data.Set("Config.AppId", *params.ConfigAppId) -} -if params != nil && params.ConfigNotificationPlatform != nil { - data.Set("Config.NotificationPlatform", *params.ConfigNotificationPlatform) -} -if params != nil && params.ConfigNotificationToken != nil { - data.Set("Config.NotificationToken", *params.ConfigNotificationToken) -} -if params != nil && params.ConfigSdkVersion != nil { - data.Set("Config.SdkVersion", *params.ConfigSdkVersion) -} -if params != nil && params.BindingSecret != nil { - data.Set("Binding.Secret", *params.BindingSecret) -} -if params != nil && params.ConfigTimeStep != nil { - data.Set("Config.TimeStep", fmt.Sprint(*params.ConfigTimeStep)) -} -if params != nil && params.ConfigSkew != nil { - data.Set("Config.Skew", fmt.Sprint(*params.ConfigSkew)) -} -if params != nil && params.ConfigCodeLength != nil { - data.Set("Config.CodeLength", fmt.Sprint(*params.ConfigCodeLength)) -} -if params != nil && params.ConfigAlg != nil { - data.Set("Config.Alg", *params.ConfigAlg) -} -if params != nil && params.Metadata != nil { - v, err := json.Marshal(params.Metadata) - if err != nil { - return nil, err + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.FactorType != nil { + data.Set("FactorType", *params.FactorType) + } + if params != nil && params.BindingAlg != nil { + data.Set("Binding.Alg", *params.BindingAlg) + } + if params != nil && params.BindingPublicKey != nil { + data.Set("Binding.PublicKey", *params.BindingPublicKey) + } + if params != nil && params.ConfigAppId != nil { + data.Set("Config.AppId", *params.ConfigAppId) + } + if params != nil && params.ConfigNotificationPlatform != nil { + data.Set("Config.NotificationPlatform", *params.ConfigNotificationPlatform) + } + if params != nil && params.ConfigNotificationToken != nil { + data.Set("Config.NotificationToken", *params.ConfigNotificationToken) + } + if params != nil && params.ConfigSdkVersion != nil { + data.Set("Config.SdkVersion", *params.ConfigSdkVersion) + } + if params != nil && params.BindingSecret != nil { + data.Set("Binding.Secret", *params.BindingSecret) + } + if params != nil && params.ConfigTimeStep != nil { + data.Set("Config.TimeStep", fmt.Sprint(*params.ConfigTimeStep)) + } + if params != nil && params.ConfigSkew != nil { + data.Set("Config.Skew", fmt.Sprint(*params.ConfigSkew)) + } + if params != nil && params.ConfigCodeLength != nil { + data.Set("Config.CodeLength", fmt.Sprint(*params.ConfigCodeLength)) + } + if params != nil && params.ConfigAlg != nil { + data.Set("Config.Alg", *params.ConfigAlg) } + if params != nil && params.Metadata != nil { + v, err := json.Marshal(params.Metadata) - data.Set("Metadata", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Metadata", string(v)) + } @@ -198,6 +199,7 @@ func (c *ApiService) DeleteFactor(ServiceSid string, Identity string, Sid string + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -220,6 +222,7 @@ func (c *ApiService) FetchFactor(ServiceSid string, Identity string, Sid string, + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -261,9 +264,10 @@ func (c *ApiService) PageFactor(ServiceSid string, Identity string, params *List data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -443,33 +447,34 @@ func (c *ApiService) UpdateFactor(ServiceSid string, Identity string, Sid string data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.AuthPayload != nil { - data.Set("AuthPayload", *params.AuthPayload) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.ConfigNotificationToken != nil { - data.Set("Config.NotificationToken", *params.ConfigNotificationToken) -} -if params != nil && params.ConfigSdkVersion != nil { - data.Set("Config.SdkVersion", *params.ConfigSdkVersion) -} -if params != nil && params.ConfigTimeStep != nil { - data.Set("Config.TimeStep", fmt.Sprint(*params.ConfigTimeStep)) -} -if params != nil && params.ConfigSkew != nil { - data.Set("Config.Skew", fmt.Sprint(*params.ConfigSkew)) -} -if params != nil && params.ConfigCodeLength != nil { - data.Set("Config.CodeLength", fmt.Sprint(*params.ConfigCodeLength)) -} -if params != nil && params.ConfigAlg != nil { - data.Set("Config.Alg", *params.ConfigAlg) -} -if params != nil && params.ConfigNotificationPlatform != nil { - data.Set("Config.NotificationPlatform", *params.ConfigNotificationPlatform) -} + + if params != nil && params.AuthPayload != nil { + data.Set("AuthPayload", *params.AuthPayload) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.ConfigNotificationToken != nil { + data.Set("Config.NotificationToken", *params.ConfigNotificationToken) + } + if params != nil && params.ConfigSdkVersion != nil { + data.Set("Config.SdkVersion", *params.ConfigSdkVersion) + } + if params != nil && params.ConfigTimeStep != nil { + data.Set("Config.TimeStep", fmt.Sprint(*params.ConfigTimeStep)) + } + if params != nil && params.ConfigSkew != nil { + data.Set("Config.Skew", fmt.Sprint(*params.ConfigSkew)) + } + if params != nil && params.ConfigCodeLength != nil { + data.Set("Config.CodeLength", fmt.Sprint(*params.ConfigCodeLength)) + } + if params != nil && params.ConfigAlg != nil { + data.Set("Config.Alg", *params.ConfigAlg) + } + if params != nil && params.ConfigNotificationPlatform != nil { + data.Set("Config.NotificationPlatform", *params.ConfigNotificationPlatform) + } diff --git a/rest/verify/v2/services_messaging_configurations.go b/rest/verify/v2/services_messaging_configurations.go index 0f6327074..b5820cdf7 100644 --- a/rest/verify/v2/services_messaging_configurations.go +++ b/rest/verify/v2/services_messaging_configurations.go @@ -47,12 +47,13 @@ func (c *ApiService) CreateMessagingConfiguration(ServiceSid string, params *Cre 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) -} + + if params != nil && params.Country != nil { + data.Set("Country", *params.Country) + } + if params != nil && params.MessagingServiceSid != nil { + data.Set("MessagingServiceSid", *params.MessagingServiceSid) + } @@ -82,6 +83,7 @@ func (c *ApiService) DeleteMessagingConfiguration(ServiceSid string, Country str + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -103,6 +105,7 @@ func (c *ApiService) FetchMessagingConfiguration(ServiceSid string, Country stri + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -143,9 +146,10 @@ func (c *ApiService) PageMessagingConfiguration(ServiceSid string, params *ListM data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -276,9 +280,10 @@ func (c *ApiService) UpdateMessagingConfiguration(ServiceSid string, Country str data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.MessagingServiceSid != nil { - data.Set("MessagingServiceSid", *params.MessagingServiceSid) -} + + if params != nil && params.MessagingServiceSid != nil { + data.Set("MessagingServiceSid", *params.MessagingServiceSid) + } diff --git a/rest/verify/v2/services_rate_limits.go b/rest/verify/v2/services_rate_limits.go index 83cf210d7..12dec66b9 100644 --- a/rest/verify/v2/services_rate_limits.go +++ b/rest/verify/v2/services_rate_limits.go @@ -47,12 +47,13 @@ func (c *ApiService) CreateRateLimit(ServiceSid string, params *CreateRateLimitP data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.Description != nil { - data.Set("Description", *params.Description) -} + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.Description != nil { + data.Set("Description", *params.Description) + } @@ -82,6 +83,7 @@ func (c *ApiService) DeleteRateLimit(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -103,6 +105,7 @@ func (c *ApiService) FetchRateLimit(ServiceSid string, Sid string, ) (*VerifyV2R + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -143,9 +146,10 @@ func (c *ApiService) PageRateLimit(ServiceSid string, params *ListRateLimitParam data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -276,9 +280,10 @@ func (c *ApiService) UpdateRateLimit(ServiceSid string, Sid string, params *Upda data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Description != nil { - data.Set("Description", *params.Description) -} + + if params != nil && params.Description != nil { + data.Set("Description", *params.Description) + } diff --git a/rest/verify/v2/services_rate_limits_buckets.go b/rest/verify/v2/services_rate_limits_buckets.go index e11f47689..d903ae0b7 100644 --- a/rest/verify/v2/services_rate_limits_buckets.go +++ b/rest/verify/v2/services_rate_limits_buckets.go @@ -48,12 +48,13 @@ func (c *ApiService) CreateBucket(ServiceSid string, RateLimitSid string, params data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Max != nil { - data.Set("Max", fmt.Sprint(*params.Max)) -} -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)) + } + if params != nil && params.Interval != nil { + data.Set("Interval", fmt.Sprint(*params.Interval)) + } @@ -84,6 +85,7 @@ func (c *ApiService) DeleteBucket(ServiceSid string, RateLimitSid string, Sid st + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -106,6 +108,7 @@ func (c *ApiService) FetchBucket(ServiceSid string, RateLimitSid string, Sid str + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -147,9 +150,10 @@ func (c *ApiService) PageBucket(ServiceSid string, RateLimitSid string, params * data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -287,12 +291,13 @@ func (c *ApiService) UpdateBucket(ServiceSid string, RateLimitSid string, Sid st data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Max != nil { - data.Set("Max", fmt.Sprint(*params.Max)) -} -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)) + } + if params != nil && params.Interval != nil { + data.Set("Interval", fmt.Sprint(*params.Interval)) + } diff --git a/rest/verify/v2/services_verification_check.go b/rest/verify/v2/services_verification_check.go index 2174c7ae9..78123fd5a 100644 --- a/rest/verify/v2/services_verification_check.go +++ b/rest/verify/v2/services_verification_check.go @@ -65,21 +65,22 @@ func (c *ApiService) CreateVerificationCheck(ServiceSid string, params *CreateVe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Code != nil { - data.Set("Code", *params.Code) -} -if params != nil && params.To != nil { - data.Set("To", *params.To) -} -if params != nil && params.VerificationSid != nil { - data.Set("VerificationSid", *params.VerificationSid) -} -if params != nil && params.Amount != nil { - data.Set("Amount", *params.Amount) -} -if params != nil && params.Payee != nil { - data.Set("Payee", *params.Payee) -} + + if params != nil && params.Code != nil { + data.Set("Code", *params.Code) + } + if params != nil && params.To != nil { + data.Set("To", *params.To) + } + if params != nil && params.VerificationSid != nil { + data.Set("VerificationSid", *params.VerificationSid) + } + if params != nil && params.Amount != nil { + data.Set("Amount", *params.Amount) + } + if params != nil && params.Payee != nil { + data.Set("Payee", *params.Payee) + } diff --git a/rest/verify/v2/services_verifications.go b/rest/verify/v2/services_verifications.go index 099899658..0470b6f44 100644 --- a/rest/verify/v2/services_verifications.go +++ b/rest/verify/v2/services_verifications.go @@ -131,66 +131,67 @@ func (c *ApiService) CreateVerification(ServiceSid string, params *CreateVerific data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.To != nil { - data.Set("To", *params.To) -} -if params != nil && params.Channel != nil { - data.Set("Channel", *params.Channel) -} -if params != nil && params.CustomFriendlyName != nil { - data.Set("CustomFriendlyName", *params.CustomFriendlyName) -} -if params != nil && params.CustomMessage != nil { - data.Set("CustomMessage", *params.CustomMessage) -} -if params != nil && params.SendDigits != nil { - data.Set("SendDigits", *params.SendDigits) -} -if params != nil && params.Locale != nil { - data.Set("Locale", *params.Locale) -} -if params != nil && params.CustomCode != nil { - data.Set("CustomCode", *params.CustomCode) -} -if params != nil && params.Amount != nil { - data.Set("Amount", *params.Amount) -} -if params != nil && params.Payee != nil { - data.Set("Payee", *params.Payee) -} -if params != nil && params.RateLimits != nil { - v, err := json.Marshal(params.RateLimits) - if err != nil { - return nil, err + if params != nil && params.To != nil { + data.Set("To", *params.To) + } + if params != nil && params.Channel != nil { + data.Set("Channel", *params.Channel) + } + if params != nil && params.CustomFriendlyName != nil { + data.Set("CustomFriendlyName", *params.CustomFriendlyName) + } + if params != nil && params.CustomMessage != nil { + data.Set("CustomMessage", *params.CustomMessage) + } + if params != nil && params.SendDigits != nil { + data.Set("SendDigits", *params.SendDigits) } + if params != nil && params.Locale != nil { + data.Set("Locale", *params.Locale) + } + if params != nil && params.CustomCode != nil { + data.Set("CustomCode", *params.CustomCode) + } + if params != nil && params.Amount != nil { + data.Set("Amount", *params.Amount) + } + if params != nil && params.Payee != nil { + data.Set("Payee", *params.Payee) + } + if params != nil && params.RateLimits != nil { + v, err := json.Marshal(params.RateLimits) - data.Set("RateLimits", string(v)) -} -if params != nil && params.ChannelConfiguration != nil { - v, err := json.Marshal(params.ChannelConfiguration) + if err != nil { + return nil, err + } - if err != nil { - return nil, err + data.Set("RateLimits", string(v)) } + if params != nil && params.ChannelConfiguration != nil { + v, err := json.Marshal(params.ChannelConfiguration) - data.Set("ChannelConfiguration", string(v)) -} -if params != nil && params.AppHash != nil { - data.Set("AppHash", *params.AppHash) -} -if params != nil && params.TemplateSid != nil { - data.Set("TemplateSid", *params.TemplateSid) -} -if params != nil && params.TemplateCustomSubstitutions != nil { - data.Set("TemplateCustomSubstitutions", *params.TemplateCustomSubstitutions) -} -if params != nil && params.DeviceIp != nil { - data.Set("DeviceIp", *params.DeviceIp) -} -if params != nil && params.RiskCheck != nil { - data.Set("RiskCheck", *params.RiskCheck) -} + if err != nil { + return nil, err + } + + data.Set("ChannelConfiguration", string(v)) + } + if params != nil && params.AppHash != nil { + data.Set("AppHash", *params.AppHash) + } + if params != nil && params.TemplateSid != nil { + data.Set("TemplateSid", *params.TemplateSid) + } + if params != nil && params.TemplateCustomSubstitutions != nil { + data.Set("TemplateCustomSubstitutions", *params.TemplateCustomSubstitutions) + } + if params != nil && params.DeviceIp != nil { + data.Set("DeviceIp", *params.DeviceIp) + } + if params != nil && params.RiskCheck != nil { + data.Set("RiskCheck", *params.RiskCheck) + } @@ -220,6 +221,7 @@ func (c *ApiService) FetchVerification(ServiceSid string, Sid string, ) (*Verify + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -254,9 +256,10 @@ func (c *ApiService) UpdateVerification(ServiceSid string, Sid string, params *U data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } diff --git a/rest/verify/v2/services_webhooks.go b/rest/verify/v2/services_webhooks.go index 3ed1eefb8..ef6fac146 100644 --- a/rest/verify/v2/services_webhooks.go +++ b/rest/verify/v2/services_webhooks.go @@ -65,23 +65,24 @@ func (c *ApiService) CreateWebhook(ServiceSid string, params *CreateWebhookParam data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.EventTypes != nil { - for _, item := range *params.EventTypes { - data.Add("EventTypes", item) + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.EventTypes != nil { + for _, item := range *params.EventTypes { + data.Add("EventTypes", item) + } + } + if params != nil && params.WebhookUrl != nil { + data.Set("WebhookUrl", *params.WebhookUrl) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.Version != nil { + data.Set("Version", *params.Version) } -} -if params != nil && params.WebhookUrl != nil { - data.Set("WebhookUrl", *params.WebhookUrl) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.Version != nil { - data.Set("Version", *params.Version) -} @@ -111,6 +112,7 @@ func (c *ApiService) DeleteWebhook(ServiceSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -132,6 +134,7 @@ func (c *ApiService) FetchWebhook(ServiceSid string, Sid string, ) (*VerifyV2Web + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -172,9 +175,10 @@ func (c *ApiService) PageWebhook(ServiceSid string, params *ListWebhookParams, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -329,23 +333,24 @@ func (c *ApiService) UpdateWebhook(ServiceSid string, Sid string, params *Update data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.EventTypes != nil { - for _, item := range *params.EventTypes { - data.Add("EventTypes", item) + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.EventTypes != nil { + for _, item := range *params.EventTypes { + data.Add("EventTypes", item) + } + } + if params != nil && params.WebhookUrl != nil { + data.Set("WebhookUrl", *params.WebhookUrl) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.Version != nil { + data.Set("Version", *params.Version) } -} -if params != nil && params.WebhookUrl != nil { - data.Set("WebhookUrl", *params.WebhookUrl) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.Version != nil { - data.Set("Version", *params.Version) -} diff --git a/rest/verify/v2/templates.go b/rest/verify/v2/templates.go index 13e9f9fc8..cbe435f67 100644 --- a/rest/verify/v2/templates.go +++ b/rest/verify/v2/templates.go @@ -53,12 +53,13 @@ func (c *ApiService) PageVerificationTemplate(params *ListVerificationTemplatePa 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)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/video/v1/composition_hooks.go b/rest/video/v1/composition_hooks.go index 999db0fc0..caa239a49 100644 --- a/rest/video/v1/composition_hooks.go +++ b/rest/video/v1/composition_hooks.go @@ -94,46 +94,47 @@ func (c *ApiService) CreateCompositionHook(params *CreateCompositionHookParams) data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Enabled != nil { - data.Set("Enabled", fmt.Sprint(*params.Enabled)) -} -if params != nil && params.VideoLayout != nil { - v, err := json.Marshal(params.VideoLayout) - if err != nil { - return nil, err + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) } + if params != nil && params.Enabled != nil { + data.Set("Enabled", fmt.Sprint(*params.Enabled)) + } + if params != nil && params.VideoLayout != nil { + v, err := json.Marshal(params.VideoLayout) - data.Set("VideoLayout", string(v)) -} -if params != nil && params.AudioSources != nil { - for _, item := range *params.AudioSources { - data.Add("AudioSources", item) + if err != nil { + return nil, err + } + + data.Set("VideoLayout", string(v)) } -} -if params != nil && params.AudioSourcesExcluded != nil { - for _, item := range *params.AudioSourcesExcluded { - data.Add("AudioSourcesExcluded", item) + if params != nil && params.AudioSources != nil { + for _, item := range *params.AudioSources { + data.Add("AudioSources", item) + } + } + if params != nil && params.AudioSourcesExcluded != nil { + for _, item := range *params.AudioSourcesExcluded { + data.Add("AudioSourcesExcluded", item) + } + } + if params != nil && params.Resolution != nil { + data.Set("Resolution", *params.Resolution) + } + if params != nil && params.Format != nil { + data.Set("Format", *params.Format) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.Trim != nil { + data.Set("Trim", fmt.Sprint(*params.Trim)) } -} -if params != nil && params.Resolution != nil { - data.Set("Resolution", *params.Resolution) -} -if params != nil && params.Format != nil { - data.Set("Format", *params.Format) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.Trim != nil { - data.Set("Trim", fmt.Sprint(*params.Trim)) -} @@ -162,6 +163,7 @@ func (c *ApiService) DeleteCompositionHook(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -182,6 +184,7 @@ func (c *ApiService) FetchCompositionHook(Sid string, ) (*VideoV1CompositionHook + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -245,21 +248,22 @@ func (c *ApiService) PageCompositionHook(params *ListCompositionHookParams, page data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Enabled != nil { - data.Set("Enabled", fmt.Sprint(*params.Enabled)) -} -if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) -} -if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Enabled != nil { + data.Set("Enabled", fmt.Sprint(*params.Enabled)) + } + if params != nil && params.DateCreatedAfter != nil { + data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) + } + if params != nil && params.DateCreatedBefore != nil { + data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -443,46 +447,47 @@ func (c *ApiService) UpdateCompositionHook(Sid string, params *UpdateComposition data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Enabled != nil { - data.Set("Enabled", fmt.Sprint(*params.Enabled)) -} -if params != nil && params.VideoLayout != nil { - v, err := json.Marshal(params.VideoLayout) - if err != nil { - return nil, err + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Enabled != nil { + data.Set("Enabled", fmt.Sprint(*params.Enabled)) } + if params != nil && params.VideoLayout != nil { + v, err := json.Marshal(params.VideoLayout) - data.Set("VideoLayout", string(v)) -} -if params != nil && params.AudioSources != nil { - for _, item := range *params.AudioSources { - data.Add("AudioSources", item) + if err != nil { + return nil, err + } + + data.Set("VideoLayout", string(v)) } -} -if params != nil && params.AudioSourcesExcluded != nil { - for _, item := range *params.AudioSourcesExcluded { - data.Add("AudioSourcesExcluded", item) + if params != nil && params.AudioSources != nil { + for _, item := range *params.AudioSources { + data.Add("AudioSources", item) + } + } + if params != nil && params.AudioSourcesExcluded != nil { + for _, item := range *params.AudioSourcesExcluded { + data.Add("AudioSourcesExcluded", item) + } + } + if params != nil && params.Trim != nil { + data.Set("Trim", fmt.Sprint(*params.Trim)) + } + if params != nil && params.Format != nil { + data.Set("Format", *params.Format) + } + if params != nil && params.Resolution != nil { + data.Set("Resolution", *params.Resolution) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) } -} -if params != nil && params.Trim != nil { - data.Set("Trim", fmt.Sprint(*params.Trim)) -} -if params != nil && params.Format != nil { - data.Set("Format", *params.Format) -} -if params != nil && params.Resolution != nil { - data.Set("Resolution", *params.Resolution) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} diff --git a/rest/video/v1/composition_settings_default.go b/rest/video/v1/composition_settings_default.go index 9db3efe77..fcda4ad60 100644 --- a/rest/video/v1/composition_settings_default.go +++ b/rest/video/v1/composition_settings_default.go @@ -70,24 +70,25 @@ func (c *ApiService) CreateCompositionSettings(params *CreateCompositionSettings data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.AwsCredentialsSid != nil { - data.Set("AwsCredentialsSid", *params.AwsCredentialsSid) -} -if params != nil && params.EncryptionKeySid != nil { - data.Set("EncryptionKeySid", *params.EncryptionKeySid) -} -if params != nil && params.AwsS3Url != nil { - data.Set("AwsS3Url", *params.AwsS3Url) -} -if params != nil && params.AwsStorageEnabled != nil { - data.Set("AwsStorageEnabled", fmt.Sprint(*params.AwsStorageEnabled)) -} -if params != nil && params.EncryptionEnabled != nil { - data.Set("EncryptionEnabled", fmt.Sprint(*params.EncryptionEnabled)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.AwsCredentialsSid != nil { + data.Set("AwsCredentialsSid", *params.AwsCredentialsSid) + } + if params != nil && params.EncryptionKeySid != nil { + data.Set("EncryptionKeySid", *params.EncryptionKeySid) + } + if params != nil && params.AwsS3Url != nil { + data.Set("AwsS3Url", *params.AwsS3Url) + } + if params != nil && params.AwsStorageEnabled != nil { + data.Set("AwsStorageEnabled", fmt.Sprint(*params.AwsStorageEnabled)) + } + if params != nil && params.EncryptionEnabled != nil { + data.Set("EncryptionEnabled", fmt.Sprint(*params.EncryptionEnabled)) + } @@ -115,6 +116,7 @@ func (c *ApiService) FetchCompositionSettings() (*VideoV1CompositionSettings, er + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/video/v1/compositions.go b/rest/video/v1/compositions.go index e39fb63a4..fae85222b 100644 --- a/rest/video/v1/compositions.go +++ b/rest/video/v1/compositions.go @@ -88,43 +88,44 @@ func (c *ApiService) CreateComposition(params *CreateCompositionParams) (*VideoV data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.RoomSid != nil { - data.Set("RoomSid", *params.RoomSid) -} -if params != nil && params.VideoLayout != nil { - v, err := json.Marshal(params.VideoLayout) - if err != nil { - return nil, err + if params != nil && params.RoomSid != nil { + data.Set("RoomSid", *params.RoomSid) } + if params != nil && params.VideoLayout != nil { + v, err := json.Marshal(params.VideoLayout) - data.Set("VideoLayout", string(v)) -} -if params != nil && params.AudioSources != nil { - for _, item := range *params.AudioSources { - data.Add("AudioSources", item) + if err != nil { + return nil, err + } + + data.Set("VideoLayout", string(v)) } -} -if params != nil && params.AudioSourcesExcluded != nil { - for _, item := range *params.AudioSourcesExcluded { - data.Add("AudioSourcesExcluded", item) + if params != nil && params.AudioSources != nil { + for _, item := range *params.AudioSources { + data.Add("AudioSources", item) + } + } + if params != nil && params.AudioSourcesExcluded != nil { + for _, item := range *params.AudioSourcesExcluded { + data.Add("AudioSourcesExcluded", item) + } + } + if params != nil && params.Resolution != nil { + data.Set("Resolution", *params.Resolution) + } + if params != nil && params.Format != nil { + data.Set("Format", *params.Format) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.Trim != nil { + data.Set("Trim", fmt.Sprint(*params.Trim)) } -} -if params != nil && params.Resolution != nil { - data.Set("Resolution", *params.Resolution) -} -if params != nil && params.Format != nil { - data.Set("Format", *params.Format) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.Trim != nil { - data.Set("Trim", fmt.Sprint(*params.Trim)) -} @@ -153,6 +154,7 @@ func (c *ApiService) DeleteComposition(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -173,6 +175,7 @@ func (c *ApiService) FetchComposition(Sid string, ) (*VideoV1Composition, error) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -236,21 +239,22 @@ func (c *ApiService) PageComposition(params *ListCompositionParams, pageToken, p data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) -} -if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) -} -if params != nil && params.RoomSid != nil { - data.Set("RoomSid", *params.RoomSid) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.DateCreatedAfter != nil { + data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) + } + if params != nil && params.DateCreatedBefore != nil { + data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) + } + if params != nil && params.RoomSid != nil { + data.Set("RoomSid", *params.RoomSid) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/video/v1/recording_settings_default.go b/rest/video/v1/recording_settings_default.go index 2c847774d..5529fec4b 100644 --- a/rest/video/v1/recording_settings_default.go +++ b/rest/video/v1/recording_settings_default.go @@ -70,24 +70,25 @@ func (c *ApiService) CreateRecordingSettings(params *CreateRecordingSettingsPara data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.AwsCredentialsSid != nil { - data.Set("AwsCredentialsSid", *params.AwsCredentialsSid) -} -if params != nil && params.EncryptionKeySid != nil { - data.Set("EncryptionKeySid", *params.EncryptionKeySid) -} -if params != nil && params.AwsS3Url != nil { - data.Set("AwsS3Url", *params.AwsS3Url) -} -if params != nil && params.AwsStorageEnabled != nil { - data.Set("AwsStorageEnabled", fmt.Sprint(*params.AwsStorageEnabled)) -} -if params != nil && params.EncryptionEnabled != nil { - data.Set("EncryptionEnabled", fmt.Sprint(*params.EncryptionEnabled)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.AwsCredentialsSid != nil { + data.Set("AwsCredentialsSid", *params.AwsCredentialsSid) + } + if params != nil && params.EncryptionKeySid != nil { + data.Set("EncryptionKeySid", *params.EncryptionKeySid) + } + if params != nil && params.AwsS3Url != nil { + data.Set("AwsS3Url", *params.AwsS3Url) + } + if params != nil && params.AwsStorageEnabled != nil { + data.Set("AwsStorageEnabled", fmt.Sprint(*params.AwsStorageEnabled)) + } + if params != nil && params.EncryptionEnabled != nil { + data.Set("EncryptionEnabled", fmt.Sprint(*params.EncryptionEnabled)) + } @@ -115,6 +116,7 @@ func (c *ApiService) FetchRecordingSettings() (*VideoV1RecordingSettings, error) + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/video/v1/recordings.go b/rest/video/v1/recordings.go index e141e320f..a97c77646 100644 --- a/rest/video/v1/recordings.go +++ b/rest/video/v1/recordings.go @@ -33,6 +33,7 @@ func (c *ApiService) DeleteRecording(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -53,6 +54,7 @@ func (c *ApiService) FetchRecording(Sid string, ) (*VideoV1Recording, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -128,29 +130,30 @@ func (c *ApiService) PageRecording(params *ListRecordingParams, pageToken, pageN data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.SourceSid != nil { - data.Set("SourceSid", *params.SourceSid) -} -if params != nil && params.GroupingSid != nil { - for _, item := range *params.GroupingSid { - data.Add("GroupingSid", item) + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.SourceSid != nil { + data.Set("SourceSid", *params.SourceSid) + } + if params != nil && params.GroupingSid != nil { + for _, item := range *params.GroupingSid { + data.Add("GroupingSid", item) + } + } + if params != nil && params.DateCreatedAfter != nil { + data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) + } + if params != nil && params.DateCreatedBefore != nil { + data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) + } + if params != nil && params.MediaType != nil { + data.Set("MediaType", *params.MediaType) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) } -} -if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) -} -if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) -} -if params != nil && params.MediaType != nil { - data.Set("MediaType", *params.MediaType) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/video/v1/rooms.go b/rest/video/v1/rooms.go index 423da5ebd..b3fd5c037 100644 --- a/rest/video/v1/rooms.go +++ b/rest/video/v1/rooms.go @@ -124,59 +124,60 @@ func (c *ApiService) CreateRoom(params *CreateRoomParams) (*VideoV1Room, error) data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.EnableTurn != nil { - data.Set("EnableTurn", fmt.Sprint(*params.EnableTurn)) -} -if params != nil && params.Type != nil { - data.Set("Type", *params.Type) -} -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.StatusCallback != nil { - data.Set("StatusCallback", *params.StatusCallback) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.MaxParticipants != nil { - data.Set("MaxParticipants", fmt.Sprint(*params.MaxParticipants)) -} -if params != nil && params.RecordParticipantsOnConnect != nil { - data.Set("RecordParticipantsOnConnect", fmt.Sprint(*params.RecordParticipantsOnConnect)) -} -if params != nil && params.VideoCodecs != nil { - for _, item := range *params.VideoCodecs { - data.Add("VideoCodecs", item) - } -} -if params != nil && params.MediaRegion != nil { - data.Set("MediaRegion", *params.MediaRegion) -} -if params != nil && params.RecordingRules != nil { - v, err := json.Marshal(params.RecordingRules) - if err != nil { - return nil, err + if params != nil && params.EnableTurn != nil { + data.Set("EnableTurn", fmt.Sprint(*params.EnableTurn)) + } + if params != nil && params.Type != nil { + data.Set("Type", *params.Type) } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.StatusCallback != nil { + data.Set("StatusCallback", *params.StatusCallback) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.MaxParticipants != nil { + data.Set("MaxParticipants", fmt.Sprint(*params.MaxParticipants)) + } + if params != nil && params.RecordParticipantsOnConnect != nil { + data.Set("RecordParticipantsOnConnect", fmt.Sprint(*params.RecordParticipantsOnConnect)) + } + if params != nil && params.VideoCodecs != nil { + for _, item := range *params.VideoCodecs { + data.Add("VideoCodecs", item) + } + } + if params != nil && params.MediaRegion != nil { + data.Set("MediaRegion", *params.MediaRegion) + } + if params != nil && params.RecordingRules != nil { + v, err := json.Marshal(params.RecordingRules) - data.Set("RecordingRules", string(v)) -} -if params != nil && params.AudioOnly != nil { - data.Set("AudioOnly", fmt.Sprint(*params.AudioOnly)) -} -if params != nil && params.MaxParticipantDuration != nil { - data.Set("MaxParticipantDuration", fmt.Sprint(*params.MaxParticipantDuration)) -} -if params != nil && params.EmptyRoomTimeout != nil { - data.Set("EmptyRoomTimeout", fmt.Sprint(*params.EmptyRoomTimeout)) -} -if params != nil && params.UnusedRoomTimeout != nil { - data.Set("UnusedRoomTimeout", fmt.Sprint(*params.UnusedRoomTimeout)) -} -if params != nil && params.LargeRoom != nil { - data.Set("LargeRoom", fmt.Sprint(*params.LargeRoom)) -} + if err != nil { + return nil, err + } + + data.Set("RecordingRules", string(v)) + } + if params != nil && params.AudioOnly != nil { + data.Set("AudioOnly", fmt.Sprint(*params.AudioOnly)) + } + if params != nil && params.MaxParticipantDuration != nil { + data.Set("MaxParticipantDuration", fmt.Sprint(*params.MaxParticipantDuration)) + } + if params != nil && params.EmptyRoomTimeout != nil { + data.Set("EmptyRoomTimeout", fmt.Sprint(*params.EmptyRoomTimeout)) + } + if params != nil && params.UnusedRoomTimeout != nil { + data.Set("UnusedRoomTimeout", fmt.Sprint(*params.UnusedRoomTimeout)) + } + if params != nil && params.LargeRoom != nil { + data.Set("LargeRoom", fmt.Sprint(*params.LargeRoom)) + } @@ -205,6 +206,7 @@ func (c *ApiService) FetchRoom(Sid string, ) (*VideoV1Room, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -268,21 +270,22 @@ func (c *ApiService) PageRoom(params *ListRoomParams, pageToken, pageNumber stri data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) -} -if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.DateCreatedAfter != nil { + data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) + } + if params != nil && params.DateCreatedBefore != nil { + data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -412,9 +415,10 @@ func (c *ApiService) UpdateRoom(Sid string, params *UpdateRoomParams) (*VideoV1R data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } diff --git a/rest/video/v1/rooms_participants.go b/rest/video/v1/rooms_participants.go index b09416a9d..e13e22543 100644 --- a/rest/video/v1/rooms_participants.go +++ b/rest/video/v1/rooms_participants.go @@ -34,6 +34,7 @@ func (c *ApiService) FetchRoomParticipant(RoomSid string, Sid string, ) (*VideoV + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -98,21 +99,22 @@ func (c *ApiService) PageRoomParticipant(RoomSid string, params *ListRoomPartici data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.Identity != nil { - data.Set("Identity", *params.Identity) -} -if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) -} -if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.Identity != nil { + data.Set("Identity", *params.Identity) + } + if params != nil && params.DateCreatedAfter != nil { + data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) + } + if params != nil && params.DateCreatedBefore != nil { + data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -243,9 +245,10 @@ func (c *ApiService) UpdateRoomParticipant(RoomSid string, Sid string, params *U data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } diff --git a/rest/video/v1/rooms_participants_anonymize.go b/rest/video/v1/rooms_participants_anonymize.go index ddfd7f082..c9e203b2f 100644 --- a/rest/video/v1/rooms_participants_anonymize.go +++ b/rest/video/v1/rooms_participants_anonymize.go @@ -34,6 +34,7 @@ func (c *ApiService) UpdateRoomParticipantAnonymize(RoomSid string, Sid string, + resp, err := c.requestHandler.Post(c.baseURL+path, data, headers) if err != nil { return nil, err diff --git a/rest/video/v1/rooms_participants_published_tracks.go b/rest/video/v1/rooms_participants_published_tracks.go index 215525fa7..d511cc595 100644 --- a/rest/video/v1/rooms_participants_published_tracks.go +++ b/rest/video/v1/rooms_participants_published_tracks.go @@ -35,6 +35,7 @@ func (c *ApiService) FetchRoomParticipantPublishedTrack(RoomSid string, Particip + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -76,9 +77,10 @@ func (c *ApiService) PageRoomParticipantPublishedTrack(RoomSid string, Participa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/video/v1/rooms_participants_subscribe_rules.go b/rest/video/v1/rooms_participants_subscribe_rules.go index 4f297ac81..a1f619e52 100644 --- a/rest/video/v1/rooms_participants_subscribe_rules.go +++ b/rest/video/v1/rooms_participants_subscribe_rules.go @@ -34,6 +34,7 @@ func (c *ApiService) FetchRoomParticipantSubscribeRule(RoomSid string, Participa + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -68,15 +69,16 @@ func (c *ApiService) UpdateRoomParticipantSubscribeRule(RoomSid string, Particip data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Rules != nil { - v, err := json.Marshal(params.Rules) - if err != nil { - return nil, err - } + if params != nil && params.Rules != nil { + v, err := json.Marshal(params.Rules) - data.Set("Rules", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Rules", string(v)) + } diff --git a/rest/video/v1/rooms_participants_subscribed_tracks.go b/rest/video/v1/rooms_participants_subscribed_tracks.go index 84ebfdc7f..e3dc771ce 100644 --- a/rest/video/v1/rooms_participants_subscribed_tracks.go +++ b/rest/video/v1/rooms_participants_subscribed_tracks.go @@ -35,6 +35,7 @@ func (c *ApiService) FetchRoomParticipantSubscribedTrack(RoomSid string, Partici + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -76,9 +77,10 @@ func (c *ApiService) PageRoomParticipantSubscribedTrack(RoomSid string, Particip data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/video/v1/rooms_recording_rules.go b/rest/video/v1/rooms_recording_rules.go index dd76f408c..48a743e60 100644 --- a/rest/video/v1/rooms_recording_rules.go +++ b/rest/video/v1/rooms_recording_rules.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchRoomRecordingRule(RoomSid string, ) (*VideoV1RoomRecor + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -66,15 +67,16 @@ func (c *ApiService) UpdateRoomRecordingRule(RoomSid string, params *UpdateRoomR data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Rules != nil { - v, err := json.Marshal(params.Rules) - if err != nil { - return nil, err - } + if params != nil && params.Rules != nil { + v, err := json.Marshal(params.Rules) - data.Set("Rules", string(v)) -} + if err != nil { + return nil, err + } + + data.Set("Rules", string(v)) + } diff --git a/rest/video/v1/rooms_recordings.go b/rest/video/v1/rooms_recordings.go index b4a7fafc1..2aee34b01 100644 --- a/rest/video/v1/rooms_recordings.go +++ b/rest/video/v1/rooms_recordings.go @@ -34,6 +34,7 @@ func (c *ApiService) DeleteRoomRecording(RoomSid string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -55,6 +56,7 @@ func (c *ApiService) FetchRoomRecording(RoomSid string, Sid string, ) (*VideoV1R + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -119,21 +121,22 @@ func (c *ApiService) PageRoomRecording(RoomSid string, params *ListRoomRecording data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.SourceSid != nil { - data.Set("SourceSid", *params.SourceSid) -} -if params != nil && params.DateCreatedAfter != nil { - data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) -} -if params != nil && params.DateCreatedBefore != nil { - data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.SourceSid != nil { + data.Set("SourceSid", *params.SourceSid) + } + if params != nil && params.DateCreatedAfter != nil { + data.Set("DateCreatedAfter", fmt.Sprint((*params.DateCreatedAfter).Format(time.RFC3339))) + } + if params != nil && params.DateCreatedBefore != nil { + data.Set("DateCreatedBefore", fmt.Sprint((*params.DateCreatedBefore).Format(time.RFC3339))) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/voice/v1/archives_calls.go b/rest/voice/v1/archives_calls.go index f72918453..a4ee14f7b 100644 --- a/rest/voice/v1/archives_calls.go +++ b/rest/voice/v1/archives_calls.go @@ -34,6 +34,7 @@ func (c *ApiService) DeleteArchivedCall(Date string, Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err diff --git a/rest/voice/v1/byoc_trunks.go b/rest/voice/v1/byoc_trunks.go index 63ab8b269..43faa1be0 100644 --- a/rest/voice/v1/byoc_trunks.go +++ b/rest/voice/v1/byoc_trunks.go @@ -94,36 +94,37 @@ func (c *ApiService) CreateByocTrunk(params *CreateByocTrunkParams) (*VoiceV1Byo data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.VoiceUrl != nil { - data.Set("VoiceUrl", *params.VoiceUrl) -} -if params != nil && params.VoiceMethod != nil { - data.Set("VoiceMethod", *params.VoiceMethod) -} -if params != nil && params.VoiceFallbackUrl != nil { - data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) -} -if params != nil && params.VoiceFallbackMethod != nil { - data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) -} -if params != nil && params.StatusCallbackUrl != nil { - data.Set("StatusCallbackUrl", *params.StatusCallbackUrl) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.CnamLookupEnabled != nil { - data.Set("CnamLookupEnabled", fmt.Sprint(*params.CnamLookupEnabled)) -} -if params != nil && params.ConnectionPolicySid != nil { - data.Set("ConnectionPolicySid", *params.ConnectionPolicySid) -} -if params != nil && params.FromDomainSid != nil { - data.Set("FromDomainSid", *params.FromDomainSid) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.VoiceUrl != nil { + data.Set("VoiceUrl", *params.VoiceUrl) + } + if params != nil && params.VoiceMethod != nil { + data.Set("VoiceMethod", *params.VoiceMethod) + } + if params != nil && params.VoiceFallbackUrl != nil { + data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) + } + if params != nil && params.VoiceFallbackMethod != nil { + data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) + } + if params != nil && params.StatusCallbackUrl != nil { + data.Set("StatusCallbackUrl", *params.StatusCallbackUrl) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.CnamLookupEnabled != nil { + data.Set("CnamLookupEnabled", fmt.Sprint(*params.CnamLookupEnabled)) + } + if params != nil && params.ConnectionPolicySid != nil { + data.Set("ConnectionPolicySid", *params.ConnectionPolicySid) + } + if params != nil && params.FromDomainSid != nil { + data.Set("FromDomainSid", *params.FromDomainSid) + } @@ -152,6 +153,7 @@ func (c *ApiService) DeleteByocTrunk(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -172,6 +174,7 @@ func (c *ApiService) FetchByocTrunk(Sid string, ) (*VoiceV1ByocTrunk, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -211,9 +214,10 @@ func (c *ApiService) PageByocTrunk(params *ListByocTrunkParams, pageToken, pageN data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -397,36 +401,37 @@ func (c *ApiService) UpdateByocTrunk(Sid string, params *UpdateByocTrunkParams) data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.VoiceUrl != nil { - data.Set("VoiceUrl", *params.VoiceUrl) -} -if params != nil && params.VoiceMethod != nil { - data.Set("VoiceMethod", *params.VoiceMethod) -} -if params != nil && params.VoiceFallbackUrl != nil { - data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) -} -if params != nil && params.VoiceFallbackMethod != nil { - data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) -} -if params != nil && params.StatusCallbackUrl != nil { - data.Set("StatusCallbackUrl", *params.StatusCallbackUrl) -} -if params != nil && params.StatusCallbackMethod != nil { - data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) -} -if params != nil && params.CnamLookupEnabled != nil { - data.Set("CnamLookupEnabled", fmt.Sprint(*params.CnamLookupEnabled)) -} -if params != nil && params.ConnectionPolicySid != nil { - data.Set("ConnectionPolicySid", *params.ConnectionPolicySid) -} -if params != nil && params.FromDomainSid != nil { - data.Set("FromDomainSid", *params.FromDomainSid) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.VoiceUrl != nil { + data.Set("VoiceUrl", *params.VoiceUrl) + } + if params != nil && params.VoiceMethod != nil { + data.Set("VoiceMethod", *params.VoiceMethod) + } + if params != nil && params.VoiceFallbackUrl != nil { + data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) + } + if params != nil && params.VoiceFallbackMethod != nil { + data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) + } + if params != nil && params.StatusCallbackUrl != nil { + data.Set("StatusCallbackUrl", *params.StatusCallbackUrl) + } + if params != nil && params.StatusCallbackMethod != nil { + data.Set("StatusCallbackMethod", *params.StatusCallbackMethod) + } + if params != nil && params.CnamLookupEnabled != nil { + data.Set("CnamLookupEnabled", fmt.Sprint(*params.CnamLookupEnabled)) + } + if params != nil && params.ConnectionPolicySid != nil { + data.Set("ConnectionPolicySid", *params.ConnectionPolicySid) + } + if params != nil && params.FromDomainSid != nil { + data.Set("FromDomainSid", *params.FromDomainSid) + } diff --git a/rest/voice/v1/connection_policies.go b/rest/voice/v1/connection_policies.go index 61d84d9ac..3d33a54e6 100644 --- a/rest/voice/v1/connection_policies.go +++ b/rest/voice/v1/connection_policies.go @@ -40,9 +40,10 @@ func (c *ApiService) CreateConnectionPolicy(params *CreateConnectionPolicyParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } @@ -71,6 +72,7 @@ func (c *ApiService) DeleteConnectionPolicy(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -91,6 +93,7 @@ func (c *ApiService) FetchConnectionPolicy(Sid string, ) (*VoiceV1ConnectionPoli + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -130,9 +133,10 @@ func (c *ApiService) PageConnectionPolicy(params *ListConnectionPolicyParams, pa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -262,9 +266,10 @@ func (c *ApiService) UpdateConnectionPolicy(Sid string, params *UpdateConnection data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } diff --git a/rest/voice/v1/connection_policies_targets.go b/rest/voice/v1/connection_policies_targets.go index 05710d137..3f38db8e6 100644 --- a/rest/voice/v1/connection_policies_targets.go +++ b/rest/voice/v1/connection_policies_targets.go @@ -65,21 +65,22 @@ func (c *ApiService) CreateConnectionPolicyTarget(ConnectionPolicySid string, pa data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Target != nil { - data.Set("Target", *params.Target) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Priority != nil { - data.Set("Priority", fmt.Sprint(*params.Priority)) -} -if params != nil && params.Weight != nil { - data.Set("Weight", fmt.Sprint(*params.Weight)) -} -if params != nil && params.Enabled != nil { - data.Set("Enabled", fmt.Sprint(*params.Enabled)) -} + + if params != nil && params.Target != nil { + data.Set("Target", *params.Target) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Priority != nil { + data.Set("Priority", fmt.Sprint(*params.Priority)) + } + if params != nil && params.Weight != nil { + data.Set("Weight", fmt.Sprint(*params.Weight)) + } + if params != nil && params.Enabled != nil { + data.Set("Enabled", fmt.Sprint(*params.Enabled)) + } @@ -109,6 +110,7 @@ func (c *ApiService) DeleteConnectionPolicyTarget(ConnectionPolicySid string, Si + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -130,6 +132,7 @@ func (c *ApiService) FetchConnectionPolicyTarget(ConnectionPolicySid string, Sid + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -170,9 +173,10 @@ func (c *ApiService) PageConnectionPolicyTarget(ConnectionPolicySid string, para data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -327,21 +331,22 @@ func (c *ApiService) UpdateConnectionPolicyTarget(ConnectionPolicySid string, Si data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.Target != nil { - data.Set("Target", *params.Target) -} -if params != nil && params.Priority != nil { - data.Set("Priority", fmt.Sprint(*params.Priority)) -} -if params != nil && params.Weight != nil { - data.Set("Weight", fmt.Sprint(*params.Weight)) -} -if params != nil && params.Enabled != nil { - data.Set("Enabled", fmt.Sprint(*params.Enabled)) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.Target != nil { + data.Set("Target", *params.Target) + } + if params != nil && params.Priority != nil { + data.Set("Priority", fmt.Sprint(*params.Priority)) + } + if params != nil && params.Weight != nil { + data.Set("Weight", fmt.Sprint(*params.Weight)) + } + if params != nil && params.Enabled != nil { + data.Set("Enabled", fmt.Sprint(*params.Enabled)) + } diff --git a/rest/voice/v1/dialing_permissions_bulk_country_updates.go b/rest/voice/v1/dialing_permissions_bulk_country_updates.go index 19760e23e..6529f96d7 100644 --- a/rest/voice/v1/dialing_permissions_bulk_country_updates.go +++ b/rest/voice/v1/dialing_permissions_bulk_country_updates.go @@ -40,9 +40,10 @@ func (c *ApiService) CreateDialingPermissionsCountryBulkUpdate(params *CreateDia data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UpdateRequest != nil { - data.Set("UpdateRequest", *params.UpdateRequest) -} + + if params != nil && params.UpdateRequest != nil { + data.Set("UpdateRequest", *params.UpdateRequest) + } diff --git a/rest/voice/v1/dialing_permissions_countries.go b/rest/voice/v1/dialing_permissions_countries.go index 0d5666737..cb8ba6a23 100644 --- a/rest/voice/v1/dialing_permissions_countries.go +++ b/rest/voice/v1/dialing_permissions_countries.go @@ -33,6 +33,7 @@ func (c *ApiService) FetchDialingPermissionsCountry(IsoCode string, ) (*VoiceV1D + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -108,27 +109,28 @@ func (c *ApiService) PageDialingPermissionsCountry(params *ListDialingPermission data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.IsoCode != nil { - data.Set("IsoCode", *params.IsoCode) -} -if params != nil && params.Continent != nil { - data.Set("Continent", *params.Continent) -} -if params != nil && params.CountryCode != nil { - data.Set("CountryCode", *params.CountryCode) -} -if params != nil && params.LowRiskNumbersEnabled != nil { - data.Set("LowRiskNumbersEnabled", fmt.Sprint(*params.LowRiskNumbersEnabled)) -} -if params != nil && params.HighRiskSpecialNumbersEnabled != nil { - data.Set("HighRiskSpecialNumbersEnabled", fmt.Sprint(*params.HighRiskSpecialNumbersEnabled)) -} -if params != nil && params.HighRiskTollfraudNumbersEnabled != nil { - data.Set("HighRiskTollfraudNumbersEnabled", fmt.Sprint(*params.HighRiskTollfraudNumbersEnabled)) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.IsoCode != nil { + data.Set("IsoCode", *params.IsoCode) + } + if params != nil && params.Continent != nil { + data.Set("Continent", *params.Continent) + } + if params != nil && params.CountryCode != nil { + data.Set("CountryCode", *params.CountryCode) + } + if params != nil && params.LowRiskNumbersEnabled != nil { + data.Set("LowRiskNumbersEnabled", fmt.Sprint(*params.LowRiskNumbersEnabled)) + } + if params != nil && params.HighRiskSpecialNumbersEnabled != nil { + data.Set("HighRiskSpecialNumbersEnabled", fmt.Sprint(*params.HighRiskSpecialNumbersEnabled)) + } + if params != nil && params.HighRiskTollfraudNumbersEnabled != nil { + data.Set("HighRiskTollfraudNumbersEnabled", fmt.Sprint(*params.HighRiskTollfraudNumbersEnabled)) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) 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 978b4c674..29da8f4dd 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 @@ -48,9 +48,10 @@ func (c *ApiService) PageDialingPermissionsHrsPrefixes(IsoCode string, params *L data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/voice/v1/ip_records.go b/rest/voice/v1/ip_records.go index ea98558a4..fb4a1a0d2 100644 --- a/rest/voice/v1/ip_records.go +++ b/rest/voice/v1/ip_records.go @@ -52,15 +52,16 @@ func (c *ApiService) CreateIpRecord(params *CreateIpRecordParams) (*VoiceV1IpRec data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.IpAddress != nil { - data.Set("IpAddress", *params.IpAddress) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.CidrPrefixLength != nil { - data.Set("CidrPrefixLength", fmt.Sprint(*params.CidrPrefixLength)) -} + + if params != nil && params.IpAddress != nil { + data.Set("IpAddress", *params.IpAddress) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.CidrPrefixLength != nil { + data.Set("CidrPrefixLength", fmt.Sprint(*params.CidrPrefixLength)) + } @@ -89,6 +90,7 @@ func (c *ApiService) DeleteIpRecord(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -109,6 +111,7 @@ func (c *ApiService) FetchIpRecord(Sid string, ) (*VoiceV1IpRecord, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -148,9 +151,10 @@ func (c *ApiService) PageIpRecord(params *ListIpRecordParams, pageToken, pageNum data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -280,9 +284,10 @@ func (c *ApiService) UpdateIpRecord(Sid string, params *UpdateIpRecordParams) (* data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } diff --git a/rest/voice/v1/settings.go b/rest/voice/v1/settings.go index db2cb119c..6326625a0 100644 --- a/rest/voice/v1/settings.go +++ b/rest/voice/v1/settings.go @@ -32,6 +32,7 @@ func (c *ApiService) FetchDialingPermissionsSettings() (*VoiceV1DialingPermissio + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -64,9 +65,10 @@ func (c *ApiService) UpdateDialingPermissionsSettings(params *UpdateDialingPermi data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.DialingPermissionsInheritance != nil { - data.Set("DialingPermissionsInheritance", fmt.Sprint(*params.DialingPermissionsInheritance)) -} + + if params != nil && params.DialingPermissionsInheritance != nil { + data.Set("DialingPermissionsInheritance", fmt.Sprint(*params.DialingPermissionsInheritance)) + } diff --git a/rest/voice/v1/source_ip_mappings.go b/rest/voice/v1/source_ip_mappings.go index 8ac9152ff..36d23cab5 100644 --- a/rest/voice/v1/source_ip_mappings.go +++ b/rest/voice/v1/source_ip_mappings.go @@ -46,12 +46,13 @@ func (c *ApiService) CreateSourceIpMapping(params *CreateSourceIpMappingParams) 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) -} + + if params != nil && params.IpRecordSid != nil { + data.Set("IpRecordSid", *params.IpRecordSid) + } + if params != nil && params.SipDomainSid != nil { + data.Set("SipDomainSid", *params.SipDomainSid) + } @@ -80,6 +81,7 @@ func (c *ApiService) DeleteSourceIpMapping(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -100,6 +102,7 @@ func (c *ApiService) FetchSourceIpMapping(Sid string, ) (*VoiceV1SourceIpMapping + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -139,9 +142,10 @@ func (c *ApiService) PageSourceIpMapping(params *ListSourceIpMappingParams, page data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -271,9 +275,10 @@ func (c *ApiService) UpdateSourceIpMapping(Sid string, params *UpdateSourceIpMap data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.SipDomainSid != nil { - data.Set("SipDomainSid", *params.SipDomainSid) -} + + if params != nil && params.SipDomainSid != nil { + data.Set("SipDomainSid", *params.SipDomainSid) + } diff --git a/rest/wireless/v1/commands.go b/rest/wireless/v1/commands.go index 61680607c..937b630f8 100644 --- a/rest/wireless/v1/commands.go +++ b/rest/wireless/v1/commands.go @@ -76,27 +76,28 @@ func (c *ApiService) CreateCommand(params *CreateCommandParams) (*WirelessV1Comm data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Command != nil { - data.Set("Command", *params.Command) -} -if params != nil && params.Sim != nil { - data.Set("Sim", *params.Sim) -} -if params != nil && params.CallbackMethod != nil { - data.Set("CallbackMethod", *params.CallbackMethod) -} -if params != nil && params.CallbackUrl != nil { - data.Set("CallbackUrl", *params.CallbackUrl) -} -if params != nil && params.CommandMode != nil { - data.Set("CommandMode", *params.CommandMode) -} -if params != nil && params.IncludeSid != nil { - data.Set("IncludeSid", *params.IncludeSid) -} -if params != nil && params.DeliveryReceiptRequested != nil { - data.Set("DeliveryReceiptRequested", fmt.Sprint(*params.DeliveryReceiptRequested)) -} + + if params != nil && params.Command != nil { + data.Set("Command", *params.Command) + } + if params != nil && params.Sim != nil { + data.Set("Sim", *params.Sim) + } + if params != nil && params.CallbackMethod != nil { + data.Set("CallbackMethod", *params.CallbackMethod) + } + if params != nil && params.CallbackUrl != nil { + data.Set("CallbackUrl", *params.CallbackUrl) + } + if params != nil && params.CommandMode != nil { + data.Set("CommandMode", *params.CommandMode) + } + if params != nil && params.IncludeSid != nil { + data.Set("IncludeSid", *params.IncludeSid) + } + if params != nil && params.DeliveryReceiptRequested != nil { + data.Set("DeliveryReceiptRequested", fmt.Sprint(*params.DeliveryReceiptRequested)) + } @@ -125,6 +126,7 @@ func (c *ApiService) DeleteCommand(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -145,6 +147,7 @@ func (c *ApiService) FetchCommand(Sid string, ) (*WirelessV1Command, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -208,21 +211,22 @@ func (c *ApiService) PageCommand(params *ListCommandParams, pageToken, pageNumbe data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Sim != nil { - data.Set("Sim", *params.Sim) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.Direction != nil { - data.Set("Direction", *params.Direction) -} -if params != nil && params.Transport != nil { - data.Set("Transport", *params.Transport) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Sim != nil { + data.Set("Sim", *params.Sim) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.Direction != nil { + data.Set("Direction", *params.Direction) + } + if params != nil && params.Transport != nil { + data.Set("Transport", *params.Transport) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/wireless/v1/rate_plans.go b/rest/wireless/v1/rate_plans.go index 5cb9ec366..30010b4f3 100644 --- a/rest/wireless/v1/rate_plans.go +++ b/rest/wireless/v1/rate_plans.go @@ -100,41 +100,42 @@ func (c *ApiService) CreateRatePlan(params *CreateRatePlanParams) (*WirelessV1Ra data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.DataEnabled != nil { - data.Set("DataEnabled", fmt.Sprint(*params.DataEnabled)) -} -if params != nil && params.DataLimit != nil { - data.Set("DataLimit", fmt.Sprint(*params.DataLimit)) -} -if params != nil && params.DataMetering != nil { - data.Set("DataMetering", *params.DataMetering) -} -if params != nil && params.MessagingEnabled != nil { - data.Set("MessagingEnabled", fmt.Sprint(*params.MessagingEnabled)) -} -if params != nil && params.VoiceEnabled != nil { - data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) -} -if params != nil && params.NationalRoamingEnabled != nil { - data.Set("NationalRoamingEnabled", fmt.Sprint(*params.NationalRoamingEnabled)) -} -if params != nil && params.InternationalRoaming != nil { - for _, item := range *params.InternationalRoaming { - data.Add("InternationalRoaming", item) + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.DataEnabled != nil { + data.Set("DataEnabled", fmt.Sprint(*params.DataEnabled)) + } + if params != nil && params.DataLimit != nil { + data.Set("DataLimit", fmt.Sprint(*params.DataLimit)) + } + if params != nil && params.DataMetering != nil { + data.Set("DataMetering", *params.DataMetering) + } + if params != nil && params.MessagingEnabled != nil { + data.Set("MessagingEnabled", fmt.Sprint(*params.MessagingEnabled)) + } + if params != nil && params.VoiceEnabled != nil { + data.Set("VoiceEnabled", fmt.Sprint(*params.VoiceEnabled)) + } + if params != nil && params.NationalRoamingEnabled != nil { + data.Set("NationalRoamingEnabled", fmt.Sprint(*params.NationalRoamingEnabled)) + } + if params != nil && params.InternationalRoaming != nil { + for _, item := range *params.InternationalRoaming { + data.Add("InternationalRoaming", item) + } + } + if params != nil && params.NationalRoamingDataLimit != nil { + data.Set("NationalRoamingDataLimit", fmt.Sprint(*params.NationalRoamingDataLimit)) + } + if params != nil && params.InternationalRoamingDataLimit != nil { + data.Set("InternationalRoamingDataLimit", fmt.Sprint(*params.InternationalRoamingDataLimit)) } -} -if params != nil && params.NationalRoamingDataLimit != nil { - data.Set("NationalRoamingDataLimit", fmt.Sprint(*params.NationalRoamingDataLimit)) -} -if params != nil && params.InternationalRoamingDataLimit != nil { - data.Set("InternationalRoamingDataLimit", fmt.Sprint(*params.InternationalRoamingDataLimit)) -} @@ -163,6 +164,7 @@ func (c *ApiService) DeleteRatePlan(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -183,6 +185,7 @@ func (c *ApiService) FetchRatePlan(Sid string, ) (*WirelessV1RatePlan, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -222,9 +225,10 @@ func (c *ApiService) PageRatePlan(params *ListRatePlanParams, pageToken, pageNum data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -360,12 +364,13 @@ func (c *ApiService) UpdateRatePlan(Sid string, params *UpdateRatePlanParams) (* data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } diff --git a/rest/wireless/v1/sims.go b/rest/wireless/v1/sims.go index ab43fd609..1a7fbcad3 100644 --- a/rest/wireless/v1/sims.go +++ b/rest/wireless/v1/sims.go @@ -33,6 +33,7 @@ func (c *ApiService) DeleteSim(Sid string, ) (error) { + resp, err := c.requestHandler.Delete(c.baseURL+path, data, headers) if err != nil { return err @@ -53,6 +54,7 @@ func (c *ApiService) FetchSim(Sid string, ) (*WirelessV1Sim, error) { + resp, err := c.requestHandler.Get(c.baseURL+path, data, headers) if err != nil { return nil, err @@ -122,24 +124,25 @@ func (c *ApiService) PageSim(params *ListSimParams, pageToken, pageNumber string data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.Iccid != nil { - data.Set("Iccid", *params.Iccid) -} -if params != nil && params.RatePlan != nil { - data.Set("RatePlan", *params.RatePlan) -} -if params != nil && params.EId != nil { - data.Set("EId", *params.EId) -} -if params != nil && params.SimRegistrationCode != nil { - data.Set("SimRegistrationCode", *params.SimRegistrationCode) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.Iccid != nil { + data.Set("Iccid", *params.Iccid) + } + if params != nil && params.RatePlan != nil { + data.Set("RatePlan", *params.RatePlan) + } + if params != nil && params.EId != nil { + data.Set("EId", *params.EId) + } + if params != nil && params.SimRegistrationCode != nil { + data.Set("SimRegistrationCode", *params.SimRegistrationCode) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) @@ -371,60 +374,61 @@ func (c *ApiService) UpdateSim(Sid string, params *UpdateSimParams) (*WirelessV1 data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.UniqueName != nil { - data.Set("UniqueName", *params.UniqueName) -} -if params != nil && params.CallbackMethod != nil { - data.Set("CallbackMethod", *params.CallbackMethod) -} -if params != nil && params.CallbackUrl != nil { - data.Set("CallbackUrl", *params.CallbackUrl) -} -if params != nil && params.FriendlyName != nil { - data.Set("FriendlyName", *params.FriendlyName) -} -if params != nil && params.RatePlan != nil { - data.Set("RatePlan", *params.RatePlan) -} -if params != nil && params.Status != nil { - data.Set("Status", *params.Status) -} -if params != nil && params.CommandsCallbackMethod != nil { - data.Set("CommandsCallbackMethod", *params.CommandsCallbackMethod) -} -if params != nil && params.CommandsCallbackUrl != nil { - data.Set("CommandsCallbackUrl", *params.CommandsCallbackUrl) -} -if params != nil && params.SmsFallbackMethod != nil { - data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) -} -if params != nil && params.SmsFallbackUrl != nil { - data.Set("SmsFallbackUrl", *params.SmsFallbackUrl) -} -if params != nil && params.SmsMethod != nil { - data.Set("SmsMethod", *params.SmsMethod) -} -if params != nil && params.SmsUrl != nil { - data.Set("SmsUrl", *params.SmsUrl) -} -if params != nil && params.VoiceFallbackMethod != nil { - data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) -} -if params != nil && params.VoiceFallbackUrl != nil { - data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) -} -if params != nil && params.VoiceMethod != nil { - data.Set("VoiceMethod", *params.VoiceMethod) -} -if params != nil && params.VoiceUrl != nil { - data.Set("VoiceUrl", *params.VoiceUrl) -} -if params != nil && params.ResetStatus != nil { - data.Set("ResetStatus", *params.ResetStatus) -} -if params != nil && params.AccountSid != nil { - data.Set("AccountSid", *params.AccountSid) -} + + if params != nil && params.UniqueName != nil { + data.Set("UniqueName", *params.UniqueName) + } + if params != nil && params.CallbackMethod != nil { + data.Set("CallbackMethod", *params.CallbackMethod) + } + if params != nil && params.CallbackUrl != nil { + data.Set("CallbackUrl", *params.CallbackUrl) + } + if params != nil && params.FriendlyName != nil { + data.Set("FriendlyName", *params.FriendlyName) + } + if params != nil && params.RatePlan != nil { + data.Set("RatePlan", *params.RatePlan) + } + if params != nil && params.Status != nil { + data.Set("Status", *params.Status) + } + if params != nil && params.CommandsCallbackMethod != nil { + data.Set("CommandsCallbackMethod", *params.CommandsCallbackMethod) + } + if params != nil && params.CommandsCallbackUrl != nil { + data.Set("CommandsCallbackUrl", *params.CommandsCallbackUrl) + } + if params != nil && params.SmsFallbackMethod != nil { + data.Set("SmsFallbackMethod", *params.SmsFallbackMethod) + } + if params != nil && params.SmsFallbackUrl != nil { + data.Set("SmsFallbackUrl", *params.SmsFallbackUrl) + } + if params != nil && params.SmsMethod != nil { + data.Set("SmsMethod", *params.SmsMethod) + } + if params != nil && params.SmsUrl != nil { + data.Set("SmsUrl", *params.SmsUrl) + } + if params != nil && params.VoiceFallbackMethod != nil { + data.Set("VoiceFallbackMethod", *params.VoiceFallbackMethod) + } + if params != nil && params.VoiceFallbackUrl != nil { + data.Set("VoiceFallbackUrl", *params.VoiceFallbackUrl) + } + if params != nil && params.VoiceMethod != nil { + data.Set("VoiceMethod", *params.VoiceMethod) + } + if params != nil && params.VoiceUrl != nil { + data.Set("VoiceUrl", *params.VoiceUrl) + } + if params != nil && params.ResetStatus != nil { + data.Set("ResetStatus", *params.ResetStatus) + } + if params != nil && params.AccountSid != nil { + data.Set("AccountSid", *params.AccountSid) + } diff --git a/rest/wireless/v1/sims_data_sessions.go b/rest/wireless/v1/sims_data_sessions.go index 8ceb708ee..03f723f44 100644 --- a/rest/wireless/v1/sims_data_sessions.go +++ b/rest/wireless/v1/sims_data_sessions.go @@ -48,9 +48,10 @@ func (c *ApiService) PageDataSession(SimSid string, params *ListDataSessionParam data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/wireless/v1/sims_usage_records.go b/rest/wireless/v1/sims_usage_records.go index bc42107f4..afaea6ede 100644 --- a/rest/wireless/v1/sims_usage_records.go +++ b/rest/wireless/v1/sims_usage_records.go @@ -66,18 +66,19 @@ func (c *ApiService) PageUsageRecord(SimSid string, params *ListUsageRecordParam data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.End != nil { - data.Set("End", fmt.Sprint((*params.End).Format(time.RFC3339))) -} -if params != nil && params.Start != nil { - data.Set("Start", fmt.Sprint((*params.Start).Format(time.RFC3339))) -} -if params != nil && params.Granularity != nil { - data.Set("Granularity", *params.Granularity) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.End != nil { + data.Set("End", fmt.Sprint((*params.End).Format(time.RFC3339))) + } + if params != nil && params.Start != nil { + data.Set("Start", fmt.Sprint((*params.Start).Format(time.RFC3339))) + } + if params != nil && params.Granularity != nil { + data.Set("Granularity", *params.Granularity) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken) diff --git a/rest/wireless/v1/usage_records.go b/rest/wireless/v1/usage_records.go index bc4be384a..12757a489 100644 --- a/rest/wireless/v1/usage_records.go +++ b/rest/wireless/v1/usage_records.go @@ -65,18 +65,19 @@ func (c *ApiService) PageAccountUsageRecord(params *ListAccountUsageRecordParams data := url.Values{} headers := make(map[string]interface{}) -if params != nil && params.End != nil { - data.Set("End", fmt.Sprint((*params.End).Format(time.RFC3339))) -} -if params != nil && params.Start != nil { - data.Set("Start", fmt.Sprint((*params.Start).Format(time.RFC3339))) -} -if params != nil && params.Granularity != nil { - data.Set("Granularity", *params.Granularity) -} -if params != nil && params.PageSize != nil { - data.Set("PageSize", fmt.Sprint(*params.PageSize)) -} + + if params != nil && params.End != nil { + data.Set("End", fmt.Sprint((*params.End).Format(time.RFC3339))) + } + if params != nil && params.Start != nil { + data.Set("Start", fmt.Sprint((*params.Start).Format(time.RFC3339))) + } + if params != nil && params.Granularity != nil { + data.Set("Granularity", *params.Granularity) + } + if params != nil && params.PageSize != nil { + data.Set("PageSize", fmt.Sprint(*params.PageSize)) + } if pageToken != "" { data.Set("PageToken", pageToken)