rcs 1.0.17 → 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,88 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "rcs_button_content"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module Pinnacle
|
8
|
+
module Types
|
9
|
+
# Individual card containing title, optional media, and action buttons.
|
10
|
+
class RcsCardsCardsItem
|
11
|
+
# @return [Array<Pinnacle::Types::RcsButtonContent>] Action buttons attached to the card.
|
12
|
+
attr_reader :buttons
|
13
|
+
# @return [String] Media file URLs to send.
|
14
|
+
attr_reader :media
|
15
|
+
# @return [String] Secondary text displayed below the title for additional context.
|
16
|
+
attr_reader :subtitle
|
17
|
+
# @return [String] Title displayed on the card.
|
18
|
+
attr_reader :title
|
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 buttons [Array<Pinnacle::Types::RcsButtonContent>] Action buttons attached to the card.
|
28
|
+
# @param media [String] Media file URLs to send.
|
29
|
+
# @param subtitle [String] Secondary text displayed below the title for additional context.
|
30
|
+
# @param title [String] Title displayed on the card.
|
31
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
32
|
+
# @return [Pinnacle::Types::RcsCardsCardsItem]
|
33
|
+
def initialize(buttons:, title:, media: OMIT, subtitle: OMIT, additional_properties: nil)
|
34
|
+
@buttons = buttons
|
35
|
+
@media = media if media != OMIT
|
36
|
+
@subtitle = subtitle if subtitle != OMIT
|
37
|
+
@title = title
|
38
|
+
@additional_properties = additional_properties
|
39
|
+
@_field_set = { "buttons": buttons, "media": media, "subtitle": subtitle, "title": title }.reject do |_k, v|
|
40
|
+
v == OMIT
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# Deserialize a JSON object to an instance of RcsCardsCardsItem
|
45
|
+
#
|
46
|
+
# @param json_object [String]
|
47
|
+
# @return [Pinnacle::Types::RcsCardsCardsItem]
|
48
|
+
def self.from_json(json_object:)
|
49
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
50
|
+
parsed_json = JSON.parse(json_object)
|
51
|
+
buttons = parsed_json["buttons"]&.map do |item|
|
52
|
+
item = item.to_json
|
53
|
+
Pinnacle::Types::RcsButtonContent.from_json(json_object: item)
|
54
|
+
end
|
55
|
+
media = parsed_json["media"]
|
56
|
+
subtitle = parsed_json["subtitle"]
|
57
|
+
title = parsed_json["title"]
|
58
|
+
new(
|
59
|
+
buttons: buttons,
|
60
|
+
media: media,
|
61
|
+
subtitle: subtitle,
|
62
|
+
title: title,
|
63
|
+
additional_properties: struct
|
64
|
+
)
|
65
|
+
end
|
66
|
+
|
67
|
+
# Serialize an instance of RcsCardsCardsItem to a JSON object
|
68
|
+
#
|
69
|
+
# @return [String]
|
70
|
+
def to_json(*_args)
|
71
|
+
@_field_set&.to_json
|
72
|
+
end
|
73
|
+
|
74
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
75
|
+
# hash and check each fields type against the current object's property
|
76
|
+
# definitions.
|
77
|
+
#
|
78
|
+
# @param obj [Object]
|
79
|
+
# @return [Void]
|
80
|
+
def self.validate_raw(obj:)
|
81
|
+
obj.buttons.is_a?(Array) != false || raise("Passed value for field obj.buttons is not the expected type, validation failed.")
|
82
|
+
obj.media&.is_a?(String) != false || raise("Passed value for field obj.media is not the expected type, validation failed.")
|
83
|
+
obj.subtitle&.is_a?(String) != false || raise("Passed value for field obj.subtitle is not the expected type, validation failed.")
|
84
|
+
obj.title.is_a?(String) != false || raise("Passed value for field obj.title is not the expected type, validation failed.")
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "rcs_cards_content_cards_item"
|
4
|
+
require_relative "rcs_button_content"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module Pinnacle
|
9
|
+
module Types
|
10
|
+
# Message containing cards, each with its own title, subtitle, and/or buttons.
|
11
|
+
# Quick replies can also be added. <br>
|
12
|
+
# See (supported file
|
13
|
+
# types)[https://app.pinnacle.sh/supported-file-types?type=RCS-CARD].
|
14
|
+
class RcsCardsContent
|
15
|
+
# @return [Array<Pinnacle::Types::RcsCardsContentCardsItem>] Collection of cards attached to the message.
|
16
|
+
attr_reader :cards
|
17
|
+
# @return [Array<Pinnacle::Types::RcsButtonContent>] List of interactive quick reply buttons in the message.
|
18
|
+
attr_reader :quick_replies
|
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 cards [Array<Pinnacle::Types::RcsCardsContentCardsItem>] Collection of cards attached to the message.
|
28
|
+
# @param quick_replies [Array<Pinnacle::Types::RcsButtonContent>] List of interactive quick reply buttons in the message.
|
29
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
30
|
+
# @return [Pinnacle::Types::RcsCardsContent]
|
31
|
+
def initialize(cards:, quick_replies:, additional_properties: nil)
|
32
|
+
@cards = cards
|
33
|
+
@quick_replies = quick_replies
|
34
|
+
@additional_properties = additional_properties
|
35
|
+
@_field_set = { "cards": cards, "quickReplies": quick_replies }
|
36
|
+
end
|
37
|
+
|
38
|
+
# Deserialize a JSON object to an instance of RcsCardsContent
|
39
|
+
#
|
40
|
+
# @param json_object [String]
|
41
|
+
# @return [Pinnacle::Types::RcsCardsContent]
|
42
|
+
def self.from_json(json_object:)
|
43
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
44
|
+
parsed_json = JSON.parse(json_object)
|
45
|
+
cards = parsed_json["cards"]&.map do |item|
|
46
|
+
item = item.to_json
|
47
|
+
Pinnacle::Types::RcsCardsContentCardsItem.from_json(json_object: item)
|
48
|
+
end
|
49
|
+
quick_replies = parsed_json["quickReplies"]&.map do |item|
|
50
|
+
item = item.to_json
|
51
|
+
Pinnacle::Types::RcsButtonContent.from_json(json_object: item)
|
52
|
+
end
|
53
|
+
new(
|
54
|
+
cards: cards,
|
55
|
+
quick_replies: quick_replies,
|
56
|
+
additional_properties: struct
|
57
|
+
)
|
58
|
+
end
|
59
|
+
|
60
|
+
# Serialize an instance of RcsCardsContent to a JSON object
|
61
|
+
#
|
62
|
+
# @return [String]
|
63
|
+
def to_json(*_args)
|
64
|
+
@_field_set&.to_json
|
65
|
+
end
|
66
|
+
|
67
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
68
|
+
# hash and check each fields type against the current object's property
|
69
|
+
# definitions.
|
70
|
+
#
|
71
|
+
# @param obj [Object]
|
72
|
+
# @return [Void]
|
73
|
+
def self.validate_raw(obj:)
|
74
|
+
obj.cards.is_a?(Array) != false || raise("Passed value for field obj.cards is not the expected type, validation failed.")
|
75
|
+
obj.quick_replies.is_a?(Array) != false || raise("Passed value for field obj.quick_replies is not the expected type, validation failed.")
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "rcs_button_content"
|
4
|
+
require_relative "rcs_media_details_content"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module Pinnacle
|
9
|
+
module Types
|
10
|
+
# Individual card containing title, optional media, and action buttons.
|
11
|
+
class RcsCardsContentCardsItem
|
12
|
+
# @return [Array<Pinnacle::Types::RcsButtonContent>] Action buttons attached to the card.
|
13
|
+
attr_reader :buttons
|
14
|
+
# @return [Pinnacle::Types::RcsMediaDetailsContent]
|
15
|
+
attr_reader :media
|
16
|
+
# @return [String] Secondary text displayed below the title for additional context.
|
17
|
+
attr_reader :subtitle
|
18
|
+
# @return [String] Title displayed on the card.
|
19
|
+
attr_reader :title
|
20
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
21
|
+
attr_reader :additional_properties
|
22
|
+
# @return [Object]
|
23
|
+
attr_reader :_field_set
|
24
|
+
protected :_field_set
|
25
|
+
|
26
|
+
OMIT = Object.new
|
27
|
+
|
28
|
+
# @param buttons [Array<Pinnacle::Types::RcsButtonContent>] Action buttons attached to the card.
|
29
|
+
# @param media [Pinnacle::Types::RcsMediaDetailsContent]
|
30
|
+
# @param subtitle [String] Secondary text displayed below the title for additional context.
|
31
|
+
# @param title [String] Title displayed on the card.
|
32
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
33
|
+
# @return [Pinnacle::Types::RcsCardsContentCardsItem]
|
34
|
+
def initialize(buttons:, title:, media: OMIT, subtitle: OMIT, additional_properties: nil)
|
35
|
+
@buttons = buttons
|
36
|
+
@media = media if media != OMIT
|
37
|
+
@subtitle = subtitle if subtitle != OMIT
|
38
|
+
@title = title
|
39
|
+
@additional_properties = additional_properties
|
40
|
+
@_field_set = { "buttons": buttons, "media": media, "subtitle": subtitle, "title": title }.reject do |_k, v|
|
41
|
+
v == OMIT
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# Deserialize a JSON object to an instance of RcsCardsContentCardsItem
|
46
|
+
#
|
47
|
+
# @param json_object [String]
|
48
|
+
# @return [Pinnacle::Types::RcsCardsContentCardsItem]
|
49
|
+
def self.from_json(json_object:)
|
50
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
51
|
+
parsed_json = JSON.parse(json_object)
|
52
|
+
buttons = parsed_json["buttons"]&.map do |item|
|
53
|
+
item = item.to_json
|
54
|
+
Pinnacle::Types::RcsButtonContent.from_json(json_object: item)
|
55
|
+
end
|
56
|
+
if parsed_json["media"].nil?
|
57
|
+
media = nil
|
58
|
+
else
|
59
|
+
media = parsed_json["media"].to_json
|
60
|
+
media = Pinnacle::Types::RcsMediaDetailsContent.from_json(json_object: media)
|
61
|
+
end
|
62
|
+
subtitle = parsed_json["subtitle"]
|
63
|
+
title = parsed_json["title"]
|
64
|
+
new(
|
65
|
+
buttons: buttons,
|
66
|
+
media: media,
|
67
|
+
subtitle: subtitle,
|
68
|
+
title: title,
|
69
|
+
additional_properties: struct
|
70
|
+
)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Serialize an instance of RcsCardsContentCardsItem to a JSON object
|
74
|
+
#
|
75
|
+
# @return [String]
|
76
|
+
def to_json(*_args)
|
77
|
+
@_field_set&.to_json
|
78
|
+
end
|
79
|
+
|
80
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
81
|
+
# hash and check each fields type against the current object's property
|
82
|
+
# definitions.
|
83
|
+
#
|
84
|
+
# @param obj [Object]
|
85
|
+
# @return [Void]
|
86
|
+
def self.validate_raw(obj:)
|
87
|
+
obj.buttons.is_a?(Array) != false || raise("Passed value for field obj.buttons is not the expected type, validation failed.")
|
88
|
+
obj.media.nil? || Pinnacle::Types::RcsMediaDetailsContent.validate_raw(obj: obj.media)
|
89
|
+
obj.subtitle&.is_a?(String) != false || raise("Passed value for field obj.subtitle is not the expected type, validation failed.")
|
90
|
+
obj.title.is_a?(String) != false || raise("Passed value for field obj.title is not the expected type, validation failed.")
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
require_relative "rcs_text_content"
|
5
|
+
require_relative "rcs_media_content"
|
6
|
+
require_relative "rcs_cards_content"
|
7
|
+
|
8
|
+
module Pinnacle
|
9
|
+
module Types
|
10
|
+
# Message with richer content (longer text, media files, cards, and buttons) from
|
11
|
+
# interacting with an RCS agent.
|
12
|
+
class RcsContent
|
13
|
+
# Deserialize a JSON object to an instance of RcsContent
|
14
|
+
#
|
15
|
+
# @param json_object [String]
|
16
|
+
# @return [Pinnacle::Types::RcsContent]
|
17
|
+
def self.from_json(json_object:)
|
18
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
19
|
+
begin
|
20
|
+
Pinnacle::Types::RcsTextContent.validate_raw(obj: struct)
|
21
|
+
return Pinnacle::Types::RcsTextContent.from_json(json_object: struct) unless struct.nil?
|
22
|
+
|
23
|
+
return nil
|
24
|
+
rescue StandardError
|
25
|
+
# noop
|
26
|
+
end
|
27
|
+
begin
|
28
|
+
Pinnacle::Types::RcsMediaContent.validate_raw(obj: struct)
|
29
|
+
return Pinnacle::Types::RcsMediaContent.from_json(json_object: struct) unless struct.nil?
|
30
|
+
|
31
|
+
return nil
|
32
|
+
rescue StandardError
|
33
|
+
# noop
|
34
|
+
end
|
35
|
+
begin
|
36
|
+
Pinnacle::Types::RcsCardsContent.validate_raw(obj: struct)
|
37
|
+
return Pinnacle::Types::RcsCardsContent.from_json(json_object: struct) unless struct.nil?
|
38
|
+
|
39
|
+
return nil
|
40
|
+
rescue StandardError
|
41
|
+
# noop
|
42
|
+
end
|
43
|
+
struct
|
44
|
+
end
|
45
|
+
|
46
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
47
|
+
# hash and check each fields type against the current object's property
|
48
|
+
# definitions.
|
49
|
+
#
|
50
|
+
# @param obj [Object]
|
51
|
+
# @return [Void]
|
52
|
+
def self.validate_raw(obj:)
|
53
|
+
begin
|
54
|
+
return Pinnacle::Types::RcsTextContent.validate_raw(obj: obj)
|
55
|
+
rescue StandardError
|
56
|
+
# noop
|
57
|
+
end
|
58
|
+
begin
|
59
|
+
return Pinnacle::Types::RcsMediaContent.validate_raw(obj: obj)
|
60
|
+
rescue StandardError
|
61
|
+
# noop
|
62
|
+
end
|
63
|
+
begin
|
64
|
+
return Pinnacle::Types::RcsCardsContent.validate_raw(obj: obj)
|
65
|
+
rescue StandardError
|
66
|
+
# noop
|
67
|
+
end
|
68
|
+
raise("Passed value matched no type within the union, validation failed.")
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,110 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "rcs_button_content"
|
4
|
+
require_relative "rcs_base_options"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module Pinnacle
|
9
|
+
module Types
|
10
|
+
class RcsMedia
|
11
|
+
# @return [String] Media file URLs to send. <br>
|
12
|
+
# See [supported media
|
13
|
+
# types](https://app.pinnacle.sh/supported-file-types?type=RCS-MEDIA).
|
14
|
+
attr_reader :media
|
15
|
+
# @return [Array<Pinnacle::Types::RcsButtonContent>] List of interactive quick reply buttons in the message.
|
16
|
+
attr_reader :quick_replies
|
17
|
+
# @return [String] Your RCS agent ID which must be prefixed with 'agent_'.
|
18
|
+
attr_reader :from
|
19
|
+
# @return [Pinnacle::Types::RcsBaseOptions] Configure how your RCS message is sent and tracked.
|
20
|
+
attr_reader :options
|
21
|
+
# @return [String] Recipient's phone number in E.164 format.
|
22
|
+
attr_reader :to
|
23
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
24
|
+
attr_reader :additional_properties
|
25
|
+
# @return [Object]
|
26
|
+
attr_reader :_field_set
|
27
|
+
protected :_field_set
|
28
|
+
|
29
|
+
OMIT = Object.new
|
30
|
+
|
31
|
+
# @param media [String] Media file URLs to send. <br>
|
32
|
+
# See [supported media
|
33
|
+
# types](https://app.pinnacle.sh/supported-file-types?type=RCS-MEDIA).
|
34
|
+
# @param quick_replies [Array<Pinnacle::Types::RcsButtonContent>] List of interactive quick reply buttons in the message.
|
35
|
+
# @param from [String] Your RCS agent ID which must be prefixed with 'agent_'.
|
36
|
+
# @param options [Pinnacle::Types::RcsBaseOptions] Configure how your RCS message is sent and tracked.
|
37
|
+
# @param to [String] Recipient's phone number in E.164 format.
|
38
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
39
|
+
# @return [Pinnacle::Types::RcsMedia]
|
40
|
+
def initialize(media:, quick_replies:, from:, to:, options: OMIT, additional_properties: nil)
|
41
|
+
@media = media
|
42
|
+
@quick_replies = quick_replies
|
43
|
+
@from = from
|
44
|
+
@options = options if options != OMIT
|
45
|
+
@to = to
|
46
|
+
@additional_properties = additional_properties
|
47
|
+
@_field_set = {
|
48
|
+
"media": media,
|
49
|
+
"quickReplies": quick_replies,
|
50
|
+
"from": from,
|
51
|
+
"options": options,
|
52
|
+
"to": to
|
53
|
+
}.reject do |_k, v|
|
54
|
+
v == OMIT
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# Deserialize a JSON object to an instance of RcsMedia
|
59
|
+
#
|
60
|
+
# @param json_object [String]
|
61
|
+
# @return [Pinnacle::Types::RcsMedia]
|
62
|
+
def self.from_json(json_object:)
|
63
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
64
|
+
parsed_json = JSON.parse(json_object)
|
65
|
+
media = parsed_json["media"]
|
66
|
+
quick_replies = parsed_json["quickReplies"]&.map do |item|
|
67
|
+
item = item.to_json
|
68
|
+
Pinnacle::Types::RcsButtonContent.from_json(json_object: item)
|
69
|
+
end
|
70
|
+
from = parsed_json["from"]
|
71
|
+
if parsed_json["options"].nil?
|
72
|
+
options = nil
|
73
|
+
else
|
74
|
+
options = parsed_json["options"].to_json
|
75
|
+
options = Pinnacle::Types::RcsBaseOptions.from_json(json_object: options)
|
76
|
+
end
|
77
|
+
to = parsed_json["to"]
|
78
|
+
new(
|
79
|
+
media: media,
|
80
|
+
quick_replies: quick_replies,
|
81
|
+
from: from,
|
82
|
+
options: options,
|
83
|
+
to: to,
|
84
|
+
additional_properties: struct
|
85
|
+
)
|
86
|
+
end
|
87
|
+
|
88
|
+
# Serialize an instance of RcsMedia to a JSON object
|
89
|
+
#
|
90
|
+
# @return [String]
|
91
|
+
def to_json(*_args)
|
92
|
+
@_field_set&.to_json
|
93
|
+
end
|
94
|
+
|
95
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
96
|
+
# hash and check each fields type against the current object's property
|
97
|
+
# definitions.
|
98
|
+
#
|
99
|
+
# @param obj [Object]
|
100
|
+
# @return [Void]
|
101
|
+
def self.validate_raw(obj:)
|
102
|
+
obj.media.is_a?(String) != false || raise("Passed value for field obj.media is not the expected type, validation failed.")
|
103
|
+
obj.quick_replies.is_a?(Array) != false || raise("Passed value for field obj.quick_replies is not the expected type, validation failed.")
|
104
|
+
obj.from.is_a?(String) != false || raise("Passed value for field obj.from is not the expected type, validation failed.")
|
105
|
+
obj.options.nil? || Pinnacle::Types::RcsBaseOptions.validate_raw(obj: obj.options)
|
106
|
+
obj.to.is_a?(String) != false || raise("Passed value for field obj.to is not the expected type, validation failed.")
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "rcs_media_details_content"
|
4
|
+
require_relative "rcs_button_content"
|
5
|
+
require "ostruct"
|
6
|
+
require "json"
|
7
|
+
|
8
|
+
module Pinnacle
|
9
|
+
module Types
|
10
|
+
# Message containing a media file and/or text with optional quick reply buttons.
|
11
|
+
# <br>
|
12
|
+
# See (supported file
|
13
|
+
# types)[https://app.pinnacle.sh/supported-file-types?type=RCS-MEDIA].
|
14
|
+
class RcsMediaContent
|
15
|
+
# @return [Pinnacle::Types::RcsMediaDetailsContent]
|
16
|
+
attr_reader :media
|
17
|
+
# @return [Array<Pinnacle::Types::RcsButtonContent>] List of interactive quick reply buttons in the message.
|
18
|
+
attr_reader :quick_replies
|
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 media [Pinnacle::Types::RcsMediaDetailsContent]
|
28
|
+
# @param quick_replies [Array<Pinnacle::Types::RcsButtonContent>] List of interactive quick reply buttons in the message.
|
29
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
30
|
+
# @return [Pinnacle::Types::RcsMediaContent]
|
31
|
+
def initialize(media:, quick_replies:, additional_properties: nil)
|
32
|
+
@media = media
|
33
|
+
@quick_replies = quick_replies
|
34
|
+
@additional_properties = additional_properties
|
35
|
+
@_field_set = { "media": media, "quickReplies": quick_replies }
|
36
|
+
end
|
37
|
+
|
38
|
+
# Deserialize a JSON object to an instance of RcsMediaContent
|
39
|
+
#
|
40
|
+
# @param json_object [String]
|
41
|
+
# @return [Pinnacle::Types::RcsMediaContent]
|
42
|
+
def self.from_json(json_object:)
|
43
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
44
|
+
parsed_json = JSON.parse(json_object)
|
45
|
+
if parsed_json["media"].nil?
|
46
|
+
media = nil
|
47
|
+
else
|
48
|
+
media = parsed_json["media"].to_json
|
49
|
+
media = Pinnacle::Types::RcsMediaDetailsContent.from_json(json_object: media)
|
50
|
+
end
|
51
|
+
quick_replies = parsed_json["quickReplies"]&.map do |item|
|
52
|
+
item = item.to_json
|
53
|
+
Pinnacle::Types::RcsButtonContent.from_json(json_object: item)
|
54
|
+
end
|
55
|
+
new(
|
56
|
+
media: media,
|
57
|
+
quick_replies: quick_replies,
|
58
|
+
additional_properties: struct
|
59
|
+
)
|
60
|
+
end
|
61
|
+
|
62
|
+
# Serialize an instance of RcsMediaContent to a JSON object
|
63
|
+
#
|
64
|
+
# @return [String]
|
65
|
+
def to_json(*_args)
|
66
|
+
@_field_set&.to_json
|
67
|
+
end
|
68
|
+
|
69
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
70
|
+
# hash and check each fields type against the current object's property
|
71
|
+
# definitions.
|
72
|
+
#
|
73
|
+
# @param obj [Object]
|
74
|
+
# @return [Void]
|
75
|
+
def self.validate_raw(obj:)
|
76
|
+
Pinnacle::Types::RcsMediaDetailsContent.validate_raw(obj: obj.media)
|
77
|
+
obj.quick_replies.is_a?(Array) != false || raise("Passed value for field obj.quick_replies is not the expected type, validation failed.")
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Pinnacle
|
7
|
+
module Types
|
8
|
+
# Metadata about the media file in the message.
|
9
|
+
class RcsMediaDetailsContent
|
10
|
+
# @return [String] Path to the file in Pinnacle's storage.
|
11
|
+
attr_reader :full_path
|
12
|
+
# @return [String] Detected MIME type of the media file.
|
13
|
+
attr_reader :mime_type
|
14
|
+
# @return [String] Direct URL to the media file.
|
15
|
+
attr_reader :url
|
16
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
17
|
+
attr_reader :additional_properties
|
18
|
+
# @return [Object]
|
19
|
+
attr_reader :_field_set
|
20
|
+
protected :_field_set
|
21
|
+
|
22
|
+
OMIT = Object.new
|
23
|
+
|
24
|
+
# @param full_path [String] Path to the file in Pinnacle's storage.
|
25
|
+
# @param mime_type [String] Detected MIME type of the media file.
|
26
|
+
# @param url [String] Direct URL to the media file.
|
27
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
28
|
+
# @return [Pinnacle::Types::RcsMediaDetailsContent]
|
29
|
+
def initialize(mime_type:, url:, full_path: OMIT, additional_properties: nil)
|
30
|
+
@full_path = full_path if full_path != OMIT
|
31
|
+
@mime_type = mime_type
|
32
|
+
@url = url
|
33
|
+
@additional_properties = additional_properties
|
34
|
+
@_field_set = { "fullPath": full_path, "mimeType": mime_type, "url": url }.reject do |_k, v|
|
35
|
+
v == OMIT
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# Deserialize a JSON object to an instance of RcsMediaDetailsContent
|
40
|
+
#
|
41
|
+
# @param json_object [String]
|
42
|
+
# @return [Pinnacle::Types::RcsMediaDetailsContent]
|
43
|
+
def self.from_json(json_object:)
|
44
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
45
|
+
parsed_json = JSON.parse(json_object)
|
46
|
+
full_path = parsed_json["fullPath"]
|
47
|
+
mime_type = parsed_json["mimeType"]
|
48
|
+
url = parsed_json["url"]
|
49
|
+
new(
|
50
|
+
full_path: full_path,
|
51
|
+
mime_type: mime_type,
|
52
|
+
url: url,
|
53
|
+
additional_properties: struct
|
54
|
+
)
|
55
|
+
end
|
56
|
+
|
57
|
+
# Serialize an instance of RcsMediaDetailsContent to a JSON object
|
58
|
+
#
|
59
|
+
# @return [String]
|
60
|
+
def to_json(*_args)
|
61
|
+
@_field_set&.to_json
|
62
|
+
end
|
63
|
+
|
64
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
65
|
+
# hash and check each fields type against the current object's property
|
66
|
+
# definitions.
|
67
|
+
#
|
68
|
+
# @param obj [Object]
|
69
|
+
# @return [Void]
|
70
|
+
def self.validate_raw(obj:)
|
71
|
+
obj.full_path&.is_a?(String) != false || raise("Passed value for field obj.full_path is not the expected type, validation failed.")
|
72
|
+
obj.mime_type.is_a?(String) != false || raise("Passed value for field obj.mime_type is not the expected type, validation failed.")
|
73
|
+
obj.url.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|