rcs 1.0.18 → 2.0.0.pre.rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/environment.rb +1 -1
- data/lib/rcs/brands/client.rb +631 -0
- data/lib/rcs/brands/types/autofill_brand_schema_options.rb +61 -0
- data/lib/rcs/brands/types/brand_contact.rb +84 -0
- data/lib/rcs/campaigns/client.rb +44 -0
- data/lib/rcs/campaigns/dlc/client.rb +480 -0
- data/lib/rcs/campaigns/dlc/types/upsert_dlc_schema_keywords.rb +99 -0
- data/lib/rcs/campaigns/dlc/types/upsert_dlc_schema_keywords_help.rb +74 -0
- data/lib/rcs/campaigns/dlc/types/upsert_dlc_schema_keywords_opt_in.rb +74 -0
- data/lib/rcs/campaigns/dlc/types/upsert_dlc_schema_keywords_opt_out.rb +74 -0
- data/lib/rcs/campaigns/dlc/types/upsert_dlc_schema_links.rb +74 -0
- data/lib/rcs/campaigns/dlc/types/upsert_dlc_schema_options.rb +110 -0
- data/lib/rcs/campaigns/dlc/types/upsert_dlc_schema_use_case.rb +76 -0
- data/lib/rcs/campaigns/rcs/client.rb +457 -0
- data/lib/rcs/campaigns/rcs/types/rcs_autofill_response.rb +155 -0
- data/lib/rcs/campaigns/rcs/types/upsert_rcs_schema_agent.rb +140 -0
- data/lib/rcs/campaigns/rcs/types/upsert_rcs_schema_agent_emails_item.rb +73 -0
- data/lib/rcs/campaigns/rcs/types/upsert_rcs_schema_agent_phones_item.rb +73 -0
- data/lib/rcs/campaigns/rcs/types/upsert_rcs_schema_agent_websites_item.rb +73 -0
- data/lib/rcs/campaigns/rcs/types/upsert_rcs_schema_links.rb +74 -0
- data/lib/rcs/campaigns/rcs/types/upsert_rcs_schema_opt_in.rb +75 -0
- data/lib/rcs/campaigns/rcs/types/upsert_rcs_schema_opt_out.rb +76 -0
- data/lib/rcs/campaigns/rcs/types/upsert_rcs_schema_use_case.rb +75 -0
- data/lib/rcs/campaigns/toll_free/client.rb +429 -0
- data/lib/rcs/campaigns/toll_free/types/toll_free_autofill_response.rb +130 -0
- data/lib/rcs/campaigns/toll_free/types/upsert_toll_free_schema_opt_in.rb +86 -0
- data/lib/rcs/campaigns/toll_free/types/upsert_toll_free_schema_use_case.rb +75 -0
- data/lib/rcs/contacts/client.rb +275 -0
- data/lib/rcs/conversations/client.rb +273 -0
- data/lib/rcs/message/client.rb +30 -0
- data/lib/rcs/message/sms/client.rb +96 -0
- data/lib/rcs/messages/client.rb +192 -0
- data/lib/rcs/messages/mms/client.rb +98 -0
- data/lib/rcs/messages/rcs/client.rb +94 -0
- data/lib/rcs/messages/send/client.rb +318 -0
- data/lib/rcs/messages/send/types/send_mms_response.rb +60 -0
- data/lib/rcs/messages/send/types/send_mms_schema_options.rb +108 -0
- data/lib/rcs/messages/send/types/send_rcs_response.rb +60 -0
- data/lib/rcs/messages/send/types/send_sms_response.rb +60 -0
- data/lib/rcs/messages/send/types/send_sms_schema_options.rb +81 -0
- data/lib/rcs/messages/types/message_reaction_schema_options.rb +71 -0
- data/lib/rcs/phone_numbers/campaign/client.rb +179 -0
- data/lib/rcs/phone_numbers/client.rb +359 -0
- data/lib/rcs/phone_numbers/types/phone_details_schema_level.rb +16 -0
- data/lib/rcs/phone_numbers/types/phone_details_schema_options.rb +93 -0
- data/lib/rcs/phone_numbers/types/phone_details_schema_options_enhanced_contact_info.rb +64 -0
- data/lib/rcs/phone_numbers/types/phone_numbers_get_response.rb +58 -0
- data/lib/rcs/phone_numbers/types/search_schema_location.rb +96 -0
- data/lib/rcs/phone_numbers/types/search_schema_number.rb +81 -0
- data/lib/rcs/phone_numbers/types/search_schema_options.rb +62 -0
- data/lib/rcs/phone_numbers/webhook/client.rb +191 -0
- data/lib/rcs/status/client.rb +30 -0
- data/lib/rcs/status/get/client.rb +367 -0
- data/lib/rcs/tools/client.rb +32 -199
- data/lib/rcs/tools/contact_card/client.rb +285 -0
- data/lib/rcs/tools/contact_card/types/get_v_card_schema_options.rb +67 -0
- data/lib/rcs/tools/file/client.rb +138 -0
- data/lib/rcs/tools/file/types/file_upload_schema_options.rb +70 -0
- data/lib/rcs/tools/file/types/file_upload_schema_options_download.rb +66 -0
- data/lib/rcs/tools/url/client.rb +245 -0
- data/lib/rcs/types/advanced_phone_information.rb +147 -0
- data/lib/rcs/types/advanced_phone_information_carrier.rb +90 -0
- data/lib/rcs/types/advanced_phone_information_contact.rb +146 -0
- data/lib/rcs/types/advanced_phone_information_location.rb +142 -0
- data/lib/rcs/types/advanced_phone_information_location_coordinates.rb +73 -0
- data/lib/rcs/types/advanced_phone_information_location_country.rb +77 -0
- data/lib/rcs/types/advanced_phone_information_type.rb +97 -0
- data/lib/rcs/types/advanced_phone_information_type_recommendation.rb +15 -0
- data/lib/rcs/types/agent.rb +68 -0
- data/lib/rcs/types/attach_webhook_params.rb +60 -0
- data/lib/rcs/types/attach_webhook_response_webhook.rb +86 -0
- data/lib/rcs/types/attach_webhook_schema_name.rb +88 -0
- data/lib/rcs/types/attach_webhook_schema_webhook_id.rb +77 -0
- data/lib/rcs/types/attached_phone_number_result.rb +75 -0
- data/lib/rcs/types/autofill_campaign_params.rb +69 -0
- data/lib/rcs/types/autofill_dlc_campaign_response.rb +169 -0
- data/lib/rcs/types/autofill_dlc_response_keywords.rb +95 -0
- data/lib/rcs/types/autofill_dlc_response_keywords_help.rb +70 -0
- data/lib/rcs/{send/types/send_sms_response.rb → types/autofill_dlc_response_keywords_opt_in.rb} +18 -17
- data/lib/rcs/types/autofill_dlc_response_keywords_opt_out.rb +70 -0
- data/lib/rcs/types/autofill_dlc_response_links.rb +70 -0
- data/lib/rcs/types/autofill_dlc_response_options.rb +106 -0
- data/lib/rcs/types/autofill_dlc_response_use_case.rb +72 -0
- data/lib/rcs/types/bad_request_error_body.rb +44 -45
- data/lib/rcs/types/basic_phone_information.rb +127 -0
- data/lib/rcs/{company/types/company_register_response_brand.rb → types/basic_phone_information_contact.rb} +12 -21
- data/lib/rcs/types/basic_phone_information_location.rb +74 -0
- data/lib/rcs/types/basic_phone_information_location_country.rb +75 -0
- data/lib/rcs/types/brand_status.rb +92 -0
- data/lib/rcs/types/brand_status_enum.rb +21 -0
- data/lib/rcs/types/buy_response_capabilities.rb +77 -0
- data/lib/rcs/types/campaign_enum.rb +15 -0
- data/lib/rcs/types/campaign_query.rb +69 -0
- data/lib/rcs/{company/types/company_register_request_company_id.rb → types/campaign_submission_result.rb} +15 -16
- data/lib/rcs/types/campaign_validation_response_errors_item.rb +76 -0
- data/lib/rcs/types/campaign_validation_result.rb +71 -0
- data/lib/rcs/types/click_action.rb +73 -0
- data/lib/rcs/types/click_action_data.rb +56 -0
- data/lib/rcs/types/click_action_data_metadata.rb +69 -0
- data/lib/rcs/types/company_sector_enum.rb +26 -0
- data/lib/rcs/types/company_type_enum.rb +14 -0
- data/lib/rcs/types/configured_webhook.rb +85 -0
- data/lib/rcs/types/contact.rb +105 -0
- data/lib/rcs/types/contact_id.rb +57 -0
- data/lib/rcs/types/conversation.rb +146 -0
- data/lib/rcs/types/conversation_contact.rb +68 -0
- data/lib/rcs/types/conversation_list.rb +79 -0
- data/lib/rcs/types/conversation_sender.rb +60 -0
- data/lib/rcs/types/create_url_options.rb +61 -0
- data/lib/rcs/types/detached_phone_number_result.rb +75 -0
- data/lib/rcs/types/detached_webhook_info.rb +74 -0
- data/lib/rcs/types/detailed_phone_number_enum.rb +25 -0
- data/lib/rcs/types/dlc_assignment_status_enum.rb +19 -0
- data/lib/rcs/types/dlc_campaign_status.rb +107 -0
- data/lib/rcs/types/dlc_campaign_use_case_enum.rb +35 -0
- data/lib/rcs/types/dlc_campaign_with_extended_brand_and_status.rb +194 -0
- data/lib/rcs/types/dlc_with_extended_brand_and_status_keywords.rb +94 -0
- data/lib/rcs/types/dlc_with_extended_brand_and_status_keywords_help.rb +72 -0
- data/lib/rcs/{send/types/send_mms_response.rb → types/dlc_with_extended_brand_and_status_keywords_opt_in.rb} +20 -17
- data/lib/rcs/{send/types/send_rcs_response.rb → types/dlc_with_extended_brand_and_status_keywords_opt_out.rb} +20 -17
- data/lib/rcs/types/dlc_with_extended_brand_and_status_links.rb +70 -0
- data/lib/rcs/types/dlc_with_extended_brand_and_status_options.rb +106 -0
- data/lib/rcs/types/dlc_with_extended_brand_and_status_use_case.rb +72 -0
- data/lib/rcs/types/enhanced_contact.rb +9 -0
- data/lib/rcs/types/enhanced_contact_item.rb +104 -0
- data/lib/rcs/types/error.rb +61 -0
- data/lib/rcs/types/extended_brand.rb +194 -0
- data/lib/rcs/types/extended_brand_with_vetting.rb +226 -0
- data/lib/rcs/types/extended_rcs_campaign.rb +173 -0
- data/lib/rcs/{company/types/company_register_request.rb → types/get_conversation_params.rb} +13 -12
- data/lib/rcs/types/get_conversation_request_id.rb +58 -0
- data/lib/rcs/types/get_conversation_request_recipient.rb +72 -0
- data/lib/rcs/types/get_dlc_campaign_status_response_updates.rb +96 -0
- data/lib/rcs/types/get_toll_free_campaign_status_response_updates.rb +92 -0
- data/lib/rcs/types/inbound_button.rb +56 -0
- data/lib/rcs/types/link_click_event.rb +465 -0
- data/lib/rcs/{company/types/company_update_response.rb → types/location_share_action.rb} +19 -19
- data/lib/rcs/types/location_share_action_data.rb +89 -0
- data/lib/rcs/types/message.rb +174 -0
- data/lib/rcs/types/message_content.rb +85 -0
- data/lib/rcs/types/message_method_enum.rb +12 -0
- data/lib/rcs/types/message_protocol_enum.rb +12 -0
- data/lib/rcs/types/message_schedule.rb +94 -0
- data/lib/rcs/types/message_status_enum.rb +16 -0
- data/lib/rcs/types/message_volume_enum.rb +20 -0
- data/lib/rcs/types/messaging_profile_enum.rb +11 -0
- data/lib/rcs/types/mms_content.rb +74 -0
- data/lib/rcs/types/mms_validation_response_segments.rb +85 -0
- data/lib/rcs/types/mms_validation_response_segments_value_item.rb +75 -0
- data/lib/rcs/types/mms_validation_result.rb +82 -0
- data/lib/rcs/types/nullable_contact.rb +84 -0
- data/lib/rcs/types/number_format.rb +79 -0
- data/lib/rcs/types/opt_in_method_enum.rb +13 -0
- data/lib/rcs/types/optional_brand_info.rb +145 -0
- data/lib/rcs/types/optional_contact.rb +83 -0
- data/lib/rcs/types/optional_contacts.rb +84 -0
- data/lib/rcs/types/phone.rb +101 -0
- data/lib/rcs/types/phone_capabilities.rb +75 -0
- data/lib/rcs/types/phone_enum.rb +13 -0
- data/lib/rcs/types/phone_feature_enum.rb +18 -0
- data/lib/rcs/types/phone_number_campaign_attach_failed_item.rb +67 -0
- data/lib/rcs/types/phone_number_campaign_attach_phone_numbers_item.rb +75 -0
- data/lib/rcs/types/phone_number_campaign_attach_phone_numbers_item_campaign.rb +78 -0
- data/lib/rcs/types/phone_number_campaign_detach_failed_item.rb +67 -0
- data/lib/rcs/types/phone_number_campaign_detach_phone_numbers_item.rb +75 -0
- data/lib/rcs/types/phone_number_campaign_detach_phone_numbers_item_campaign.rb +78 -0
- data/lib/rcs/types/phone_number_cost.rb +75 -0
- data/lib/rcs/types/phone_number_details.rb +110 -0
- data/lib/rcs/types/phone_number_enum.rb +18 -0
- data/lib/rcs/types/phone_number_region.rb +91 -0
- data/lib/rcs/types/phone_number_status.rb +90 -0
- data/lib/rcs/types/phone_number_status_enum.rb +16 -0
- data/lib/rcs/types/pinnacle_file_upload_metadata.rb +84 -0
- data/lib/rcs/types/pinnacle_url_config.rb +71 -0
- data/lib/rcs/types/profile_status_enum.rb +17 -0
- data/lib/rcs/types/purchased_number.rb +75 -0
- data/lib/rcs/types/rcs.rb +70 -0
- data/lib/rcs/types/rcs_base.rb +82 -0
- data/lib/rcs/types/rcs_base_options.rb +100 -0
- data/lib/rcs/types/rcs_button_call.rb +68 -0
- data/lib/rcs/types/rcs_button_content.rb +148 -0
- data/lib/rcs/types/rcs_button_open_url.rb +68 -0
- data/lib/rcs/types/rcs_button_request_user_location.rb +58 -0
- data/lib/rcs/types/rcs_button_schedule_event.rb +98 -0
- data/lib/rcs/types/rcs_button_send_location.rb +74 -0
- data/lib/rcs/types/rcs_button_send_location_lat_long.rb +68 -0
- data/lib/rcs/types/rcs_button_trigger.rb +78 -0
- data/lib/rcs/types/rcs_campaign.rb +143 -0
- data/lib/rcs/types/rcs_campaign_opt_in_method_enum.rb +15 -0
- data/lib/rcs/types/rcs_campaign_schema_agent.rb +134 -0
- data/lib/rcs/types/rcs_campaign_schema_agent_emails_item.rb +69 -0
- data/lib/rcs/types/rcs_campaign_schema_agent_phones_item.rb +69 -0
- data/lib/rcs/types/rcs_campaign_schema_agent_websites_item.rb +69 -0
- data/lib/rcs/types/rcs_campaign_schema_extra_agent.rb +134 -0
- data/lib/rcs/types/rcs_campaign_schema_extra_agent_emails_item.rb +70 -0
- data/lib/rcs/types/rcs_campaign_schema_extra_agent_phones_item.rb +70 -0
- data/lib/rcs/types/rcs_campaign_schema_extra_agent_websites_item.rb +71 -0
- data/lib/rcs/types/rcs_campaign_schema_extra_links.rb +70 -0
- data/lib/rcs/types/rcs_campaign_schema_extra_opt_in.rb +71 -0
- data/lib/rcs/types/rcs_campaign_schema_extra_opt_out.rb +70 -0
- data/lib/rcs/types/rcs_campaign_schema_extra_use_case.rb +71 -0
- data/lib/rcs/types/rcs_campaign_schema_links.rb +70 -0
- data/lib/rcs/types/rcs_campaign_schema_opt_in.rb +71 -0
- data/lib/rcs/types/rcs_campaign_schema_opt_out.rb +70 -0
- data/lib/rcs/types/rcs_campaign_schema_use_case.rb +71 -0
- data/lib/rcs/types/rcs_campaign_status.rb +86 -0
- data/lib/rcs/types/rcs_campaign_use_case_enum.rb +23 -0
- data/lib/rcs/types/rcs_card.rb +110 -0
- data/lib/rcs/types/rcs_cards.rb +79 -0
- data/lib/rcs/types/rcs_cards_cards_item.rb +88 -0
- data/lib/rcs/types/rcs_cards_content.rb +79 -0
- data/lib/rcs/types/rcs_cards_content_cards_item.rb +94 -0
- data/lib/rcs/types/rcs_content.rb +72 -0
- data/lib/rcs/types/rcs_media.rb +110 -0
- data/lib/rcs/types/rcs_media_content.rb +81 -0
- data/lib/rcs/types/rcs_media_details_content.rb +77 -0
- data/lib/rcs/types/rcs_text.rb +106 -0
- data/lib/rcs/types/rcs_text_content.rb +72 -0
- data/lib/rcs/types/rcs_validate_content.rb +70 -0
- data/lib/rcs/{company/types/company_register_response.rb → types/rcs_validate_content_media.rb} +19 -21
- data/lib/rcs/types/rcs_validation_result.rb +76 -0
- data/lib/rcs/types/reaction_result.rb +67 -0
- data/lib/rcs/types/scheduled_messaage.rb +73 -0
- data/lib/rcs/types/scheduled_send_response_config.rb +89 -0
- data/lib/rcs/types/send_sms_response_segments.rb +69 -0
- data/lib/rcs/types/send_sms_response_segments_encoding.rb +11 -0
- data/lib/rcs/types/sent_mms_details.rb +102 -0
- data/lib/rcs/types/sent_rcs_details.rb +105 -0
- data/lib/rcs/types/sent_sms_details.rb +108 -0
- data/lib/rcs/types/shortened_url.rb +77 -0
- data/lib/rcs/types/shortened_url_with_click_data.rb +90 -0
- data/lib/rcs/types/sms_content.rb +58 -0
- data/lib/rcs/types/sms_validation_response_segments.rb +80 -0
- data/lib/rcs/types/sms_validation_response_segments_gsm_7.rb +75 -0
- data/lib/rcs/types/sms_validation_response_segments_utf_16.rb +68 -0
- data/lib/rcs/types/sms_validation_response_total.rb +75 -0
- data/lib/rcs/types/sms_validation_result.rb +102 -0
- data/lib/rcs/types/sub_use_case_enum.rb +19 -0
- data/lib/rcs/types/submission_results.rb +57 -0
- data/lib/rcs/types/successful_conversation_update.rb +58 -0
- data/lib/rcs/types/toll_free_campaign.rb +118 -0
- data/lib/rcs/types/toll_free_campaign_schema_opt_in.rb +78 -0
- data/lib/rcs/types/toll_free_campaign_schema_use_case.rb +71 -0
- data/lib/rcs/types/toll_free_campaign_status.rb +91 -0
- data/lib/rcs/types/toll_free_campaign_use_case_enum.rb +52 -0
- data/lib/rcs/types/toll_free_campaign_with_extended_brand_and_status.rb +155 -0
- data/lib/rcs/types/toll_free_status_enum.rb +20 -0
- data/lib/rcs/types/tracking.rb +17 -0
- data/lib/rcs/types/updated_contact_id.rb +57 -0
- data/lib/rcs/types/upload_results.rb +80 -0
- data/lib/rcs/types/v_card_address_schema_type_item.rb +15 -0
- data/lib/rcs/types/v_card_data.rb +237 -0
- data/lib/rcs/types/v_card_data_file.rb +74 -0
- data/lib/rcs/types/v_card_data_file_metadata.rb +62 -0
- data/lib/rcs/types/v_card_email_schema_type_item.rb +21 -0
- data/lib/rcs/types/v_card_geo.rb +70 -0
- data/lib/rcs/types/v_card_name.rb +98 -0
- data/lib/rcs/types/v_card_organization.rb +70 -0
- data/lib/rcs/types/v_card_phone_schema_type_item.rb +21 -0
- data/lib/rcs/types/validate_campaign_params.rb +69 -0
- data/lib/rcs/types/validation_error_details.rb +76 -0
- data/lib/rcs/types/validation_results.rb +71 -0
- data/lib/rcs/types/vcard.rb +215 -0
- data/lib/rcs/types/vcard_address.rb +130 -0
- data/lib/rcs/types/vcard_content.rb +223 -0
- data/lib/rcs/types/vcard_email.rb +70 -0
- data/lib/rcs/types/vcard_phone.rb +70 -0
- data/lib/rcs/types/vcard_resource.rb +71 -0
- data/lib/rcs/types/vetting_feedback.rb +81 -0
- data/lib/rcs/types/vetting_history.rb +98 -0
- data/lib/rcs/types/vetting_history_vetting_status.rb +13 -0
- data/lib/rcs/types/vetting_results.rb +57 -0
- data/lib/rcs/types/webhook_event_enum.rb +13 -0
- data/lib/rcs/types/webhook_result.rb +64 -0
- data/lib/rcs/{company/types/company_update_response_brand.rb → types/webhooks.rb} +25 -17
- data/lib/rcs/types/zod_error.rb +73 -0
- data/lib/rcs/webhooks/client.rb +93 -0
- data/lib/rcs.rb +67 -83
- data/lib/requests.rb +4 -4
- data/lib/types_export.rb +252 -46
- metadata +278 -52
- data/lib/rcs/company/client.rb +0 -375
- data/lib/rcs/company/types/company_register_request_company.rb +0 -128
- data/lib/rcs/send/client.rb +0 -382
- data/lib/rcs/send/types/rcs_fallback.rb +0 -84
- data/lib/rcs/tools/types/tools_shorten_url_response.rb +0 -70
- data/lib/rcs/tools/types/tools_upload_url_response.rb +0 -69
- data/lib/rcs/types/action.rb +0 -154
- data/lib/rcs/types/action_lat_long.rb +0 -68
- data/lib/rcs/types/action_type.rb +0 -16
- data/lib/rcs/types/additional_email.rb +0 -65
- data/lib/rcs/types/additional_phone_number.rb +0 -65
- data/lib/rcs/types/additional_website.rb +0 -65
- data/lib/rcs/types/card.rb +0 -90
- data/lib/rcs/types/company.rb +0 -319
- data/lib/rcs/types/company_additional_emails_item.rb +0 -67
- data/lib/rcs/types/company_additional_phone_numbers_item.rb +0 -67
- data/lib/rcs/types/company_additional_websites_item.rb +0 -67
- data/lib/rcs/types/company_category.rb +0 -20
- data/lib/rcs/types/company_contact.rb +0 -117
- data/lib/rcs/types/company_details.rb +0 -120
- data/lib/rcs/types/forbidden_error_body.rb +0 -57
- data/lib/rcs/types/inbound_action_message.rb +0 -117
- data/lib/rcs/types/inbound_location_message.rb +0 -106
- data/lib/rcs/types/inbound_location_message_coordinates.rb +0 -65
- data/lib/rcs/types/inbound_media_message.rb +0 -112
- data/lib/rcs/types/inbound_message.rb +0 -88
- data/lib/rcs/types/inbound_message_message_type.rb +0 -10
- data/lib/rcs/types/inbound_message_metadata.rb +0 -79
- data/lib/rcs/types/inbound_text_message.rb +0 -100
- data/lib/rcs/types/internal_server_error_body.rb +0 -57
- data/lib/rcs/types/media_payload.rb +0 -65
- data/lib/rcs/types/message_metadata.rb +0 -56
- data/lib/rcs/types/messaging.rb +0 -95
- data/lib/rcs/types/optionals.rb +0 -99
- data/lib/rcs/types/payment_required_error_body.rb +0 -57
- data/lib/rcs/types/point_of_contact.rb +0 -72
- data/lib/rcs/types/rcs_functionalities.rb +0 -117
- data/lib/rcs/types/sender_metadata.rb +0 -74
- data/lib/rcs/types/unauthorized_error_body.rb +0 -57
@@ -0,0 +1,93 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "phone_details_schema_options_enhanced_contact_info"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module Pinnacle
|
8
|
+
module PhoneNumbers
|
9
|
+
module Types
|
10
|
+
# Customize your lookup with additional options.
|
11
|
+
class PhoneDetailsSchemaOptions
|
12
|
+
# @return [Boolean] Allows you to force a fresh lookup from primary sources instead of cached data.
|
13
|
+
# <br>
|
14
|
+
# Fresh lookups will take longer to complete than cached lookups.
|
15
|
+
attr_reader :force
|
16
|
+
# @return [Boolean] Include a fraud risk and security analysis.
|
17
|
+
attr_reader :risk
|
18
|
+
# @return [Pinnacle::PhoneNumbers::Types::PhoneDetailsSchemaOptionsEnhancedContactInfo] Additional information to tailor lookup.
|
19
|
+
attr_reader :enhanced_contact_info
|
20
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
21
|
+
attr_reader :additional_properties
|
22
|
+
# @return [Object]
|
23
|
+
attr_reader :_field_set
|
24
|
+
protected :_field_set
|
25
|
+
|
26
|
+
OMIT = Object.new
|
27
|
+
|
28
|
+
# @param force [Boolean] Allows you to force a fresh lookup from primary sources instead of cached data.
|
29
|
+
# <br>
|
30
|
+
# Fresh lookups will take longer to complete than cached lookups.
|
31
|
+
# @param risk [Boolean] Include a fraud risk and security analysis.
|
32
|
+
# @param enhanced_contact_info [Pinnacle::PhoneNumbers::Types::PhoneDetailsSchemaOptionsEnhancedContactInfo] Additional information to tailor lookup.
|
33
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
34
|
+
# @return [Pinnacle::PhoneNumbers::Types::PhoneDetailsSchemaOptions]
|
35
|
+
def initialize(force: OMIT, risk: OMIT, enhanced_contact_info: OMIT, additional_properties: nil)
|
36
|
+
@force = force if force != OMIT
|
37
|
+
@risk = risk if risk != OMIT
|
38
|
+
@enhanced_contact_info = enhanced_contact_info if enhanced_contact_info != OMIT
|
39
|
+
@additional_properties = additional_properties
|
40
|
+
@_field_set = {
|
41
|
+
"force": force,
|
42
|
+
"risk": risk,
|
43
|
+
"enhanced_contact_info": enhanced_contact_info
|
44
|
+
}.reject do |_k, v|
|
45
|
+
v == OMIT
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# Deserialize a JSON object to an instance of PhoneDetailsSchemaOptions
|
50
|
+
#
|
51
|
+
# @param json_object [String]
|
52
|
+
# @return [Pinnacle::PhoneNumbers::Types::PhoneDetailsSchemaOptions]
|
53
|
+
def self.from_json(json_object:)
|
54
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
55
|
+
parsed_json = JSON.parse(json_object)
|
56
|
+
force = parsed_json["force"]
|
57
|
+
risk = parsed_json["risk"]
|
58
|
+
if parsed_json["enhanced_contact_info"].nil?
|
59
|
+
enhanced_contact_info = nil
|
60
|
+
else
|
61
|
+
enhanced_contact_info = parsed_json["enhanced_contact_info"].to_json
|
62
|
+
enhanced_contact_info = Pinnacle::PhoneNumbers::Types::PhoneDetailsSchemaOptionsEnhancedContactInfo.from_json(json_object: enhanced_contact_info)
|
63
|
+
end
|
64
|
+
new(
|
65
|
+
force: force,
|
66
|
+
risk: risk,
|
67
|
+
enhanced_contact_info: enhanced_contact_info,
|
68
|
+
additional_properties: struct
|
69
|
+
)
|
70
|
+
end
|
71
|
+
|
72
|
+
# Serialize an instance of PhoneDetailsSchemaOptions to a JSON object
|
73
|
+
#
|
74
|
+
# @return [String]
|
75
|
+
def to_json(*_args)
|
76
|
+
@_field_set&.to_json
|
77
|
+
end
|
78
|
+
|
79
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
80
|
+
# hash and check each fields type against the current object's property
|
81
|
+
# definitions.
|
82
|
+
#
|
83
|
+
# @param obj [Object]
|
84
|
+
# @return [Void]
|
85
|
+
def self.validate_raw(obj:)
|
86
|
+
obj.force&.is_a?(Boolean) != false || raise("Passed value for field obj.force is not the expected type, validation failed.")
|
87
|
+
obj.risk&.is_a?(Boolean) != false || raise("Passed value for field obj.risk is not the expected type, validation failed.")
|
88
|
+
obj.enhanced_contact_info.nil? || Pinnacle::PhoneNumbers::Types::PhoneDetailsSchemaOptionsEnhancedContactInfo.validate_raw(obj: obj.enhanced_contact_info)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Pinnacle
|
7
|
+
module PhoneNumbers
|
8
|
+
module Types
|
9
|
+
# Additional information to tailor lookup.
|
10
|
+
class PhoneDetailsSchemaOptionsEnhancedContactInfo
|
11
|
+
# @return [String] Business context.
|
12
|
+
attr_reader :context
|
13
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
14
|
+
attr_reader :additional_properties
|
15
|
+
# @return [Object]
|
16
|
+
attr_reader :_field_set
|
17
|
+
protected :_field_set
|
18
|
+
|
19
|
+
OMIT = Object.new
|
20
|
+
|
21
|
+
# @param context [String] Business context.
|
22
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
23
|
+
# @return [Pinnacle::PhoneNumbers::Types::PhoneDetailsSchemaOptionsEnhancedContactInfo]
|
24
|
+
def initialize(context: OMIT, additional_properties: nil)
|
25
|
+
@context = context if context != OMIT
|
26
|
+
@additional_properties = additional_properties
|
27
|
+
@_field_set = { "context": context }.reject do |_k, v|
|
28
|
+
v == OMIT
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
# Deserialize a JSON object to an instance of
|
33
|
+
# PhoneDetailsSchemaOptionsEnhancedContactInfo
|
34
|
+
#
|
35
|
+
# @param json_object [String]
|
36
|
+
# @return [Pinnacle::PhoneNumbers::Types::PhoneDetailsSchemaOptionsEnhancedContactInfo]
|
37
|
+
def self.from_json(json_object:)
|
38
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
39
|
+
parsed_json = JSON.parse(json_object)
|
40
|
+
context = parsed_json["context"]
|
41
|
+
new(context: context, additional_properties: struct)
|
42
|
+
end
|
43
|
+
|
44
|
+
# Serialize an instance of PhoneDetailsSchemaOptionsEnhancedContactInfo to a JSON
|
45
|
+
# object
|
46
|
+
#
|
47
|
+
# @return [String]
|
48
|
+
def to_json(*_args)
|
49
|
+
@_field_set&.to_json
|
50
|
+
end
|
51
|
+
|
52
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
53
|
+
# hash and check each fields type against the current object's property
|
54
|
+
# definitions.
|
55
|
+
#
|
56
|
+
# @param obj [Object]
|
57
|
+
# @return [Void]
|
58
|
+
def self.validate_raw(obj:)
|
59
|
+
obj.context&.is_a?(String) != false || raise("Passed value for field obj.context is not the expected type, validation failed.")
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
require_relative "../../types/basic_phone_information"
|
5
|
+
require_relative "../../types/advanced_phone_information"
|
6
|
+
|
7
|
+
module Pinnacle
|
8
|
+
module PhoneNumbers
|
9
|
+
module Types
|
10
|
+
class PhoneNumbersGetResponse
|
11
|
+
# Deserialize a JSON object to an instance of PhoneNumbersGetResponse
|
12
|
+
#
|
13
|
+
# @param json_object [String]
|
14
|
+
# @return [Pinnacle::PhoneNumbers::Types::PhoneNumbersGetResponse]
|
15
|
+
def self.from_json(json_object:)
|
16
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
17
|
+
begin
|
18
|
+
Pinnacle::Types::BasicPhoneInformation.validate_raw(obj: struct)
|
19
|
+
return Pinnacle::Types::BasicPhoneInformation.from_json(json_object: struct) unless struct.nil?
|
20
|
+
|
21
|
+
return nil
|
22
|
+
rescue StandardError
|
23
|
+
# noop
|
24
|
+
end
|
25
|
+
begin
|
26
|
+
Pinnacle::Types::AdvancedPhoneInformation.validate_raw(obj: struct)
|
27
|
+
return Pinnacle::Types::AdvancedPhoneInformation.from_json(json_object: struct) unless struct.nil?
|
28
|
+
|
29
|
+
return nil
|
30
|
+
rescue StandardError
|
31
|
+
# noop
|
32
|
+
end
|
33
|
+
struct
|
34
|
+
end
|
35
|
+
|
36
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
37
|
+
# hash and check each fields type against the current object's property
|
38
|
+
# definitions.
|
39
|
+
#
|
40
|
+
# @param obj [Object]
|
41
|
+
# @return [Void]
|
42
|
+
def self.validate_raw(obj:)
|
43
|
+
begin
|
44
|
+
return Pinnacle::Types::BasicPhoneInformation.validate_raw(obj: obj)
|
45
|
+
rescue StandardError
|
46
|
+
# noop
|
47
|
+
end
|
48
|
+
begin
|
49
|
+
return Pinnacle::Types::AdvancedPhoneInformation.validate_raw(obj: obj)
|
50
|
+
rescue StandardError
|
51
|
+
# noop
|
52
|
+
end
|
53
|
+
raise("Passed value matched no type within the union, validation failed.")
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,96 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Pinnacle
|
7
|
+
module PhoneNumbers
|
8
|
+
module Types
|
9
|
+
# Filter your search by geographic location to find numbers in specific regions.
|
10
|
+
# <br>
|
11
|
+
# Toll-free numbers ignore city and state filters.
|
12
|
+
class SearchSchemaLocation
|
13
|
+
# @return [String] Search for numbers in your target city.
|
14
|
+
attr_reader :city
|
15
|
+
# @return [String] Currently, only US numbers are supported.
|
16
|
+
attr_reader :country_code
|
17
|
+
# @return [String] Narrow your search to a specific area or exchange code. <br>
|
18
|
+
# For US numbers, this is usually the 3-digit area code.
|
19
|
+
attr_reader :national_destination_code
|
20
|
+
# @return [String] Search for numbers in your target state or province using a two-letter code.
|
21
|
+
attr_reader :state
|
22
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
23
|
+
attr_reader :additional_properties
|
24
|
+
# @return [Object]
|
25
|
+
attr_reader :_field_set
|
26
|
+
protected :_field_set
|
27
|
+
|
28
|
+
OMIT = Object.new
|
29
|
+
|
30
|
+
# @param city [String] Search for numbers in your target city.
|
31
|
+
# @param country_code [String] Currently, only US numbers are supported.
|
32
|
+
# @param national_destination_code [String] Narrow your search to a specific area or exchange code. <br>
|
33
|
+
# For US numbers, this is usually the 3-digit area code.
|
34
|
+
# @param state [String] Search for numbers in your target state or province using a two-letter code.
|
35
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
36
|
+
# @return [Pinnacle::PhoneNumbers::Types::SearchSchemaLocation]
|
37
|
+
def initialize(city: OMIT, country_code: OMIT, national_destination_code: OMIT, state: OMIT,
|
38
|
+
additional_properties: nil)
|
39
|
+
@city = city if city != OMIT
|
40
|
+
@country_code = country_code if country_code != OMIT
|
41
|
+
@national_destination_code = national_destination_code if national_destination_code != OMIT
|
42
|
+
@state = state if state != OMIT
|
43
|
+
@additional_properties = additional_properties
|
44
|
+
@_field_set = {
|
45
|
+
"city": city,
|
46
|
+
"countryCode": country_code,
|
47
|
+
"nationalDestinationCode": national_destination_code,
|
48
|
+
"state": state
|
49
|
+
}.reject do |_k, v|
|
50
|
+
v == OMIT
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# Deserialize a JSON object to an instance of SearchSchemaLocation
|
55
|
+
#
|
56
|
+
# @param json_object [String]
|
57
|
+
# @return [Pinnacle::PhoneNumbers::Types::SearchSchemaLocation]
|
58
|
+
def self.from_json(json_object:)
|
59
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
60
|
+
parsed_json = JSON.parse(json_object)
|
61
|
+
city = parsed_json["city"]
|
62
|
+
country_code = parsed_json["countryCode"]
|
63
|
+
national_destination_code = parsed_json["nationalDestinationCode"]
|
64
|
+
state = parsed_json["state"]
|
65
|
+
new(
|
66
|
+
city: city,
|
67
|
+
country_code: country_code,
|
68
|
+
national_destination_code: national_destination_code,
|
69
|
+
state: state,
|
70
|
+
additional_properties: struct
|
71
|
+
)
|
72
|
+
end
|
73
|
+
|
74
|
+
# Serialize an instance of SearchSchemaLocation to a JSON object
|
75
|
+
#
|
76
|
+
# @return [String]
|
77
|
+
def to_json(*_args)
|
78
|
+
@_field_set&.to_json
|
79
|
+
end
|
80
|
+
|
81
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
82
|
+
# hash and check each fields type against the current object's property
|
83
|
+
# definitions.
|
84
|
+
#
|
85
|
+
# @param obj [Object]
|
86
|
+
# @return [Void]
|
87
|
+
def self.validate_raw(obj:)
|
88
|
+
obj.city&.is_a?(String) != false || raise("Passed value for field obj.city is not the expected type, validation failed.")
|
89
|
+
obj.country_code&.is_a?(String) != false || raise("Passed value for field obj.country_code is not the expected type, validation failed.")
|
90
|
+
obj.national_destination_code&.is_a?(String) != false || raise("Passed value for field obj.national_destination_code is not the expected type, validation failed.")
|
91
|
+
obj.state&.is_a?(String) != false || raise("Passed value for field obj.state is not the expected type, validation failed.")
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Pinnacle
|
7
|
+
module PhoneNumbers
|
8
|
+
module Types
|
9
|
+
# Filter your search by digit pattern.
|
10
|
+
class SearchSchemaNumber
|
11
|
+
# @return [String] Your search will return only numbers that contain this digit sequence anywhere
|
12
|
+
# within them.
|
13
|
+
attr_reader :contains
|
14
|
+
# @return [String] Your search will return only numbers that end with these digits.
|
15
|
+
attr_reader :ends_with
|
16
|
+
# @return [String] Your search will return only numbers that begin with these digits.
|
17
|
+
attr_reader :starts_with
|
18
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
19
|
+
attr_reader :additional_properties
|
20
|
+
# @return [Object]
|
21
|
+
attr_reader :_field_set
|
22
|
+
protected :_field_set
|
23
|
+
|
24
|
+
OMIT = Object.new
|
25
|
+
|
26
|
+
# @param contains [String] Your search will return only numbers that contain this digit sequence anywhere
|
27
|
+
# within them.
|
28
|
+
# @param ends_with [String] Your search will return only numbers that end with these digits.
|
29
|
+
# @param starts_with [String] Your search will return only numbers that begin with these digits.
|
30
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
31
|
+
# @return [Pinnacle::PhoneNumbers::Types::SearchSchemaNumber]
|
32
|
+
def initialize(contains: OMIT, ends_with: OMIT, starts_with: OMIT, additional_properties: nil)
|
33
|
+
@contains = contains if contains != OMIT
|
34
|
+
@ends_with = ends_with if ends_with != OMIT
|
35
|
+
@starts_with = starts_with if starts_with != OMIT
|
36
|
+
@additional_properties = additional_properties
|
37
|
+
@_field_set = { "contains": contains, "endsWith": ends_with, "startsWith": starts_with }.reject do |_k, v|
|
38
|
+
v == OMIT
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# Deserialize a JSON object to an instance of SearchSchemaNumber
|
43
|
+
#
|
44
|
+
# @param json_object [String]
|
45
|
+
# @return [Pinnacle::PhoneNumbers::Types::SearchSchemaNumber]
|
46
|
+
def self.from_json(json_object:)
|
47
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
48
|
+
parsed_json = JSON.parse(json_object)
|
49
|
+
contains = parsed_json["contains"]
|
50
|
+
ends_with = parsed_json["endsWith"]
|
51
|
+
starts_with = parsed_json["startsWith"]
|
52
|
+
new(
|
53
|
+
contains: contains,
|
54
|
+
ends_with: ends_with,
|
55
|
+
starts_with: starts_with,
|
56
|
+
additional_properties: struct
|
57
|
+
)
|
58
|
+
end
|
59
|
+
|
60
|
+
# Serialize an instance of SearchSchemaNumber to a JSON object
|
61
|
+
#
|
62
|
+
# @return [String]
|
63
|
+
def to_json(*_args)
|
64
|
+
@_field_set&.to_json
|
65
|
+
end
|
66
|
+
|
67
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
68
|
+
# hash and check each fields type against the current object's property
|
69
|
+
# definitions.
|
70
|
+
#
|
71
|
+
# @param obj [Object]
|
72
|
+
# @return [Void]
|
73
|
+
def self.validate_raw(obj:)
|
74
|
+
obj.contains&.is_a?(String) != false || raise("Passed value for field obj.contains is not the expected type, validation failed.")
|
75
|
+
obj.ends_with&.is_a?(String) != false || raise("Passed value for field obj.ends_with is not the expected type, validation failed.")
|
76
|
+
obj.starts_with&.is_a?(String) != false || raise("Passed value for field obj.starts_with is not the expected type, validation failed.")
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Pinnacle
|
7
|
+
module PhoneNumbers
|
8
|
+
module Types
|
9
|
+
# Extra search settings to control how many results you get.
|
10
|
+
class SearchSchemaOptions
|
11
|
+
# @return [Integer] Set the maximum number of phone numbers to return.
|
12
|
+
attr_reader :limit
|
13
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
14
|
+
attr_reader :additional_properties
|
15
|
+
# @return [Object]
|
16
|
+
attr_reader :_field_set
|
17
|
+
protected :_field_set
|
18
|
+
|
19
|
+
OMIT = Object.new
|
20
|
+
|
21
|
+
# @param limit [Integer] Set the maximum number of phone numbers to return.
|
22
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
23
|
+
# @return [Pinnacle::PhoneNumbers::Types::SearchSchemaOptions]
|
24
|
+
def initialize(limit: OMIT, additional_properties: nil)
|
25
|
+
@limit = limit if limit != OMIT
|
26
|
+
@additional_properties = additional_properties
|
27
|
+
@_field_set = { "limit": limit }.reject do |_k, v|
|
28
|
+
v == OMIT
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
# Deserialize a JSON object to an instance of SearchSchemaOptions
|
33
|
+
#
|
34
|
+
# @param json_object [String]
|
35
|
+
# @return [Pinnacle::PhoneNumbers::Types::SearchSchemaOptions]
|
36
|
+
def self.from_json(json_object:)
|
37
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
38
|
+
parsed_json = JSON.parse(json_object)
|
39
|
+
limit = parsed_json["limit"]
|
40
|
+
new(limit: limit, additional_properties: struct)
|
41
|
+
end
|
42
|
+
|
43
|
+
# Serialize an instance of SearchSchemaOptions to a JSON object
|
44
|
+
#
|
45
|
+
# @return [String]
|
46
|
+
def to_json(*_args)
|
47
|
+
@_field_set&.to_json
|
48
|
+
end
|
49
|
+
|
50
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
51
|
+
# hash and check each fields type against the current object's property
|
52
|
+
# definitions.
|
53
|
+
#
|
54
|
+
# @param obj [Object]
|
55
|
+
# @return [Void]
|
56
|
+
def self.validate_raw(obj:)
|
57
|
+
obj.limit&.is_a?(Integer) != false || raise("Passed value for field obj.limit is not the expected type, validation failed.")
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,191 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../../requests"
|
4
|
+
require_relative "../../types/attach_webhook_params"
|
5
|
+
require_relative "../../types/configured_webhook"
|
6
|
+
require_relative "../../types/detached_webhook_info"
|
7
|
+
require "async"
|
8
|
+
|
9
|
+
module Pinnacle
|
10
|
+
module PhoneNumbers
|
11
|
+
class WebhookClient
|
12
|
+
# @return [Pinnacle::RequestClient]
|
13
|
+
attr_reader :request_client
|
14
|
+
|
15
|
+
# @param request_client [Pinnacle::RequestClient]
|
16
|
+
# @return [Pinnacle::PhoneNumbers::WebhookClient]
|
17
|
+
def initialize(request_client:)
|
18
|
+
@request_client = request_client
|
19
|
+
end
|
20
|
+
|
21
|
+
# Connect a webhook to your phone number to receive real-time notifications for
|
22
|
+
# incoming messages, delivery status updates, and other communication events.
|
23
|
+
#
|
24
|
+
# @param phone [String] The phone number you want to attach the webhook to in E.164 format. Make sure it
|
25
|
+
# is url encoded (i.e. replace the leading + with %2B). <br>
|
26
|
+
# Must be a phone number that you own and have already [purchased](./buy) through
|
27
|
+
# the API.
|
28
|
+
# @param request [Pinnacle::Types::AttachWebhookSchemaWebhookId, Pinnacle::Types::AttachWebhookSchemaName]
|
29
|
+
# @param request_options [Pinnacle::RequestOptions]
|
30
|
+
# @return [Pinnacle::Types::ConfiguredWebhook]
|
31
|
+
# @example
|
32
|
+
# api = Pinnacle::Client.new(
|
33
|
+
# base_url: "https://api.example.com",
|
34
|
+
# environment: Pinnacle::Environment::DEFAULT,
|
35
|
+
# api_key: "YOUR_API_KEY"
|
36
|
+
# )
|
37
|
+
# api.phone_numbers.webhook.attach(phone: "%2B14155551234", request: { webhook_id: 1 })
|
38
|
+
def attach(phone:, request:, request_options: nil)
|
39
|
+
response = @request_client.conn.post do |req|
|
40
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
41
|
+
req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
42
|
+
req.headers = {
|
43
|
+
**(req.headers || {}),
|
44
|
+
**@request_client.get_headers,
|
45
|
+
**(request_options&.additional_headers || {})
|
46
|
+
}.compact
|
47
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
48
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
49
|
+
end
|
50
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
51
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/phone-numbers/#{phone}/attach-webhook"
|
52
|
+
end
|
53
|
+
Pinnacle::Types::ConfiguredWebhook.from_json(json_object: response.body)
|
54
|
+
end
|
55
|
+
|
56
|
+
# Disconnect a webhook from your phone number to stop receiving event
|
57
|
+
# notifications for that specific number. <br>
|
58
|
+
# The webhook configuration itself remains intact and available for use with other
|
59
|
+
# phone numbers.
|
60
|
+
#
|
61
|
+
# @param phone [String] The phone number you want to attach the webhook to in E.164 format. Make sure it
|
62
|
+
# is url encoded (i.e. replace the leading + with %2B). <br>
|
63
|
+
# Must be a phone number that you own and currently has the specified webhook
|
64
|
+
# attached.
|
65
|
+
# @param webhook_id [Integer] The unique identifier of the webhook you want to detach from the phone number.
|
66
|
+
# <br>
|
67
|
+
# This must be a valid webhook ID that is currently attached to the specified
|
68
|
+
# phone number.
|
69
|
+
# @param request_options [Pinnacle::RequestOptions]
|
70
|
+
# @return [Pinnacle::Types::DetachedWebhookInfo]
|
71
|
+
# @example
|
72
|
+
# api = Pinnacle::Client.new(
|
73
|
+
# base_url: "https://api.example.com",
|
74
|
+
# environment: Pinnacle::Environment::DEFAULT,
|
75
|
+
# api_key: "YOUR_API_KEY"
|
76
|
+
# )
|
77
|
+
# api.phone_numbers.webhook.detach(phone: "+14155551234", webhook_id: 123)
|
78
|
+
def detach(phone:, webhook_id:, request_options: nil)
|
79
|
+
response = @request_client.conn.delete do |req|
|
80
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
81
|
+
req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
82
|
+
req.headers = {
|
83
|
+
**(req.headers || {}),
|
84
|
+
**@request_client.get_headers,
|
85
|
+
**(request_options&.additional_headers || {})
|
86
|
+
}.compact
|
87
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
88
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
89
|
+
end
|
90
|
+
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
91
|
+
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
92
|
+
end
|
93
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/phone-numbers/#{phone}/detach-webhook/#{webhook_id}"
|
94
|
+
end
|
95
|
+
Pinnacle::Types::DetachedWebhookInfo.from_json(json_object: response.body)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
class AsyncWebhookClient
|
100
|
+
# @return [Pinnacle::AsyncRequestClient]
|
101
|
+
attr_reader :request_client
|
102
|
+
|
103
|
+
# @param request_client [Pinnacle::AsyncRequestClient]
|
104
|
+
# @return [Pinnacle::PhoneNumbers::AsyncWebhookClient]
|
105
|
+
def initialize(request_client:)
|
106
|
+
@request_client = request_client
|
107
|
+
end
|
108
|
+
|
109
|
+
# Connect a webhook to your phone number to receive real-time notifications for
|
110
|
+
# incoming messages, delivery status updates, and other communication events.
|
111
|
+
#
|
112
|
+
# @param phone [String] The phone number you want to attach the webhook to in E.164 format. Make sure it
|
113
|
+
# is url encoded (i.e. replace the leading + with %2B). <br>
|
114
|
+
# Must be a phone number that you own and have already [purchased](./buy) through
|
115
|
+
# the API.
|
116
|
+
# @param request [Pinnacle::Types::AttachWebhookSchemaWebhookId, Pinnacle::Types::AttachWebhookSchemaName]
|
117
|
+
# @param request_options [Pinnacle::RequestOptions]
|
118
|
+
# @return [Pinnacle::Types::ConfiguredWebhook]
|
119
|
+
# @example
|
120
|
+
# api = Pinnacle::Client.new(
|
121
|
+
# base_url: "https://api.example.com",
|
122
|
+
# environment: Pinnacle::Environment::DEFAULT,
|
123
|
+
# api_key: "YOUR_API_KEY"
|
124
|
+
# )
|
125
|
+
# api.phone_numbers.webhook.attach(phone: "%2B14155551234", request: { webhook_id: 1 })
|
126
|
+
def attach(phone:, request:, request_options: nil)
|
127
|
+
Async do
|
128
|
+
response = @request_client.conn.post do |req|
|
129
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
130
|
+
req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
131
|
+
req.headers = {
|
132
|
+
**(req.headers || {}),
|
133
|
+
**@request_client.get_headers,
|
134
|
+
**(request_options&.additional_headers || {})
|
135
|
+
}.compact
|
136
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
137
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
138
|
+
end
|
139
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
140
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/phone-numbers/#{phone}/attach-webhook"
|
141
|
+
end
|
142
|
+
Pinnacle::Types::ConfiguredWebhook.from_json(json_object: response.body)
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
# Disconnect a webhook from your phone number to stop receiving event
|
147
|
+
# notifications for that specific number. <br>
|
148
|
+
# The webhook configuration itself remains intact and available for use with other
|
149
|
+
# phone numbers.
|
150
|
+
#
|
151
|
+
# @param phone [String] The phone number you want to attach the webhook to in E.164 format. Make sure it
|
152
|
+
# is url encoded (i.e. replace the leading + with %2B). <br>
|
153
|
+
# Must be a phone number that you own and currently has the specified webhook
|
154
|
+
# attached.
|
155
|
+
# @param webhook_id [Integer] The unique identifier of the webhook you want to detach from the phone number.
|
156
|
+
# <br>
|
157
|
+
# This must be a valid webhook ID that is currently attached to the specified
|
158
|
+
# phone number.
|
159
|
+
# @param request_options [Pinnacle::RequestOptions]
|
160
|
+
# @return [Pinnacle::Types::DetachedWebhookInfo]
|
161
|
+
# @example
|
162
|
+
# api = Pinnacle::Client.new(
|
163
|
+
# base_url: "https://api.example.com",
|
164
|
+
# environment: Pinnacle::Environment::DEFAULT,
|
165
|
+
# api_key: "YOUR_API_KEY"
|
166
|
+
# )
|
167
|
+
# api.phone_numbers.webhook.detach(phone: "+14155551234", webhook_id: 123)
|
168
|
+
def detach(phone:, webhook_id:, request_options: nil)
|
169
|
+
Async do
|
170
|
+
response = @request_client.conn.delete do |req|
|
171
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
172
|
+
req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
173
|
+
req.headers = {
|
174
|
+
**(req.headers || {}),
|
175
|
+
**@request_client.get_headers,
|
176
|
+
**(request_options&.additional_headers || {})
|
177
|
+
}.compact
|
178
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
179
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
180
|
+
end
|
181
|
+
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
182
|
+
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
183
|
+
end
|
184
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/phone-numbers/#{phone}/detach-webhook/#{webhook_id}"
|
185
|
+
end
|
186
|
+
Pinnacle::Types::DetachedWebhookInfo.from_json(json_object: response.body)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../requests"
|
4
|
+
require_relative "get/client"
|
5
|
+
|
6
|
+
module Pinnacle
|
7
|
+
module Status
|
8
|
+
class Client
|
9
|
+
# @return [Pinnacle::Status::GetClient]
|
10
|
+
attr_reader :get
|
11
|
+
|
12
|
+
# @param request_client [Pinnacle::RequestClient]
|
13
|
+
# @return [Pinnacle::Status::Client]
|
14
|
+
def initialize(request_client:)
|
15
|
+
@get = Pinnacle::Status::GetClient.new(request_client: request_client)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class AsyncClient
|
20
|
+
# @return [Pinnacle::Status::AsyncGetClient]
|
21
|
+
attr_reader :get
|
22
|
+
|
23
|
+
# @param request_client [Pinnacle::AsyncRequestClient]
|
24
|
+
# @return [Pinnacle::Status::AsyncClient]
|
25
|
+
def initialize(request_client:)
|
26
|
+
@get = Pinnacle::Status::AsyncGetClient.new(request_client: request_client)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|