rcs 1.0.18 → 2.0.0.pre.rc.1
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 +185 -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 +345 -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,457 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../../requests"
|
4
|
+
require_relative "../../types/autofill_campaign_params"
|
5
|
+
require_relative "types/rcs_autofill_response"
|
6
|
+
require_relative "../../types/extended_rcs_campaign"
|
7
|
+
require_relative "../../types/campaign_submission_result"
|
8
|
+
require_relative "types/upsert_rcs_schema_agent"
|
9
|
+
require_relative "types/upsert_rcs_schema_links"
|
10
|
+
require_relative "types/upsert_rcs_schema_opt_in"
|
11
|
+
require_relative "types/upsert_rcs_schema_opt_out"
|
12
|
+
require_relative "types/upsert_rcs_schema_use_case"
|
13
|
+
require_relative "../../types/validate_campaign_params"
|
14
|
+
require_relative "../../types/campaign_validation_result"
|
15
|
+
require "async"
|
16
|
+
|
17
|
+
module Pinnacle
|
18
|
+
module Campaigns
|
19
|
+
class RcsClient
|
20
|
+
# @return [Pinnacle::RequestClient]
|
21
|
+
attr_reader :request_client
|
22
|
+
|
23
|
+
# @param request_client [Pinnacle::RequestClient]
|
24
|
+
# @return [Pinnacle::Campaigns::RcsClient]
|
25
|
+
def initialize(request_client:)
|
26
|
+
@request_client = request_client
|
27
|
+
end
|
28
|
+
|
29
|
+
# Generate campaign details based off existing campaign and the brand it's
|
30
|
+
# connected to.
|
31
|
+
#
|
32
|
+
# @param request [Hash] Request of type Pinnacle::Types::AutofillCampaignParams, as a Hash
|
33
|
+
# * :additional_info (String)
|
34
|
+
# * :campaign_id (Integer)
|
35
|
+
# @param request_options [Pinnacle::RequestOptions]
|
36
|
+
# @return [Pinnacle::Campaigns::Rcs::Types::RcsAutofillResponse]
|
37
|
+
# @example
|
38
|
+
# api = Pinnacle::Client.new(
|
39
|
+
# base_url: "https://api.example.com",
|
40
|
+
# environment: Pinnacle::Environment::DEFAULT,
|
41
|
+
# api_key: "YOUR_API_KEY"
|
42
|
+
# )
|
43
|
+
# api.campaigns.rcs.autofill(request: { additional_info: "Please autofill missing DLC campaign fields using my brand profile", campaign_id: 161 })
|
44
|
+
def autofill(request:, request_options: nil)
|
45
|
+
response = @request_client.conn.post do |req|
|
46
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
47
|
+
req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
48
|
+
req.headers = {
|
49
|
+
**(req.headers || {}),
|
50
|
+
**@request_client.get_headers,
|
51
|
+
**(request_options&.additional_headers || {})
|
52
|
+
}.compact
|
53
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
54
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
55
|
+
end
|
56
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
57
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/campaigns/rcs/autofill"
|
58
|
+
end
|
59
|
+
Pinnacle::Campaigns::Rcs::Types::RcsAutofillResponse.from_json(json_object: response.body)
|
60
|
+
end
|
61
|
+
|
62
|
+
# Retrieve RCS campaign.
|
63
|
+
#
|
64
|
+
# @param campaign_id [Integer] Unique identifier of the RCS campaign.
|
65
|
+
# @param request_options [Pinnacle::RequestOptions]
|
66
|
+
# @return [Pinnacle::Types::ExtendedRcsCampaign]
|
67
|
+
# @example
|
68
|
+
# api = Pinnacle::Client.new(
|
69
|
+
# base_url: "https://api.example.com",
|
70
|
+
# environment: Pinnacle::Environment::DEFAULT,
|
71
|
+
# api_key: "YOUR_API_KEY"
|
72
|
+
# )
|
73
|
+
# api.campaigns.rcs.get(campaign_id: 161)
|
74
|
+
def get(campaign_id:, request_options: nil)
|
75
|
+
response = @request_client.conn.get do |req|
|
76
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
77
|
+
req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
78
|
+
req.headers = {
|
79
|
+
**(req.headers || {}),
|
80
|
+
**@request_client.get_headers,
|
81
|
+
**(request_options&.additional_headers || {})
|
82
|
+
}.compact
|
83
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
84
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
85
|
+
end
|
86
|
+
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
87
|
+
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
88
|
+
end
|
89
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/campaigns/rcs/#{campaign_id}"
|
90
|
+
end
|
91
|
+
Pinnacle::Types::ExtendedRcsCampaign.from_json(json_object: response.body)
|
92
|
+
end
|
93
|
+
|
94
|
+
# Submit your RCS campaign for approval and activation with carriers.
|
95
|
+
#
|
96
|
+
# @param campaign_id [Integer] Unique identifier of the RCS campaign to retrieve.
|
97
|
+
# @param request_options [Pinnacle::RequestOptions]
|
98
|
+
# @return [Pinnacle::Types::CampaignSubmissionResult]
|
99
|
+
# @example
|
100
|
+
# api = Pinnacle::Client.new(
|
101
|
+
# base_url: "https://api.example.com",
|
102
|
+
# environment: Pinnacle::Environment::DEFAULT,
|
103
|
+
# api_key: "YOUR_API_KEY"
|
104
|
+
# )
|
105
|
+
# api.campaigns.rcs.submit(campaign_id: 161)
|
106
|
+
def submit(campaign_id:, request_options: nil)
|
107
|
+
response = @request_client.conn.post do |req|
|
108
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
109
|
+
req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
110
|
+
req.headers = {
|
111
|
+
**(req.headers || {}),
|
112
|
+
**@request_client.get_headers,
|
113
|
+
**(request_options&.additional_headers || {})
|
114
|
+
}.compact
|
115
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
116
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
117
|
+
end
|
118
|
+
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
119
|
+
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
120
|
+
end
|
121
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/campaigns/rcs/submit/#{campaign_id}"
|
122
|
+
end
|
123
|
+
Pinnacle::Types::CampaignSubmissionResult.from_json(json_object: response.body)
|
124
|
+
end
|
125
|
+
|
126
|
+
# Create a new RCS campaign or updates an existing one. <br>
|
127
|
+
# Omit campaignId to create a campaign.
|
128
|
+
#
|
129
|
+
# @param agent [Hash] Create an agent for the campaign.Request of type Pinnacle::Campaigns::Rcs::Types::UpsertRcsSchemaAgent, as a Hash
|
130
|
+
# * :color (String)
|
131
|
+
# * :description (String)
|
132
|
+
# * :emails (Array<Pinnacle::Campaigns::Rcs::Types::UpsertRcsSchemaAgentEmailsItem>)
|
133
|
+
# * :hero_url (String)
|
134
|
+
# * :icon_url (String)
|
135
|
+
# * :name (String)
|
136
|
+
# * :phones (Array<Pinnacle::Campaigns::Rcs::Types::UpsertRcsSchemaAgentPhonesItem>)
|
137
|
+
# * :websites (Array<Pinnacle::Campaigns::Rcs::Types::UpsertRcsSchemaAgentWebsitesItem>)
|
138
|
+
# @param brand [Integer] Unique identifier for the brand.
|
139
|
+
# @param campaign_id [Integer] Unique identifier for the campaign.
|
140
|
+
# @param expected_agent_responses [Array<String>] List of what the agent might say to users (1-5 required).
|
141
|
+
# @param links [Hash] Legal documentation links.Request of type Pinnacle::Campaigns::Rcs::Types::UpsertRcsSchemaLinks, as a Hash
|
142
|
+
# * :privacy_policy (String)
|
143
|
+
# * :terms_of_service (String)
|
144
|
+
# @param opt_in [Hash] Opt-in configuration.Request of type Pinnacle::Campaigns::Rcs::Types::UpsertRcsSchemaOptIn, as a Hash
|
145
|
+
# * :method (Pinnacle::Types::RcsCampaignOptInMethodEnum)
|
146
|
+
# * :terms_and_conditions (String)
|
147
|
+
# @param opt_out [Hash] Opt-out configuration.Request of type Pinnacle::Campaigns::Rcs::Types::UpsertRcsSchemaOptOut, as a Hash
|
148
|
+
# * :description (String)
|
149
|
+
# * :keywords (Array<String>)
|
150
|
+
# @param use_case [Hash] Use case classification for the campaign.Request of type Pinnacle::Campaigns::Rcs::Types::UpsertRcsSchemaUseCase, as a Hash
|
151
|
+
# * :behavior (String)
|
152
|
+
# * :value (Pinnacle::Types::RcsCampaignUseCaseEnum)
|
153
|
+
# @param request_options [Pinnacle::RequestOptions]
|
154
|
+
# @return [Pinnacle::Types::ExtendedRcsCampaign]
|
155
|
+
# @example
|
156
|
+
# api = Pinnacle::Client.new(
|
157
|
+
# base_url: "https://api.example.com",
|
158
|
+
# environment: Pinnacle::Environment::DEFAULT,
|
159
|
+
# api_key: "YOUR_API_KEY"
|
160
|
+
# )
|
161
|
+
# api.campaigns.rcs.upsert(
|
162
|
+
# agent: { color: "#000000", description: "Engaging campaigns with RBM – next-gen SMS marketing with rich content and better analytics.", emails: [{ email: "founders@trypinnacle.app", label: "Email Us" }], hero_url: "https://agent-logos.storage.googleapis.com/_/m0bk9mmw7kfynqiKSPfsaoc6", icon_url: "https://agent-logos.storage.googleapis.com/_/m0bk9gvlDunZEw1krfruZmw3", name: "Pinnacle Software Development", phones: [{ label: "Contact us directly", phone: "+14154467821" }], websites: [{ label: "Get started with Pinnacle", url: "https://www.trypinnacle.app/" }] },
|
163
|
+
# brand: 2,
|
164
|
+
# expected_agent_responses: ["Here are the things I can help you with.", "I can assist you with booking an appointment, or you may choose to book manually.", "Here are the available times to connect with a representative tomorrow.", "Your appointment has been scheduled."],
|
165
|
+
# links: { privacy_policy: "https://www.trypinnacle.app/privacy", terms_of_service: "https://www.trypinnacle.app/terms" },
|
166
|
+
# opt_in: { method: WEBSITE, terms_and_conditions: "Would you like to subscribe to Pinnacle?" },
|
167
|
+
# opt_out: { description: "Reply STOP to opt-out anytime.", keywords: ["STOP", "UNSUBSCRIBE", "END"] },
|
168
|
+
# use_case: { behavior: "Acts as a customer service representative.", value: OTHER }
|
169
|
+
# )
|
170
|
+
def upsert(agent: nil, brand: nil, campaign_id: nil, expected_agent_responses: nil, links: nil, opt_in: nil,
|
171
|
+
opt_out: nil, use_case: nil, request_options: nil)
|
172
|
+
response = @request_client.conn.post do |req|
|
173
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
174
|
+
req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
175
|
+
req.headers = {
|
176
|
+
**(req.headers || {}),
|
177
|
+
**@request_client.get_headers,
|
178
|
+
**(request_options&.additional_headers || {})
|
179
|
+
}.compact
|
180
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
181
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
182
|
+
end
|
183
|
+
req.body = {
|
184
|
+
**(request_options&.additional_body_parameters || {}),
|
185
|
+
agent: agent,
|
186
|
+
brand: brand,
|
187
|
+
campaignId: campaign_id,
|
188
|
+
expectedAgentResponses: expected_agent_responses,
|
189
|
+
links: links,
|
190
|
+
optIn: opt_in,
|
191
|
+
optOut: opt_out,
|
192
|
+
useCase: use_case
|
193
|
+
}.compact
|
194
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/campaigns/rcs"
|
195
|
+
end
|
196
|
+
Pinnacle::Types::ExtendedRcsCampaign.from_json(json_object: response.body)
|
197
|
+
end
|
198
|
+
|
199
|
+
# Validate your RCS campaign configuration against carrier requirements and
|
200
|
+
# compliance rules.
|
201
|
+
#
|
202
|
+
# @param request [Hash] Request of type Pinnacle::Types::ValidateCampaignParams, as a Hash
|
203
|
+
# * :additional_info (String)
|
204
|
+
# * :campaign_id (Integer)
|
205
|
+
# @param request_options [Pinnacle::RequestOptions]
|
206
|
+
# @return [Pinnacle::Types::CampaignValidationResult]
|
207
|
+
# @example
|
208
|
+
# api = Pinnacle::Client.new(
|
209
|
+
# base_url: "https://api.example.com",
|
210
|
+
# environment: Pinnacle::Environment::DEFAULT,
|
211
|
+
# api_key: "YOUR_API_KEY"
|
212
|
+
# )
|
213
|
+
# api.campaigns.rcs.validate(request: { additional_info: "Please validate this DLC campaign for 10DLC compliance", campaign_id: 161 })
|
214
|
+
def validate(request:, request_options: nil)
|
215
|
+
response = @request_client.conn.post do |req|
|
216
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
217
|
+
req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
218
|
+
req.headers = {
|
219
|
+
**(req.headers || {}),
|
220
|
+
**@request_client.get_headers,
|
221
|
+
**(request_options&.additional_headers || {})
|
222
|
+
}.compact
|
223
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
224
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
225
|
+
end
|
226
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
227
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/campaigns/rcs/validate"
|
228
|
+
end
|
229
|
+
Pinnacle::Types::CampaignValidationResult.from_json(json_object: response.body)
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
class AsyncRcsClient
|
234
|
+
# @return [Pinnacle::AsyncRequestClient]
|
235
|
+
attr_reader :request_client
|
236
|
+
|
237
|
+
# @param request_client [Pinnacle::AsyncRequestClient]
|
238
|
+
# @return [Pinnacle::Campaigns::AsyncRcsClient]
|
239
|
+
def initialize(request_client:)
|
240
|
+
@request_client = request_client
|
241
|
+
end
|
242
|
+
|
243
|
+
# Generate campaign details based off existing campaign and the brand it's
|
244
|
+
# connected to.
|
245
|
+
#
|
246
|
+
# @param request [Hash] Request of type Pinnacle::Types::AutofillCampaignParams, as a Hash
|
247
|
+
# * :additional_info (String)
|
248
|
+
# * :campaign_id (Integer)
|
249
|
+
# @param request_options [Pinnacle::RequestOptions]
|
250
|
+
# @return [Pinnacle::Campaigns::Rcs::Types::RcsAutofillResponse]
|
251
|
+
# @example
|
252
|
+
# api = Pinnacle::Client.new(
|
253
|
+
# base_url: "https://api.example.com",
|
254
|
+
# environment: Pinnacle::Environment::DEFAULT,
|
255
|
+
# api_key: "YOUR_API_KEY"
|
256
|
+
# )
|
257
|
+
# api.campaigns.rcs.autofill(request: { additional_info: "Please autofill missing DLC campaign fields using my brand profile", campaign_id: 161 })
|
258
|
+
def autofill(request:, request_options: nil)
|
259
|
+
Async do
|
260
|
+
response = @request_client.conn.post do |req|
|
261
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
262
|
+
req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
263
|
+
req.headers = {
|
264
|
+
**(req.headers || {}),
|
265
|
+
**@request_client.get_headers,
|
266
|
+
**(request_options&.additional_headers || {})
|
267
|
+
}.compact
|
268
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
269
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
270
|
+
end
|
271
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
272
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/campaigns/rcs/autofill"
|
273
|
+
end
|
274
|
+
Pinnacle::Campaigns::Rcs::Types::RcsAutofillResponse.from_json(json_object: response.body)
|
275
|
+
end
|
276
|
+
end
|
277
|
+
|
278
|
+
# Retrieve RCS campaign.
|
279
|
+
#
|
280
|
+
# @param campaign_id [Integer] Unique identifier of the RCS campaign.
|
281
|
+
# @param request_options [Pinnacle::RequestOptions]
|
282
|
+
# @return [Pinnacle::Types::ExtendedRcsCampaign]
|
283
|
+
# @example
|
284
|
+
# api = Pinnacle::Client.new(
|
285
|
+
# base_url: "https://api.example.com",
|
286
|
+
# environment: Pinnacle::Environment::DEFAULT,
|
287
|
+
# api_key: "YOUR_API_KEY"
|
288
|
+
# )
|
289
|
+
# api.campaigns.rcs.get(campaign_id: 161)
|
290
|
+
def get(campaign_id:, request_options: nil)
|
291
|
+
Async do
|
292
|
+
response = @request_client.conn.get do |req|
|
293
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
294
|
+
req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
295
|
+
req.headers = {
|
296
|
+
**(req.headers || {}),
|
297
|
+
**@request_client.get_headers,
|
298
|
+
**(request_options&.additional_headers || {})
|
299
|
+
}.compact
|
300
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
301
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
302
|
+
end
|
303
|
+
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
304
|
+
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
305
|
+
end
|
306
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/campaigns/rcs/#{campaign_id}"
|
307
|
+
end
|
308
|
+
Pinnacle::Types::ExtendedRcsCampaign.from_json(json_object: response.body)
|
309
|
+
end
|
310
|
+
end
|
311
|
+
|
312
|
+
# Submit your RCS campaign for approval and activation with carriers.
|
313
|
+
#
|
314
|
+
# @param campaign_id [Integer] Unique identifier of the RCS campaign to retrieve.
|
315
|
+
# @param request_options [Pinnacle::RequestOptions]
|
316
|
+
# @return [Pinnacle::Types::CampaignSubmissionResult]
|
317
|
+
# @example
|
318
|
+
# api = Pinnacle::Client.new(
|
319
|
+
# base_url: "https://api.example.com",
|
320
|
+
# environment: Pinnacle::Environment::DEFAULT,
|
321
|
+
# api_key: "YOUR_API_KEY"
|
322
|
+
# )
|
323
|
+
# api.campaigns.rcs.submit(campaign_id: 161)
|
324
|
+
def submit(campaign_id:, request_options: nil)
|
325
|
+
Async do
|
326
|
+
response = @request_client.conn.post do |req|
|
327
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
328
|
+
req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
329
|
+
req.headers = {
|
330
|
+
**(req.headers || {}),
|
331
|
+
**@request_client.get_headers,
|
332
|
+
**(request_options&.additional_headers || {})
|
333
|
+
}.compact
|
334
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
335
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
336
|
+
end
|
337
|
+
unless request_options.nil? || request_options&.additional_body_parameters.nil?
|
338
|
+
req.body = { **(request_options&.additional_body_parameters || {}) }.compact
|
339
|
+
end
|
340
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/campaigns/rcs/submit/#{campaign_id}"
|
341
|
+
end
|
342
|
+
Pinnacle::Types::CampaignSubmissionResult.from_json(json_object: response.body)
|
343
|
+
end
|
344
|
+
end
|
345
|
+
|
346
|
+
# Create a new RCS campaign or updates an existing one. <br>
|
347
|
+
# Omit campaignId to create a campaign.
|
348
|
+
#
|
349
|
+
# @param agent [Hash] Create an agent for the campaign.Request of type Pinnacle::Campaigns::Rcs::Types::UpsertRcsSchemaAgent, as a Hash
|
350
|
+
# * :color (String)
|
351
|
+
# * :description (String)
|
352
|
+
# * :emails (Array<Pinnacle::Campaigns::Rcs::Types::UpsertRcsSchemaAgentEmailsItem>)
|
353
|
+
# * :hero_url (String)
|
354
|
+
# * :icon_url (String)
|
355
|
+
# * :name (String)
|
356
|
+
# * :phones (Array<Pinnacle::Campaigns::Rcs::Types::UpsertRcsSchemaAgentPhonesItem>)
|
357
|
+
# * :websites (Array<Pinnacle::Campaigns::Rcs::Types::UpsertRcsSchemaAgentWebsitesItem>)
|
358
|
+
# @param brand [Integer] Unique identifier for the brand.
|
359
|
+
# @param campaign_id [Integer] Unique identifier for the campaign.
|
360
|
+
# @param expected_agent_responses [Array<String>] List of what the agent might say to users (1-5 required).
|
361
|
+
# @param links [Hash] Legal documentation links.Request of type Pinnacle::Campaigns::Rcs::Types::UpsertRcsSchemaLinks, as a Hash
|
362
|
+
# * :privacy_policy (String)
|
363
|
+
# * :terms_of_service (String)
|
364
|
+
# @param opt_in [Hash] Opt-in configuration.Request of type Pinnacle::Campaigns::Rcs::Types::UpsertRcsSchemaOptIn, as a Hash
|
365
|
+
# * :method (Pinnacle::Types::RcsCampaignOptInMethodEnum)
|
366
|
+
# * :terms_and_conditions (String)
|
367
|
+
# @param opt_out [Hash] Opt-out configuration.Request of type Pinnacle::Campaigns::Rcs::Types::UpsertRcsSchemaOptOut, as a Hash
|
368
|
+
# * :description (String)
|
369
|
+
# * :keywords (Array<String>)
|
370
|
+
# @param use_case [Hash] Use case classification for the campaign.Request of type Pinnacle::Campaigns::Rcs::Types::UpsertRcsSchemaUseCase, as a Hash
|
371
|
+
# * :behavior (String)
|
372
|
+
# * :value (Pinnacle::Types::RcsCampaignUseCaseEnum)
|
373
|
+
# @param request_options [Pinnacle::RequestOptions]
|
374
|
+
# @return [Pinnacle::Types::ExtendedRcsCampaign]
|
375
|
+
# @example
|
376
|
+
# api = Pinnacle::Client.new(
|
377
|
+
# base_url: "https://api.example.com",
|
378
|
+
# environment: Pinnacle::Environment::DEFAULT,
|
379
|
+
# api_key: "YOUR_API_KEY"
|
380
|
+
# )
|
381
|
+
# api.campaigns.rcs.upsert(
|
382
|
+
# agent: { color: "#000000", description: "Engaging campaigns with RBM – next-gen SMS marketing with rich content and better analytics.", emails: [{ email: "founders@trypinnacle.app", label: "Email Us" }], hero_url: "https://agent-logos.storage.googleapis.com/_/m0bk9mmw7kfynqiKSPfsaoc6", icon_url: "https://agent-logos.storage.googleapis.com/_/m0bk9gvlDunZEw1krfruZmw3", name: "Pinnacle Software Development", phones: [{ label: "Contact us directly", phone: "+14154467821" }], websites: [{ label: "Get started with Pinnacle", url: "https://www.trypinnacle.app/" }] },
|
383
|
+
# brand: 2,
|
384
|
+
# expected_agent_responses: ["Here are the things I can help you with.", "I can assist you with booking an appointment, or you may choose to book manually.", "Here are the available times to connect with a representative tomorrow.", "Your appointment has been scheduled."],
|
385
|
+
# links: { privacy_policy: "https://www.trypinnacle.app/privacy", terms_of_service: "https://www.trypinnacle.app/terms" },
|
386
|
+
# opt_in: { method: WEBSITE, terms_and_conditions: "Would you like to subscribe to Pinnacle?" },
|
387
|
+
# opt_out: { description: "Reply STOP to opt-out anytime.", keywords: ["STOP", "UNSUBSCRIBE", "END"] },
|
388
|
+
# use_case: { behavior: "Acts as a customer service representative.", value: OTHER }
|
389
|
+
# )
|
390
|
+
def upsert(agent: nil, brand: nil, campaign_id: nil, expected_agent_responses: nil, links: nil, opt_in: nil,
|
391
|
+
opt_out: nil, use_case: nil, request_options: nil)
|
392
|
+
Async do
|
393
|
+
response = @request_client.conn.post do |req|
|
394
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
395
|
+
req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
396
|
+
req.headers = {
|
397
|
+
**(req.headers || {}),
|
398
|
+
**@request_client.get_headers,
|
399
|
+
**(request_options&.additional_headers || {})
|
400
|
+
}.compact
|
401
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
402
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
403
|
+
end
|
404
|
+
req.body = {
|
405
|
+
**(request_options&.additional_body_parameters || {}),
|
406
|
+
agent: agent,
|
407
|
+
brand: brand,
|
408
|
+
campaignId: campaign_id,
|
409
|
+
expectedAgentResponses: expected_agent_responses,
|
410
|
+
links: links,
|
411
|
+
optIn: opt_in,
|
412
|
+
optOut: opt_out,
|
413
|
+
useCase: use_case
|
414
|
+
}.compact
|
415
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/campaigns/rcs"
|
416
|
+
end
|
417
|
+
Pinnacle::Types::ExtendedRcsCampaign.from_json(json_object: response.body)
|
418
|
+
end
|
419
|
+
end
|
420
|
+
|
421
|
+
# Validate your RCS campaign configuration against carrier requirements and
|
422
|
+
# compliance rules.
|
423
|
+
#
|
424
|
+
# @param request [Hash] Request of type Pinnacle::Types::ValidateCampaignParams, as a Hash
|
425
|
+
# * :additional_info (String)
|
426
|
+
# * :campaign_id (Integer)
|
427
|
+
# @param request_options [Pinnacle::RequestOptions]
|
428
|
+
# @return [Pinnacle::Types::CampaignValidationResult]
|
429
|
+
# @example
|
430
|
+
# api = Pinnacle::Client.new(
|
431
|
+
# base_url: "https://api.example.com",
|
432
|
+
# environment: Pinnacle::Environment::DEFAULT,
|
433
|
+
# api_key: "YOUR_API_KEY"
|
434
|
+
# )
|
435
|
+
# api.campaigns.rcs.validate(request: { additional_info: "Please validate this DLC campaign for 10DLC compliance", campaign_id: 161 })
|
436
|
+
def validate(request:, request_options: nil)
|
437
|
+
Async do
|
438
|
+
response = @request_client.conn.post do |req|
|
439
|
+
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
440
|
+
req.headers["PINNACLE-API-KEY"] = request_options.api_key unless request_options&.api_key.nil?
|
441
|
+
req.headers = {
|
442
|
+
**(req.headers || {}),
|
443
|
+
**@request_client.get_headers,
|
444
|
+
**(request_options&.additional_headers || {})
|
445
|
+
}.compact
|
446
|
+
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
447
|
+
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
448
|
+
end
|
449
|
+
req.body = { **(request || {}), **(request_options&.additional_body_parameters || {}) }.compact
|
450
|
+
req.url "#{@request_client.get_url(request_options: request_options)}/campaigns/rcs/validate"
|
451
|
+
end
|
452
|
+
Pinnacle::Types::CampaignValidationResult.from_json(json_object: response.body)
|
453
|
+
end
|
454
|
+
end
|
455
|
+
end
|
456
|
+
end
|
457
|
+
end
|
@@ -0,0 +1,155 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "../../../types/rcs_campaign_schema_agent"
|
4
|
+
require_relative "../../../types/rcs_campaign_schema_links"
|
5
|
+
require_relative "../../../types/rcs_campaign_schema_opt_in"
|
6
|
+
require_relative "../../../types/rcs_campaign_schema_opt_out"
|
7
|
+
require_relative "../../../types/rcs_campaign_schema_use_case"
|
8
|
+
require "ostruct"
|
9
|
+
require "json"
|
10
|
+
|
11
|
+
module Pinnacle
|
12
|
+
module Campaigns
|
13
|
+
module Rcs
|
14
|
+
module Types
|
15
|
+
class RcsAutofillResponse
|
16
|
+
# @return [Integer]
|
17
|
+
attr_reader :brand
|
18
|
+
# @return [Pinnacle::Types::RcsCampaignSchemaAgent] Agent configured to the campaign.
|
19
|
+
attr_reader :agent
|
20
|
+
# @return [Integer] Unique identifier for the campaign.
|
21
|
+
attr_reader :campaign_id
|
22
|
+
# @return [Array<String>] List of what the agent might say to users.
|
23
|
+
attr_reader :expected_agent_responses
|
24
|
+
# @return [Pinnacle::Types::RcsCampaignSchemaLinks] Legal documentation links.
|
25
|
+
attr_reader :links
|
26
|
+
# @return [Pinnacle::Types::RcsCampaignSchemaOptIn] Opt-in configuration.
|
27
|
+
attr_reader :opt_in
|
28
|
+
# @return [Pinnacle::Types::RcsCampaignSchemaOptOut] Opt-out configuration.
|
29
|
+
attr_reader :opt_out
|
30
|
+
# @return [Pinnacle::Types::RcsCampaignSchemaUseCase] Use case classification for the campaign.
|
31
|
+
attr_reader :use_case
|
32
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
33
|
+
attr_reader :additional_properties
|
34
|
+
# @return [Object]
|
35
|
+
attr_reader :_field_set
|
36
|
+
protected :_field_set
|
37
|
+
|
38
|
+
OMIT = Object.new
|
39
|
+
|
40
|
+
# @param brand [Integer]
|
41
|
+
# @param agent [Pinnacle::Types::RcsCampaignSchemaAgent] Agent configured to the campaign.
|
42
|
+
# @param campaign_id [Integer] Unique identifier for the campaign.
|
43
|
+
# @param expected_agent_responses [Array<String>] List of what the agent might say to users.
|
44
|
+
# @param links [Pinnacle::Types::RcsCampaignSchemaLinks] Legal documentation links.
|
45
|
+
# @param opt_in [Pinnacle::Types::RcsCampaignSchemaOptIn] Opt-in configuration.
|
46
|
+
# @param opt_out [Pinnacle::Types::RcsCampaignSchemaOptOut] Opt-out configuration.
|
47
|
+
# @param use_case [Pinnacle::Types::RcsCampaignSchemaUseCase] Use case classification for the campaign.
|
48
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
49
|
+
# @return [Pinnacle::Campaigns::Rcs::Types::RcsAutofillResponse]
|
50
|
+
def initialize(brand: OMIT, agent: OMIT, campaign_id: OMIT, expected_agent_responses: OMIT, links: OMIT,
|
51
|
+
opt_in: OMIT, opt_out: OMIT, use_case: OMIT, additional_properties: nil)
|
52
|
+
@brand = brand if brand != OMIT
|
53
|
+
@agent = agent if agent != OMIT
|
54
|
+
@campaign_id = campaign_id if campaign_id != OMIT
|
55
|
+
@expected_agent_responses = expected_agent_responses if expected_agent_responses != OMIT
|
56
|
+
@links = links if links != OMIT
|
57
|
+
@opt_in = opt_in if opt_in != OMIT
|
58
|
+
@opt_out = opt_out if opt_out != OMIT
|
59
|
+
@use_case = use_case if use_case != OMIT
|
60
|
+
@additional_properties = additional_properties
|
61
|
+
@_field_set = {
|
62
|
+
"brand": brand,
|
63
|
+
"agent": agent,
|
64
|
+
"campaignId": campaign_id,
|
65
|
+
"expectedAgentResponses": expected_agent_responses,
|
66
|
+
"links": links,
|
67
|
+
"optIn": opt_in,
|
68
|
+
"optOut": opt_out,
|
69
|
+
"useCase": use_case
|
70
|
+
}.reject do |_k, v|
|
71
|
+
v == OMIT
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Deserialize a JSON object to an instance of RcsAutofillResponse
|
76
|
+
#
|
77
|
+
# @param json_object [String]
|
78
|
+
# @return [Pinnacle::Campaigns::Rcs::Types::RcsAutofillResponse]
|
79
|
+
def self.from_json(json_object:)
|
80
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
81
|
+
parsed_json = JSON.parse(json_object)
|
82
|
+
brand = parsed_json["brand"]
|
83
|
+
if parsed_json["agent"].nil?
|
84
|
+
agent = nil
|
85
|
+
else
|
86
|
+
agent = parsed_json["agent"].to_json
|
87
|
+
agent = Pinnacle::Types::RcsCampaignSchemaAgent.from_json(json_object: agent)
|
88
|
+
end
|
89
|
+
campaign_id = parsed_json["campaignId"]
|
90
|
+
expected_agent_responses = parsed_json["expectedAgentResponses"]
|
91
|
+
if parsed_json["links"].nil?
|
92
|
+
links = nil
|
93
|
+
else
|
94
|
+
links = parsed_json["links"].to_json
|
95
|
+
links = Pinnacle::Types::RcsCampaignSchemaLinks.from_json(json_object: links)
|
96
|
+
end
|
97
|
+
if parsed_json["optIn"].nil?
|
98
|
+
opt_in = nil
|
99
|
+
else
|
100
|
+
opt_in = parsed_json["optIn"].to_json
|
101
|
+
opt_in = Pinnacle::Types::RcsCampaignSchemaOptIn.from_json(json_object: opt_in)
|
102
|
+
end
|
103
|
+
if parsed_json["optOut"].nil?
|
104
|
+
opt_out = nil
|
105
|
+
else
|
106
|
+
opt_out = parsed_json["optOut"].to_json
|
107
|
+
opt_out = Pinnacle::Types::RcsCampaignSchemaOptOut.from_json(json_object: opt_out)
|
108
|
+
end
|
109
|
+
if parsed_json["useCase"].nil?
|
110
|
+
use_case = nil
|
111
|
+
else
|
112
|
+
use_case = parsed_json["useCase"].to_json
|
113
|
+
use_case = Pinnacle::Types::RcsCampaignSchemaUseCase.from_json(json_object: use_case)
|
114
|
+
end
|
115
|
+
new(
|
116
|
+
brand: brand,
|
117
|
+
agent: agent,
|
118
|
+
campaign_id: campaign_id,
|
119
|
+
expected_agent_responses: expected_agent_responses,
|
120
|
+
links: links,
|
121
|
+
opt_in: opt_in,
|
122
|
+
opt_out: opt_out,
|
123
|
+
use_case: use_case,
|
124
|
+
additional_properties: struct
|
125
|
+
)
|
126
|
+
end
|
127
|
+
|
128
|
+
# Serialize an instance of RcsAutofillResponse to a JSON object
|
129
|
+
#
|
130
|
+
# @return [String]
|
131
|
+
def to_json(*_args)
|
132
|
+
@_field_set&.to_json
|
133
|
+
end
|
134
|
+
|
135
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
136
|
+
# hash and check each fields type against the current object's property
|
137
|
+
# definitions.
|
138
|
+
#
|
139
|
+
# @param obj [Object]
|
140
|
+
# @return [Void]
|
141
|
+
def self.validate_raw(obj:)
|
142
|
+
obj.brand&.is_a?(Integer) != false || raise("Passed value for field obj.brand is not the expected type, validation failed.")
|
143
|
+
obj.agent.nil? || Pinnacle::Types::RcsCampaignSchemaAgent.validate_raw(obj: obj.agent)
|
144
|
+
obj.campaign_id&.is_a?(Integer) != false || raise("Passed value for field obj.campaign_id is not the expected type, validation failed.")
|
145
|
+
obj.expected_agent_responses&.is_a?(Array) != false || raise("Passed value for field obj.expected_agent_responses is not the expected type, validation failed.")
|
146
|
+
obj.links.nil? || Pinnacle::Types::RcsCampaignSchemaLinks.validate_raw(obj: obj.links)
|
147
|
+
obj.opt_in.nil? || Pinnacle::Types::RcsCampaignSchemaOptIn.validate_raw(obj: obj.opt_in)
|
148
|
+
obj.opt_out.nil? || Pinnacle::Types::RcsCampaignSchemaOptOut.validate_raw(obj: obj.opt_out)
|
149
|
+
obj.use_case.nil? || Pinnacle::Types::RcsCampaignSchemaUseCase.validate_raw(obj: obj.use_case)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|