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
data/lib/rcs/send/client.rb
DELETED
@@ -1,382 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "../../requests"
|
4
|
-
require_relative "../types/card"
|
5
|
-
require_relative "../types/action"
|
6
|
-
require_relative "types/rcs_fallback"
|
7
|
-
require_relative "types/send_rcs_response"
|
8
|
-
require_relative "types/send_sms_response"
|
9
|
-
require_relative "types/send_mms_response"
|
10
|
-
require "async"
|
11
|
-
|
12
|
-
module Pinnacle
|
13
|
-
class SendClient
|
14
|
-
# @return [Pinnacle::RequestClient]
|
15
|
-
attr_reader :request_client
|
16
|
-
|
17
|
-
# @param request_client [Pinnacle::RequestClient]
|
18
|
-
# @return [Pinnacle::SendClient]
|
19
|
-
def initialize(request_client:)
|
20
|
-
@request_client = request_client
|
21
|
-
end
|
22
|
-
|
23
|
-
# Send an interactive RCS message with text, media, or cards. Each message can
|
24
|
-
# only contain either text, media, or card(s).
|
25
|
-
# Quick replies can also be added to the message.
|
26
|
-
#
|
27
|
-
# @param from [String] The id of the RCS agent sending the message.
|
28
|
-
# Use 'test' if you want to send from the Pinnacle test agent. The test agent can
|
29
|
-
# only send to whitelisted test numbers.
|
30
|
-
# See https://dashboard.trypinnacle.app/settings/test-numbers to whitelist a
|
31
|
-
# number.
|
32
|
-
# @param to [String] The recipient's RCS-enabled phone number in E.164 format (e.g., +12345678901).
|
33
|
-
# @param text [String] Text content of the message.
|
34
|
-
# Make sure you have either 'text', 'mediaUrl', or 'cards'. An error will be
|
35
|
-
# thrown if multiple (i.e. both 'text' and 'mediaUrl') is provided.
|
36
|
-
# @param media_url [String] Media URL to be included in the message.
|
37
|
-
# Make sure you have either 'text', 'mediaUrl', or 'cards'. An error will be
|
38
|
-
# thrown if multiple (i.e. both 'text' and 'mediaUrl') is provided.
|
39
|
-
# @param cards [Array<Hash>] List of rich cards. Maximum of 10 cards.
|
40
|
-
# Make sure you have either 'text', 'mediaUrl', or 'cards'. An error will be
|
41
|
-
# thrown if multiple (i.e. both 'text' and 'mediaUrl') is provided.Request of type Array<Pinnacle::Card>, as a Hash
|
42
|
-
# * :title (String)
|
43
|
-
# * :subtitle (String)
|
44
|
-
# * :media_url (String)
|
45
|
-
# * :buttons (Array<Pinnacle::Action>)
|
46
|
-
# @param quick_replies [Array<Hash>] Optional list of quick reply actions (max 10).Request of type Array<Pinnacle::Action>, as a Hash
|
47
|
-
# * :title (String)
|
48
|
-
# * :type (Pinnacle::ActionType)
|
49
|
-
# * :payload (String)
|
50
|
-
# * :metadata (String)
|
51
|
-
# * :event_start_time (String)
|
52
|
-
# * :event_end_time (String)
|
53
|
-
# * :event_title (String)
|
54
|
-
# * :event_description (String)
|
55
|
-
# * :lat_long (Hash)
|
56
|
-
# * :lat (Float)
|
57
|
-
# * :lng (Float)
|
58
|
-
# @param fallback [Hash] Request of type Pinnacle::Send::RcsFallback, as a Hash
|
59
|
-
# * :from (String)
|
60
|
-
# * :text (String)
|
61
|
-
# * :media_urls (Array<String>)
|
62
|
-
# @param status_callback [String] Optional URL to receive a POST request when the message status changes. Read
|
63
|
-
# more about status callbacks [here](/api-reference/receive-msg-statuses).
|
64
|
-
# @param request_options [Pinnacle::RequestOptions]
|
65
|
-
# @return [Pinnacle::Send::SendRcsResponse]
|
66
|
-
# @example
|
67
|
-
# api = Pinnacle::Client.new(
|
68
|
-
# base_url: "https://api.example.com",
|
69
|
-
# environment: Pinnacle::Environment::DEFAULT,
|
70
|
-
# api_key: "YOUR_API_KEY"
|
71
|
-
# )
|
72
|
-
# api.send.rcs(from: "from", to: "to")
|
73
|
-
def rcs(from:, to:, text: nil, media_url: nil, cards: nil, quick_replies: nil, fallback: nil, status_callback: nil,
|
74
|
-
request_options: nil)
|
75
|
-
response = @request_client.conn.post 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
|
-
req.body = {
|
87
|
-
**(request_options&.additional_body_parameters || {}),
|
88
|
-
from: from,
|
89
|
-
to: to,
|
90
|
-
text: text,
|
91
|
-
mediaUrl: media_url,
|
92
|
-
cards: cards,
|
93
|
-
quickReplies: quick_replies,
|
94
|
-
fallback: fallback,
|
95
|
-
statusCallback: status_callback
|
96
|
-
}.compact
|
97
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/send/rcs"
|
98
|
-
end
|
99
|
-
Pinnacle::Send::SendRcsResponse.from_json(json_object: response.body)
|
100
|
-
end
|
101
|
-
|
102
|
-
# Send an SMS message to a recipient.
|
103
|
-
#
|
104
|
-
# @param to [String] The recipient's phone number in E.164 format (e.g., +12345678901).
|
105
|
-
# @param from [String] The sender's phone number in E.164 format. Must be owned by the user.
|
106
|
-
# @param text [String] The SMS message content (max 1600 characters).
|
107
|
-
# @param status_callback [String] Optional URL to receive a POST request when the message status changes. Read
|
108
|
-
# more about status callbacks [here](/api-reference/receive-msg-statuses).
|
109
|
-
# @param request_options [Pinnacle::RequestOptions]
|
110
|
-
# @return [Pinnacle::Send::SendSmsResponse]
|
111
|
-
# @example
|
112
|
-
# api = Pinnacle::Client.new(
|
113
|
-
# base_url: "https://api.example.com",
|
114
|
-
# environment: Pinnacle::Environment::DEFAULT,
|
115
|
-
# api_key: "YOUR_API_KEY"
|
116
|
-
# )
|
117
|
-
# api.send.sms(
|
118
|
-
# to: "to",
|
119
|
-
# from: "from",
|
120
|
-
# text: "text"
|
121
|
-
# )
|
122
|
-
def sms(to:, from:, text:, status_callback: nil, request_options: nil)
|
123
|
-
response = @request_client.conn.post do |req|
|
124
|
-
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
125
|
-
req.headers["PINNACLE-API-Key"] = request_options.api_key unless request_options&.api_key.nil?
|
126
|
-
req.headers = {
|
127
|
-
**(req.headers || {}),
|
128
|
-
**@request_client.get_headers,
|
129
|
-
**(request_options&.additional_headers || {})
|
130
|
-
}.compact
|
131
|
-
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
132
|
-
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
133
|
-
end
|
134
|
-
req.body = {
|
135
|
-
**(request_options&.additional_body_parameters || {}),
|
136
|
-
to: to,
|
137
|
-
from: from,
|
138
|
-
text: text,
|
139
|
-
statusCallback: status_callback
|
140
|
-
}.compact
|
141
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/send/sms"
|
142
|
-
end
|
143
|
-
Pinnacle::Send::SendSmsResponse.from_json(json_object: response.body)
|
144
|
-
end
|
145
|
-
|
146
|
-
# Send an MMS message with media attachments.
|
147
|
-
#
|
148
|
-
# @param to [String] The recipient's phone number in E.164 format (e.g., +12345678901).
|
149
|
-
# @param from [String] The sender's phone number in E.164 format. Must be owned by the user.
|
150
|
-
# @param text [String] The MMS message content (max 1600 characters).
|
151
|
-
# @param media_urls [Array<String>] The URLs of media to include. `jpeg`, `jpg`, `gif`, and `png` file types are
|
152
|
-
# fully supported and have a size limit of 5 MB. 500 KB limit for other types. Up
|
153
|
-
# to 10 media URLs can be included.
|
154
|
-
# @param status_callback [String] Optional URL to receive a POST request when the message status changes. Read
|
155
|
-
# more about status callbacks [here](/api-reference/receive-msg-statuses).
|
156
|
-
# @param request_options [Pinnacle::RequestOptions]
|
157
|
-
# @return [Pinnacle::Send::SendMmsResponse]
|
158
|
-
# @example
|
159
|
-
# api = Pinnacle::Client.new(
|
160
|
-
# base_url: "https://api.example.com",
|
161
|
-
# environment: Pinnacle::Environment::DEFAULT,
|
162
|
-
# api_key: "YOUR_API_KEY"
|
163
|
-
# )
|
164
|
-
# api.send.mms(
|
165
|
-
# to: "to",
|
166
|
-
# from: "from",
|
167
|
-
# media_urls: ["https://example.com/image1.jpg", "https://example.com/video.mp4"]
|
168
|
-
# )
|
169
|
-
def mms(to:, from:, media_urls:, text: nil, status_callback: nil, request_options: nil)
|
170
|
-
response = @request_client.conn.post 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
|
-
req.body = {
|
182
|
-
**(request_options&.additional_body_parameters || {}),
|
183
|
-
to: to,
|
184
|
-
from: from,
|
185
|
-
text: text,
|
186
|
-
mediaUrls: media_urls,
|
187
|
-
statusCallback: status_callback
|
188
|
-
}.compact
|
189
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/send/mms"
|
190
|
-
end
|
191
|
-
Pinnacle::Send::SendMmsResponse.from_json(json_object: response.body)
|
192
|
-
end
|
193
|
-
end
|
194
|
-
|
195
|
-
class AsyncSendClient
|
196
|
-
# @return [Pinnacle::AsyncRequestClient]
|
197
|
-
attr_reader :request_client
|
198
|
-
|
199
|
-
# @param request_client [Pinnacle::AsyncRequestClient]
|
200
|
-
# @return [Pinnacle::AsyncSendClient]
|
201
|
-
def initialize(request_client:)
|
202
|
-
@request_client = request_client
|
203
|
-
end
|
204
|
-
|
205
|
-
# Send an interactive RCS message with text, media, or cards. Each message can
|
206
|
-
# only contain either text, media, or card(s).
|
207
|
-
# Quick replies can also be added to the message.
|
208
|
-
#
|
209
|
-
# @param from [String] The id of the RCS agent sending the message.
|
210
|
-
# Use 'test' if you want to send from the Pinnacle test agent. The test agent can
|
211
|
-
# only send to whitelisted test numbers.
|
212
|
-
# See https://dashboard.trypinnacle.app/settings/test-numbers to whitelist a
|
213
|
-
# number.
|
214
|
-
# @param to [String] The recipient's RCS-enabled phone number in E.164 format (e.g., +12345678901).
|
215
|
-
# @param text [String] Text content of the message.
|
216
|
-
# Make sure you have either 'text', 'mediaUrl', or 'cards'. An error will be
|
217
|
-
# thrown if multiple (i.e. both 'text' and 'mediaUrl') is provided.
|
218
|
-
# @param media_url [String] Media URL to be included in the message.
|
219
|
-
# Make sure you have either 'text', 'mediaUrl', or 'cards'. An error will be
|
220
|
-
# thrown if multiple (i.e. both 'text' and 'mediaUrl') is provided.
|
221
|
-
# @param cards [Array<Hash>] List of rich cards. Maximum of 10 cards.
|
222
|
-
# Make sure you have either 'text', 'mediaUrl', or 'cards'. An error will be
|
223
|
-
# thrown if multiple (i.e. both 'text' and 'mediaUrl') is provided.Request of type Array<Pinnacle::Card>, as a Hash
|
224
|
-
# * :title (String)
|
225
|
-
# * :subtitle (String)
|
226
|
-
# * :media_url (String)
|
227
|
-
# * :buttons (Array<Pinnacle::Action>)
|
228
|
-
# @param quick_replies [Array<Hash>] Optional list of quick reply actions (max 10).Request of type Array<Pinnacle::Action>, as a Hash
|
229
|
-
# * :title (String)
|
230
|
-
# * :type (Pinnacle::ActionType)
|
231
|
-
# * :payload (String)
|
232
|
-
# * :metadata (String)
|
233
|
-
# * :event_start_time (String)
|
234
|
-
# * :event_end_time (String)
|
235
|
-
# * :event_title (String)
|
236
|
-
# * :event_description (String)
|
237
|
-
# * :lat_long (Hash)
|
238
|
-
# * :lat (Float)
|
239
|
-
# * :lng (Float)
|
240
|
-
# @param fallback [Hash] Request of type Pinnacle::Send::RcsFallback, as a Hash
|
241
|
-
# * :from (String)
|
242
|
-
# * :text (String)
|
243
|
-
# * :media_urls (Array<String>)
|
244
|
-
# @param status_callback [String] Optional URL to receive a POST request when the message status changes. Read
|
245
|
-
# more about status callbacks [here](/api-reference/receive-msg-statuses).
|
246
|
-
# @param request_options [Pinnacle::RequestOptions]
|
247
|
-
# @return [Pinnacle::Send::SendRcsResponse]
|
248
|
-
# @example
|
249
|
-
# api = Pinnacle::Client.new(
|
250
|
-
# base_url: "https://api.example.com",
|
251
|
-
# environment: Pinnacle::Environment::DEFAULT,
|
252
|
-
# api_key: "YOUR_API_KEY"
|
253
|
-
# )
|
254
|
-
# api.send.rcs(from: "from", to: "to")
|
255
|
-
def rcs(from:, to:, text: nil, media_url: nil, cards: nil, quick_replies: nil, fallback: nil, status_callback: nil,
|
256
|
-
request_options: nil)
|
257
|
-
Async do
|
258
|
-
response = @request_client.conn.post do |req|
|
259
|
-
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
260
|
-
req.headers["PINNACLE-API-Key"] = request_options.api_key unless request_options&.api_key.nil?
|
261
|
-
req.headers = {
|
262
|
-
**(req.headers || {}),
|
263
|
-
**@request_client.get_headers,
|
264
|
-
**(request_options&.additional_headers || {})
|
265
|
-
}.compact
|
266
|
-
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
267
|
-
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
268
|
-
end
|
269
|
-
req.body = {
|
270
|
-
**(request_options&.additional_body_parameters || {}),
|
271
|
-
from: from,
|
272
|
-
to: to,
|
273
|
-
text: text,
|
274
|
-
mediaUrl: media_url,
|
275
|
-
cards: cards,
|
276
|
-
quickReplies: quick_replies,
|
277
|
-
fallback: fallback,
|
278
|
-
statusCallback: status_callback
|
279
|
-
}.compact
|
280
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/send/rcs"
|
281
|
-
end
|
282
|
-
Pinnacle::Send::SendRcsResponse.from_json(json_object: response.body)
|
283
|
-
end
|
284
|
-
end
|
285
|
-
|
286
|
-
# Send an SMS message to a recipient.
|
287
|
-
#
|
288
|
-
# @param to [String] The recipient's phone number in E.164 format (e.g., +12345678901).
|
289
|
-
# @param from [String] The sender's phone number in E.164 format. Must be owned by the user.
|
290
|
-
# @param text [String] The SMS message content (max 1600 characters).
|
291
|
-
# @param status_callback [String] Optional URL to receive a POST request when the message status changes. Read
|
292
|
-
# more about status callbacks [here](/api-reference/receive-msg-statuses).
|
293
|
-
# @param request_options [Pinnacle::RequestOptions]
|
294
|
-
# @return [Pinnacle::Send::SendSmsResponse]
|
295
|
-
# @example
|
296
|
-
# api = Pinnacle::Client.new(
|
297
|
-
# base_url: "https://api.example.com",
|
298
|
-
# environment: Pinnacle::Environment::DEFAULT,
|
299
|
-
# api_key: "YOUR_API_KEY"
|
300
|
-
# )
|
301
|
-
# api.send.sms(
|
302
|
-
# to: "to",
|
303
|
-
# from: "from",
|
304
|
-
# text: "text"
|
305
|
-
# )
|
306
|
-
def sms(to:, from:, text:, status_callback: nil, request_options: nil)
|
307
|
-
Async do
|
308
|
-
response = @request_client.conn.post do |req|
|
309
|
-
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
310
|
-
req.headers["PINNACLE-API-Key"] = request_options.api_key unless request_options&.api_key.nil?
|
311
|
-
req.headers = {
|
312
|
-
**(req.headers || {}),
|
313
|
-
**@request_client.get_headers,
|
314
|
-
**(request_options&.additional_headers || {})
|
315
|
-
}.compact
|
316
|
-
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
317
|
-
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
318
|
-
end
|
319
|
-
req.body = {
|
320
|
-
**(request_options&.additional_body_parameters || {}),
|
321
|
-
to: to,
|
322
|
-
from: from,
|
323
|
-
text: text,
|
324
|
-
statusCallback: status_callback
|
325
|
-
}.compact
|
326
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/send/sms"
|
327
|
-
end
|
328
|
-
Pinnacle::Send::SendSmsResponse.from_json(json_object: response.body)
|
329
|
-
end
|
330
|
-
end
|
331
|
-
|
332
|
-
# Send an MMS message with media attachments.
|
333
|
-
#
|
334
|
-
# @param to [String] The recipient's phone number in E.164 format (e.g., +12345678901).
|
335
|
-
# @param from [String] The sender's phone number in E.164 format. Must be owned by the user.
|
336
|
-
# @param text [String] The MMS message content (max 1600 characters).
|
337
|
-
# @param media_urls [Array<String>] The URLs of media to include. `jpeg`, `jpg`, `gif`, and `png` file types are
|
338
|
-
# fully supported and have a size limit of 5 MB. 500 KB limit for other types. Up
|
339
|
-
# to 10 media URLs can be included.
|
340
|
-
# @param status_callback [String] Optional URL to receive a POST request when the message status changes. Read
|
341
|
-
# more about status callbacks [here](/api-reference/receive-msg-statuses).
|
342
|
-
# @param request_options [Pinnacle::RequestOptions]
|
343
|
-
# @return [Pinnacle::Send::SendMmsResponse]
|
344
|
-
# @example
|
345
|
-
# api = Pinnacle::Client.new(
|
346
|
-
# base_url: "https://api.example.com",
|
347
|
-
# environment: Pinnacle::Environment::DEFAULT,
|
348
|
-
# api_key: "YOUR_API_KEY"
|
349
|
-
# )
|
350
|
-
# api.send.mms(
|
351
|
-
# to: "to",
|
352
|
-
# from: "from",
|
353
|
-
# media_urls: ["https://example.com/image1.jpg", "https://example.com/video.mp4"]
|
354
|
-
# )
|
355
|
-
def mms(to:, from:, media_urls:, text: nil, status_callback: nil, request_options: nil)
|
356
|
-
Async do
|
357
|
-
response = @request_client.conn.post do |req|
|
358
|
-
req.options.timeout = request_options.timeout_in_seconds unless request_options&.timeout_in_seconds.nil?
|
359
|
-
req.headers["PINNACLE-API-Key"] = request_options.api_key unless request_options&.api_key.nil?
|
360
|
-
req.headers = {
|
361
|
-
**(req.headers || {}),
|
362
|
-
**@request_client.get_headers,
|
363
|
-
**(request_options&.additional_headers || {})
|
364
|
-
}.compact
|
365
|
-
unless request_options.nil? || request_options&.additional_query_parameters.nil?
|
366
|
-
req.params = { **(request_options&.additional_query_parameters || {}) }.compact
|
367
|
-
end
|
368
|
-
req.body = {
|
369
|
-
**(request_options&.additional_body_parameters || {}),
|
370
|
-
to: to,
|
371
|
-
from: from,
|
372
|
-
text: text,
|
373
|
-
mediaUrls: media_urls,
|
374
|
-
statusCallback: status_callback
|
375
|
-
}.compact
|
376
|
-
req.url "#{@request_client.get_url(request_options: request_options)}/send/mms"
|
377
|
-
end
|
378
|
-
Pinnacle::Send::SendMmsResponse.from_json(json_object: response.body)
|
379
|
-
end
|
380
|
-
end
|
381
|
-
end
|
382
|
-
end
|
@@ -1,84 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "ostruct"
|
4
|
-
require "json"
|
5
|
-
|
6
|
-
module Pinnacle
|
7
|
-
class Send
|
8
|
-
class RcsFallback
|
9
|
-
# @return [String] The sender's phone number in E.164 format. Must be owned by the user.
|
10
|
-
attr_reader :from
|
11
|
-
# @return [String] The fallback message content (max 1600 characters). One of 'text' or 'mediaUrls'
|
12
|
-
# must be provided.
|
13
|
-
attr_reader :text
|
14
|
-
# @return [Array<String>] The URLs of media to include. One of 'text' or 'mediaUrls' must be provided.
|
15
|
-
# `jpeg`, `jpg`, `gif`, and `png` file types are fully supported and have a size
|
16
|
-
# limit of 5 MB. 500 KB limit for other types. Up to 10 media URLs can be
|
17
|
-
# included.
|
18
|
-
attr_reader :media_urls
|
19
|
-
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
20
|
-
attr_reader :additional_properties
|
21
|
-
# @return [Object]
|
22
|
-
attr_reader :_field_set
|
23
|
-
protected :_field_set
|
24
|
-
|
25
|
-
OMIT = Object.new
|
26
|
-
|
27
|
-
# @param from [String] The sender's phone number in E.164 format. Must be owned by the user.
|
28
|
-
# @param text [String] The fallback message content (max 1600 characters). One of 'text' or 'mediaUrls'
|
29
|
-
# must be provided.
|
30
|
-
# @param media_urls [Array<String>] The URLs of media to include. One of 'text' or 'mediaUrls' must be provided.
|
31
|
-
# `jpeg`, `jpg`, `gif`, and `png` file types are fully supported and have a size
|
32
|
-
# limit of 5 MB. 500 KB limit for other types. Up to 10 media URLs can be
|
33
|
-
# included.
|
34
|
-
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
35
|
-
# @return [Pinnacle::Send::RcsFallback]
|
36
|
-
def initialize(from: OMIT, text: OMIT, media_urls: OMIT, additional_properties: nil)
|
37
|
-
@from = from if from != OMIT
|
38
|
-
@text = text if text != OMIT
|
39
|
-
@media_urls = media_urls if media_urls != OMIT
|
40
|
-
@additional_properties = additional_properties
|
41
|
-
@_field_set = { "from": from, "text": text, "mediaUrls": media_urls }.reject do |_k, v|
|
42
|
-
v == OMIT
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
# Deserialize a JSON object to an instance of RcsFallback
|
47
|
-
#
|
48
|
-
# @param json_object [String]
|
49
|
-
# @return [Pinnacle::Send::RcsFallback]
|
50
|
-
def self.from_json(json_object:)
|
51
|
-
struct = JSON.parse(json_object, object_class: OpenStruct)
|
52
|
-
parsed_json = JSON.parse(json_object)
|
53
|
-
from = parsed_json["from"]
|
54
|
-
text = parsed_json["text"]
|
55
|
-
media_urls = parsed_json["mediaUrls"]
|
56
|
-
new(
|
57
|
-
from: from,
|
58
|
-
text: text,
|
59
|
-
media_urls: media_urls,
|
60
|
-
additional_properties: struct
|
61
|
-
)
|
62
|
-
end
|
63
|
-
|
64
|
-
# Serialize an instance of RcsFallback to a JSON object
|
65
|
-
#
|
66
|
-
# @return [String]
|
67
|
-
def to_json(*_args)
|
68
|
-
@_field_set&.to_json
|
69
|
-
end
|
70
|
-
|
71
|
-
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
72
|
-
# hash and check each fields type against the current object's property
|
73
|
-
# definitions.
|
74
|
-
#
|
75
|
-
# @param obj [Object]
|
76
|
-
# @return [Void]
|
77
|
-
def self.validate_raw(obj:)
|
78
|
-
obj.from&.is_a?(String) != false || raise("Passed value for field obj.from is not the expected type, validation failed.")
|
79
|
-
obj.text&.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.")
|
80
|
-
obj.media_urls&.is_a?(Array) != false || raise("Passed value for field obj.media_urls is not the expected type, validation failed.")
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|
@@ -1,70 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "date"
|
4
|
-
require "ostruct"
|
5
|
-
require "json"
|
6
|
-
|
7
|
-
module Pinnacle
|
8
|
-
class Tools
|
9
|
-
class ToolsShortenUrlResponse
|
10
|
-
# @return [String] The shortened URL.
|
11
|
-
attr_reader :shortened_url
|
12
|
-
# @return [DateTime] The expiration date of the shortened URL, if provided.
|
13
|
-
attr_reader :expires_at
|
14
|
-
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
-
attr_reader :additional_properties
|
16
|
-
# @return [Object]
|
17
|
-
attr_reader :_field_set
|
18
|
-
protected :_field_set
|
19
|
-
|
20
|
-
OMIT = Object.new
|
21
|
-
|
22
|
-
# @param shortened_url [String] The shortened URL.
|
23
|
-
# @param expires_at [DateTime] The expiration date of the shortened URL, if provided.
|
24
|
-
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
25
|
-
# @return [Pinnacle::Tools::ToolsShortenUrlResponse]
|
26
|
-
def initialize(shortened_url: OMIT, expires_at: OMIT, additional_properties: nil)
|
27
|
-
@shortened_url = shortened_url if shortened_url != OMIT
|
28
|
-
@expires_at = expires_at if expires_at != OMIT
|
29
|
-
@additional_properties = additional_properties
|
30
|
-
@_field_set = { "shortenedUrl": shortened_url, "expiresAt": expires_at }.reject do |_k, v|
|
31
|
-
v == OMIT
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
# Deserialize a JSON object to an instance of ToolsShortenUrlResponse
|
36
|
-
#
|
37
|
-
# @param json_object [String]
|
38
|
-
# @return [Pinnacle::Tools::ToolsShortenUrlResponse]
|
39
|
-
def self.from_json(json_object:)
|
40
|
-
struct = JSON.parse(json_object, object_class: OpenStruct)
|
41
|
-
parsed_json = JSON.parse(json_object)
|
42
|
-
shortened_url = parsed_json["shortenedUrl"]
|
43
|
-
expires_at = (DateTime.parse(parsed_json["expiresAt"]) unless parsed_json["expiresAt"].nil?)
|
44
|
-
new(
|
45
|
-
shortened_url: shortened_url,
|
46
|
-
expires_at: expires_at,
|
47
|
-
additional_properties: struct
|
48
|
-
)
|
49
|
-
end
|
50
|
-
|
51
|
-
# Serialize an instance of ToolsShortenUrlResponse to a JSON object
|
52
|
-
#
|
53
|
-
# @return [String]
|
54
|
-
def to_json(*_args)
|
55
|
-
@_field_set&.to_json
|
56
|
-
end
|
57
|
-
|
58
|
-
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
59
|
-
# hash and check each fields type against the current object's property
|
60
|
-
# definitions.
|
61
|
-
#
|
62
|
-
# @param obj [Object]
|
63
|
-
# @return [Void]
|
64
|
-
def self.validate_raw(obj:)
|
65
|
-
obj.shortened_url&.is_a?(String) != false || raise("Passed value for field obj.shortened_url is not the expected type, validation failed.")
|
66
|
-
obj.expires_at&.is_a?(DateTime) != false || raise("Passed value for field obj.expires_at is not the expected type, validation failed.")
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
@@ -1,69 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "ostruct"
|
4
|
-
require "json"
|
5
|
-
|
6
|
-
module Pinnacle
|
7
|
-
class Tools
|
8
|
-
class ToolsUploadUrlResponse
|
9
|
-
# @return [String] The URL to upload the file.
|
10
|
-
attr_reader :upload
|
11
|
-
# @return [String] The URL to download the file.
|
12
|
-
attr_reader :download
|
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 upload [String] The URL to upload the file.
|
22
|
-
# @param download [String] The URL to download the file.
|
23
|
-
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
24
|
-
# @return [Pinnacle::Tools::ToolsUploadUrlResponse]
|
25
|
-
def initialize(upload: OMIT, download: OMIT, additional_properties: nil)
|
26
|
-
@upload = upload if upload != OMIT
|
27
|
-
@download = download if download != OMIT
|
28
|
-
@additional_properties = additional_properties
|
29
|
-
@_field_set = { "upload": upload, "download": download }.reject do |_k, v|
|
30
|
-
v == OMIT
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
# Deserialize a JSON object to an instance of ToolsUploadUrlResponse
|
35
|
-
#
|
36
|
-
# @param json_object [String]
|
37
|
-
# @return [Pinnacle::Tools::ToolsUploadUrlResponse]
|
38
|
-
def self.from_json(json_object:)
|
39
|
-
struct = JSON.parse(json_object, object_class: OpenStruct)
|
40
|
-
parsed_json = JSON.parse(json_object)
|
41
|
-
upload = parsed_json["upload"]
|
42
|
-
download = parsed_json["download"]
|
43
|
-
new(
|
44
|
-
upload: upload,
|
45
|
-
download: download,
|
46
|
-
additional_properties: struct
|
47
|
-
)
|
48
|
-
end
|
49
|
-
|
50
|
-
# Serialize an instance of ToolsUploadUrlResponse to a JSON object
|
51
|
-
#
|
52
|
-
# @return [String]
|
53
|
-
def to_json(*_args)
|
54
|
-
@_field_set&.to_json
|
55
|
-
end
|
56
|
-
|
57
|
-
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
58
|
-
# hash and check each fields type against the current object's property
|
59
|
-
# definitions.
|
60
|
-
#
|
61
|
-
# @param obj [Object]
|
62
|
-
# @return [Void]
|
63
|
-
def self.validate_raw(obj:)
|
64
|
-
obj.upload&.is_a?(String) != false || raise("Passed value for field obj.upload is not the expected type, validation failed.")
|
65
|
-
obj.download&.is_a?(String) != false || raise("Passed value for field obj.download is not the expected type, validation failed.")
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|