rcs 1.0.18 → 2.0.0.pre.rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/environment.rb +1 -1
- data/lib/rcs/brands/client.rb +631 -0
- data/lib/rcs/brands/types/autofill_brand_schema_options.rb +61 -0
- data/lib/rcs/brands/types/brand_contact.rb +84 -0
- data/lib/rcs/campaigns/client.rb +44 -0
- data/lib/rcs/campaigns/dlc/client.rb +480 -0
- data/lib/rcs/campaigns/dlc/types/upsert_dlc_schema_keywords.rb +99 -0
- data/lib/rcs/campaigns/dlc/types/upsert_dlc_schema_keywords_help.rb +74 -0
- data/lib/rcs/campaigns/dlc/types/upsert_dlc_schema_keywords_opt_in.rb +74 -0
- data/lib/rcs/campaigns/dlc/types/upsert_dlc_schema_keywords_opt_out.rb +74 -0
- data/lib/rcs/campaigns/dlc/types/upsert_dlc_schema_links.rb +74 -0
- data/lib/rcs/campaigns/dlc/types/upsert_dlc_schema_options.rb +110 -0
- data/lib/rcs/campaigns/dlc/types/upsert_dlc_schema_use_case.rb +76 -0
- data/lib/rcs/campaigns/rcs/client.rb +457 -0
- data/lib/rcs/campaigns/rcs/types/rcs_autofill_response.rb +155 -0
- data/lib/rcs/campaigns/rcs/types/upsert_rcs_schema_agent.rb +140 -0
- data/lib/rcs/campaigns/rcs/types/upsert_rcs_schema_agent_emails_item.rb +73 -0
- data/lib/rcs/campaigns/rcs/types/upsert_rcs_schema_agent_phones_item.rb +73 -0
- data/lib/rcs/campaigns/rcs/types/upsert_rcs_schema_agent_websites_item.rb +73 -0
- data/lib/rcs/campaigns/rcs/types/upsert_rcs_schema_links.rb +74 -0
- data/lib/rcs/campaigns/rcs/types/upsert_rcs_schema_opt_in.rb +75 -0
- data/lib/rcs/campaigns/rcs/types/upsert_rcs_schema_opt_out.rb +76 -0
- data/lib/rcs/campaigns/rcs/types/upsert_rcs_schema_use_case.rb +75 -0
- data/lib/rcs/campaigns/toll_free/client.rb +429 -0
- data/lib/rcs/campaigns/toll_free/types/toll_free_autofill_response.rb +130 -0
- data/lib/rcs/campaigns/toll_free/types/upsert_toll_free_schema_opt_in.rb +86 -0
- data/lib/rcs/campaigns/toll_free/types/upsert_toll_free_schema_use_case.rb +75 -0
- data/lib/rcs/contacts/client.rb +275 -0
- data/lib/rcs/conversations/client.rb +273 -0
- data/lib/rcs/message/client.rb +30 -0
- data/lib/rcs/message/sms/client.rb +96 -0
- data/lib/rcs/messages/client.rb +192 -0
- data/lib/rcs/messages/mms/client.rb +98 -0
- data/lib/rcs/messages/rcs/client.rb +94 -0
- data/lib/rcs/messages/send/client.rb +318 -0
- data/lib/rcs/messages/send/types/send_mms_response.rb +60 -0
- data/lib/rcs/messages/send/types/send_mms_schema_options.rb +108 -0
- data/lib/rcs/messages/send/types/send_rcs_response.rb +60 -0
- data/lib/rcs/messages/send/types/send_sms_response.rb +60 -0
- data/lib/rcs/messages/send/types/send_sms_schema_options.rb +81 -0
- data/lib/rcs/messages/types/message_reaction_schema_options.rb +71 -0
- data/lib/rcs/phone_numbers/campaign/client.rb +179 -0
- data/lib/rcs/phone_numbers/client.rb +359 -0
- data/lib/rcs/phone_numbers/types/phone_details_schema_level.rb +16 -0
- data/lib/rcs/phone_numbers/types/phone_details_schema_options.rb +93 -0
- data/lib/rcs/phone_numbers/types/phone_details_schema_options_enhanced_contact_info.rb +64 -0
- data/lib/rcs/phone_numbers/types/phone_numbers_get_response.rb +58 -0
- data/lib/rcs/phone_numbers/types/search_schema_location.rb +96 -0
- data/lib/rcs/phone_numbers/types/search_schema_number.rb +81 -0
- data/lib/rcs/phone_numbers/types/search_schema_options.rb +62 -0
- data/lib/rcs/phone_numbers/webhook/client.rb +191 -0
- data/lib/rcs/status/client.rb +30 -0
- data/lib/rcs/status/get/client.rb +367 -0
- data/lib/rcs/tools/client.rb +32 -199
- data/lib/rcs/tools/contact_card/client.rb +285 -0
- data/lib/rcs/tools/contact_card/types/get_v_card_schema_options.rb +67 -0
- data/lib/rcs/tools/file/client.rb +138 -0
- data/lib/rcs/tools/file/types/file_upload_schema_options.rb +70 -0
- data/lib/rcs/tools/file/types/file_upload_schema_options_download.rb +66 -0
- data/lib/rcs/tools/url/client.rb +245 -0
- data/lib/rcs/types/advanced_phone_information.rb +147 -0
- data/lib/rcs/types/advanced_phone_information_carrier.rb +90 -0
- data/lib/rcs/types/advanced_phone_information_contact.rb +146 -0
- data/lib/rcs/types/advanced_phone_information_location.rb +142 -0
- data/lib/rcs/types/advanced_phone_information_location_coordinates.rb +73 -0
- data/lib/rcs/types/advanced_phone_information_location_country.rb +77 -0
- data/lib/rcs/types/advanced_phone_information_type.rb +97 -0
- data/lib/rcs/types/advanced_phone_information_type_recommendation.rb +15 -0
- data/lib/rcs/types/agent.rb +68 -0
- data/lib/rcs/types/attach_webhook_params.rb +60 -0
- data/lib/rcs/types/attach_webhook_response_webhook.rb +86 -0
- data/lib/rcs/types/attach_webhook_schema_name.rb +88 -0
- data/lib/rcs/types/attach_webhook_schema_webhook_id.rb +77 -0
- data/lib/rcs/types/attached_phone_number_result.rb +75 -0
- data/lib/rcs/types/autofill_campaign_params.rb +69 -0
- data/lib/rcs/types/autofill_dlc_campaign_response.rb +169 -0
- data/lib/rcs/types/autofill_dlc_response_keywords.rb +95 -0
- data/lib/rcs/types/autofill_dlc_response_keywords_help.rb +70 -0
- data/lib/rcs/{send/types/send_sms_response.rb → types/autofill_dlc_response_keywords_opt_in.rb} +18 -17
- data/lib/rcs/types/autofill_dlc_response_keywords_opt_out.rb +70 -0
- data/lib/rcs/types/autofill_dlc_response_links.rb +70 -0
- data/lib/rcs/types/autofill_dlc_response_options.rb +106 -0
- data/lib/rcs/types/autofill_dlc_response_use_case.rb +72 -0
- data/lib/rcs/types/bad_request_error_body.rb +44 -45
- data/lib/rcs/types/basic_phone_information.rb +127 -0
- data/lib/rcs/{company/types/company_register_response_brand.rb → types/basic_phone_information_contact.rb} +12 -21
- data/lib/rcs/types/basic_phone_information_location.rb +74 -0
- data/lib/rcs/types/basic_phone_information_location_country.rb +75 -0
- data/lib/rcs/types/brand_status.rb +92 -0
- data/lib/rcs/types/brand_status_enum.rb +21 -0
- data/lib/rcs/types/buy_response_capabilities.rb +77 -0
- data/lib/rcs/types/campaign_enum.rb +15 -0
- data/lib/rcs/types/campaign_query.rb +69 -0
- data/lib/rcs/{company/types/company_register_request_company_id.rb → types/campaign_submission_result.rb} +15 -16
- data/lib/rcs/types/campaign_validation_response_errors_item.rb +76 -0
- data/lib/rcs/types/campaign_validation_result.rb +71 -0
- data/lib/rcs/types/click_action.rb +73 -0
- data/lib/rcs/types/click_action_data.rb +56 -0
- data/lib/rcs/types/click_action_data_metadata.rb +69 -0
- data/lib/rcs/types/company_sector_enum.rb +26 -0
- data/lib/rcs/types/company_type_enum.rb +14 -0
- data/lib/rcs/types/configured_webhook.rb +85 -0
- data/lib/rcs/types/contact.rb +105 -0
- data/lib/rcs/types/contact_id.rb +57 -0
- data/lib/rcs/types/conversation.rb +146 -0
- data/lib/rcs/types/conversation_contact.rb +68 -0
- data/lib/rcs/types/conversation_list.rb +79 -0
- data/lib/rcs/types/conversation_sender.rb +60 -0
- data/lib/rcs/types/create_url_options.rb +61 -0
- data/lib/rcs/types/detached_phone_number_result.rb +75 -0
- data/lib/rcs/types/detached_webhook_info.rb +74 -0
- data/lib/rcs/types/detailed_phone_number_enum.rb +25 -0
- data/lib/rcs/types/dlc_assignment_status_enum.rb +19 -0
- data/lib/rcs/types/dlc_campaign_status.rb +107 -0
- data/lib/rcs/types/dlc_campaign_use_case_enum.rb +35 -0
- data/lib/rcs/types/dlc_campaign_with_extended_brand_and_status.rb +194 -0
- data/lib/rcs/types/dlc_with_extended_brand_and_status_keywords.rb +94 -0
- data/lib/rcs/types/dlc_with_extended_brand_and_status_keywords_help.rb +72 -0
- data/lib/rcs/{send/types/send_mms_response.rb → types/dlc_with_extended_brand_and_status_keywords_opt_in.rb} +20 -17
- data/lib/rcs/{send/types/send_rcs_response.rb → types/dlc_with_extended_brand_and_status_keywords_opt_out.rb} +20 -17
- data/lib/rcs/types/dlc_with_extended_brand_and_status_links.rb +70 -0
- data/lib/rcs/types/dlc_with_extended_brand_and_status_options.rb +106 -0
- data/lib/rcs/types/dlc_with_extended_brand_and_status_use_case.rb +72 -0
- data/lib/rcs/types/enhanced_contact.rb +9 -0
- data/lib/rcs/types/enhanced_contact_item.rb +104 -0
- data/lib/rcs/types/error.rb +61 -0
- data/lib/rcs/types/extended_brand.rb +194 -0
- data/lib/rcs/types/extended_brand_with_vetting.rb +226 -0
- data/lib/rcs/types/extended_rcs_campaign.rb +173 -0
- data/lib/rcs/{company/types/company_register_request.rb → types/get_conversation_params.rb} +13 -12
- data/lib/rcs/types/get_conversation_request_id.rb +58 -0
- data/lib/rcs/types/get_conversation_request_recipient.rb +72 -0
- data/lib/rcs/types/get_dlc_campaign_status_response_updates.rb +96 -0
- data/lib/rcs/types/get_toll_free_campaign_status_response_updates.rb +92 -0
- data/lib/rcs/types/inbound_button.rb +56 -0
- data/lib/rcs/types/link_click_event.rb +465 -0
- data/lib/rcs/{company/types/company_update_response.rb → types/location_share_action.rb} +19 -19
- data/lib/rcs/types/location_share_action_data.rb +89 -0
- data/lib/rcs/types/message.rb +174 -0
- data/lib/rcs/types/message_content.rb +85 -0
- data/lib/rcs/types/message_method_enum.rb +12 -0
- data/lib/rcs/types/message_protocol_enum.rb +12 -0
- data/lib/rcs/types/message_schedule.rb +94 -0
- data/lib/rcs/types/message_status_enum.rb +16 -0
- data/lib/rcs/types/message_volume_enum.rb +20 -0
- data/lib/rcs/types/messaging_profile_enum.rb +11 -0
- data/lib/rcs/types/mms_content.rb +74 -0
- data/lib/rcs/types/mms_validation_response_segments.rb +85 -0
- data/lib/rcs/types/mms_validation_response_segments_value_item.rb +75 -0
- data/lib/rcs/types/mms_validation_result.rb +82 -0
- data/lib/rcs/types/nullable_contact.rb +84 -0
- data/lib/rcs/types/number_format.rb +79 -0
- data/lib/rcs/types/opt_in_method_enum.rb +13 -0
- data/lib/rcs/types/optional_brand_info.rb +145 -0
- data/lib/rcs/types/optional_contact.rb +83 -0
- data/lib/rcs/types/optional_contacts.rb +84 -0
- data/lib/rcs/types/phone.rb +101 -0
- data/lib/rcs/types/phone_capabilities.rb +75 -0
- data/lib/rcs/types/phone_enum.rb +13 -0
- data/lib/rcs/types/phone_feature_enum.rb +18 -0
- data/lib/rcs/types/phone_number_campaign_attach_failed_item.rb +67 -0
- data/lib/rcs/types/phone_number_campaign_attach_phone_numbers_item.rb +75 -0
- data/lib/rcs/types/phone_number_campaign_attach_phone_numbers_item_campaign.rb +78 -0
- data/lib/rcs/types/phone_number_campaign_detach_failed_item.rb +67 -0
- data/lib/rcs/types/phone_number_campaign_detach_phone_numbers_item.rb +75 -0
- data/lib/rcs/types/phone_number_campaign_detach_phone_numbers_item_campaign.rb +78 -0
- data/lib/rcs/types/phone_number_cost.rb +75 -0
- data/lib/rcs/types/phone_number_details.rb +110 -0
- data/lib/rcs/types/phone_number_enum.rb +18 -0
- data/lib/rcs/types/phone_number_region.rb +91 -0
- data/lib/rcs/types/phone_number_status.rb +90 -0
- data/lib/rcs/types/phone_number_status_enum.rb +16 -0
- data/lib/rcs/types/pinnacle_file_upload_metadata.rb +84 -0
- data/lib/rcs/types/pinnacle_url_config.rb +71 -0
- data/lib/rcs/types/profile_status_enum.rb +17 -0
- data/lib/rcs/types/purchased_number.rb +75 -0
- data/lib/rcs/types/rcs.rb +70 -0
- data/lib/rcs/types/rcs_base.rb +82 -0
- data/lib/rcs/types/rcs_base_options.rb +100 -0
- data/lib/rcs/types/rcs_button_call.rb +68 -0
- data/lib/rcs/types/rcs_button_content.rb +148 -0
- data/lib/rcs/types/rcs_button_open_url.rb +68 -0
- data/lib/rcs/types/rcs_button_request_user_location.rb +58 -0
- data/lib/rcs/types/rcs_button_schedule_event.rb +98 -0
- data/lib/rcs/types/rcs_button_send_location.rb +74 -0
- data/lib/rcs/types/rcs_button_send_location_lat_long.rb +68 -0
- data/lib/rcs/types/rcs_button_trigger.rb +78 -0
- data/lib/rcs/types/rcs_campaign.rb +143 -0
- data/lib/rcs/types/rcs_campaign_opt_in_method_enum.rb +15 -0
- data/lib/rcs/types/rcs_campaign_schema_agent.rb +134 -0
- data/lib/rcs/types/rcs_campaign_schema_agent_emails_item.rb +69 -0
- data/lib/rcs/types/rcs_campaign_schema_agent_phones_item.rb +69 -0
- data/lib/rcs/types/rcs_campaign_schema_agent_websites_item.rb +69 -0
- data/lib/rcs/types/rcs_campaign_schema_extra_agent.rb +134 -0
- data/lib/rcs/types/rcs_campaign_schema_extra_agent_emails_item.rb +70 -0
- data/lib/rcs/types/rcs_campaign_schema_extra_agent_phones_item.rb +70 -0
- data/lib/rcs/types/rcs_campaign_schema_extra_agent_websites_item.rb +71 -0
- data/lib/rcs/types/rcs_campaign_schema_extra_links.rb +70 -0
- data/lib/rcs/types/rcs_campaign_schema_extra_opt_in.rb +71 -0
- data/lib/rcs/types/rcs_campaign_schema_extra_opt_out.rb +70 -0
- data/lib/rcs/types/rcs_campaign_schema_extra_use_case.rb +71 -0
- data/lib/rcs/types/rcs_campaign_schema_links.rb +70 -0
- data/lib/rcs/types/rcs_campaign_schema_opt_in.rb +71 -0
- data/lib/rcs/types/rcs_campaign_schema_opt_out.rb +70 -0
- data/lib/rcs/types/rcs_campaign_schema_use_case.rb +71 -0
- data/lib/rcs/types/rcs_campaign_status.rb +86 -0
- data/lib/rcs/types/rcs_campaign_use_case_enum.rb +23 -0
- data/lib/rcs/types/rcs_card.rb +110 -0
- data/lib/rcs/types/rcs_cards.rb +79 -0
- data/lib/rcs/types/rcs_cards_cards_item.rb +88 -0
- data/lib/rcs/types/rcs_cards_content.rb +79 -0
- data/lib/rcs/types/rcs_cards_content_cards_item.rb +94 -0
- data/lib/rcs/types/rcs_content.rb +72 -0
- data/lib/rcs/types/rcs_media.rb +110 -0
- data/lib/rcs/types/rcs_media_content.rb +81 -0
- data/lib/rcs/types/rcs_media_details_content.rb +77 -0
- data/lib/rcs/types/rcs_text.rb +106 -0
- data/lib/rcs/types/rcs_text_content.rb +72 -0
- data/lib/rcs/types/rcs_validate_content.rb +70 -0
- data/lib/rcs/{company/types/company_register_response.rb → types/rcs_validate_content_media.rb} +19 -21
- data/lib/rcs/types/rcs_validation_result.rb +76 -0
- data/lib/rcs/types/reaction_result.rb +67 -0
- data/lib/rcs/types/scheduled_messaage.rb +73 -0
- data/lib/rcs/types/scheduled_send_response_config.rb +89 -0
- data/lib/rcs/types/send_sms_response_segments.rb +69 -0
- data/lib/rcs/types/send_sms_response_segments_encoding.rb +11 -0
- data/lib/rcs/types/sent_mms_details.rb +102 -0
- data/lib/rcs/types/sent_rcs_details.rb +105 -0
- data/lib/rcs/types/sent_sms_details.rb +108 -0
- data/lib/rcs/types/shortened_url.rb +77 -0
- data/lib/rcs/types/shortened_url_with_click_data.rb +90 -0
- data/lib/rcs/types/sms_content.rb +58 -0
- data/lib/rcs/types/sms_validation_response_segments.rb +80 -0
- data/lib/rcs/types/sms_validation_response_segments_gsm_7.rb +75 -0
- data/lib/rcs/types/sms_validation_response_segments_utf_16.rb +68 -0
- data/lib/rcs/types/sms_validation_response_total.rb +75 -0
- data/lib/rcs/types/sms_validation_result.rb +102 -0
- data/lib/rcs/types/sub_use_case_enum.rb +19 -0
- data/lib/rcs/types/submission_results.rb +57 -0
- data/lib/rcs/types/successful_conversation_update.rb +58 -0
- data/lib/rcs/types/toll_free_campaign.rb +118 -0
- data/lib/rcs/types/toll_free_campaign_schema_opt_in.rb +78 -0
- data/lib/rcs/types/toll_free_campaign_schema_use_case.rb +71 -0
- data/lib/rcs/types/toll_free_campaign_status.rb +91 -0
- data/lib/rcs/types/toll_free_campaign_use_case_enum.rb +52 -0
- data/lib/rcs/types/toll_free_campaign_with_extended_brand_and_status.rb +155 -0
- data/lib/rcs/types/toll_free_status_enum.rb +20 -0
- data/lib/rcs/types/tracking.rb +17 -0
- data/lib/rcs/types/updated_contact_id.rb +57 -0
- data/lib/rcs/types/upload_results.rb +80 -0
- data/lib/rcs/types/v_card_address_schema_type_item.rb +15 -0
- data/lib/rcs/types/v_card_data.rb +237 -0
- data/lib/rcs/types/v_card_data_file.rb +74 -0
- data/lib/rcs/types/v_card_data_file_metadata.rb +62 -0
- data/lib/rcs/types/v_card_email_schema_type_item.rb +21 -0
- data/lib/rcs/types/v_card_geo.rb +70 -0
- data/lib/rcs/types/v_card_name.rb +98 -0
- data/lib/rcs/types/v_card_organization.rb +70 -0
- data/lib/rcs/types/v_card_phone_schema_type_item.rb +21 -0
- data/lib/rcs/types/validate_campaign_params.rb +69 -0
- data/lib/rcs/types/validation_error_details.rb +76 -0
- data/lib/rcs/types/validation_results.rb +71 -0
- data/lib/rcs/types/vcard.rb +215 -0
- data/lib/rcs/types/vcard_address.rb +130 -0
- data/lib/rcs/types/vcard_content.rb +223 -0
- data/lib/rcs/types/vcard_email.rb +70 -0
- data/lib/rcs/types/vcard_phone.rb +70 -0
- data/lib/rcs/types/vcard_resource.rb +71 -0
- data/lib/rcs/types/vetting_feedback.rb +81 -0
- data/lib/rcs/types/vetting_history.rb +98 -0
- data/lib/rcs/types/vetting_history_vetting_status.rb +13 -0
- data/lib/rcs/types/vetting_results.rb +57 -0
- data/lib/rcs/types/webhook_event_enum.rb +13 -0
- data/lib/rcs/types/webhook_result.rb +64 -0
- data/lib/rcs/{company/types/company_update_response_brand.rb → types/webhooks.rb} +25 -17
- data/lib/rcs/types/zod_error.rb +73 -0
- data/lib/rcs/webhooks/client.rb +93 -0
- data/lib/rcs.rb +67 -83
- data/lib/requests.rb +4 -4
- data/lib/types_export.rb +252 -46
- metadata +278 -52
- data/lib/rcs/company/client.rb +0 -375
- data/lib/rcs/company/types/company_register_request_company.rb +0 -128
- data/lib/rcs/send/client.rb +0 -382
- data/lib/rcs/send/types/rcs_fallback.rb +0 -84
- data/lib/rcs/tools/types/tools_shorten_url_response.rb +0 -70
- data/lib/rcs/tools/types/tools_upload_url_response.rb +0 -69
- data/lib/rcs/types/action.rb +0 -154
- data/lib/rcs/types/action_lat_long.rb +0 -68
- data/lib/rcs/types/action_type.rb +0 -16
- data/lib/rcs/types/additional_email.rb +0 -65
- data/lib/rcs/types/additional_phone_number.rb +0 -65
- data/lib/rcs/types/additional_website.rb +0 -65
- data/lib/rcs/types/card.rb +0 -90
- data/lib/rcs/types/company.rb +0 -319
- data/lib/rcs/types/company_additional_emails_item.rb +0 -67
- data/lib/rcs/types/company_additional_phone_numbers_item.rb +0 -67
- data/lib/rcs/types/company_additional_websites_item.rb +0 -67
- data/lib/rcs/types/company_category.rb +0 -20
- data/lib/rcs/types/company_contact.rb +0 -117
- data/lib/rcs/types/company_details.rb +0 -120
- data/lib/rcs/types/forbidden_error_body.rb +0 -57
- data/lib/rcs/types/inbound_action_message.rb +0 -117
- data/lib/rcs/types/inbound_location_message.rb +0 -106
- data/lib/rcs/types/inbound_location_message_coordinates.rb +0 -65
- data/lib/rcs/types/inbound_media_message.rb +0 -112
- data/lib/rcs/types/inbound_message.rb +0 -88
- data/lib/rcs/types/inbound_message_message_type.rb +0 -10
- data/lib/rcs/types/inbound_message_metadata.rb +0 -79
- data/lib/rcs/types/inbound_text_message.rb +0 -100
- data/lib/rcs/types/internal_server_error_body.rb +0 -57
- data/lib/rcs/types/media_payload.rb +0 -65
- data/lib/rcs/types/message_metadata.rb +0 -56
- data/lib/rcs/types/messaging.rb +0 -95
- data/lib/rcs/types/optionals.rb +0 -99
- data/lib/rcs/types/payment_required_error_body.rb +0 -57
- data/lib/rcs/types/point_of_contact.rb +0 -72
- data/lib/rcs/types/rcs_functionalities.rb +0 -117
- data/lib/rcs/types/sender_metadata.rb +0 -74
- data/lib/rcs/types/unauthorized_error_body.rb +0 -57
@@ -0,0 +1,174 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "message_content"
|
4
|
+
require_relative "message_method_enum"
|
5
|
+
require_relative "message_status_enum"
|
6
|
+
require_relative "message_protocol_enum"
|
7
|
+
require "ostruct"
|
8
|
+
require "json"
|
9
|
+
|
10
|
+
module Pinnacle
|
11
|
+
module Types
|
12
|
+
class Message
|
13
|
+
# @return [Pinnacle::Types::MessageContent]
|
14
|
+
attr_reader :content
|
15
|
+
# @return [Float] Total cost charged for sending the message. <br>
|
16
|
+
# Null means the message incurred no cost or has not been charged yet.
|
17
|
+
attr_reader :cost
|
18
|
+
# @return [String] Timestamp indicating when the message was successfully delivered to the
|
19
|
+
# recipient. <br>
|
20
|
+
# Null indicates the message has not yet been delivered.
|
21
|
+
attr_reader :delivered_at
|
22
|
+
# @return [String] Detailed explanation of any errors that occurred while delivering the message.
|
23
|
+
# <br>
|
24
|
+
# Null indicates no errors.
|
25
|
+
attr_reader :error
|
26
|
+
# @return [Integer] Unique identifier of the message.
|
27
|
+
attr_reader :id
|
28
|
+
# @return [Pinnacle::Types::MessageMethodEnum]
|
29
|
+
attr_reader :method
|
30
|
+
# @return [Integer] Number of segments the message was split into for delivery.
|
31
|
+
attr_reader :num_segments
|
32
|
+
# @return [String] Phone number that received the message in E.164 format.
|
33
|
+
attr_reader :receiver
|
34
|
+
# @return [String] Phone number or agent that sent the message.
|
35
|
+
attr_reader :sender
|
36
|
+
# @return [String] Timestamp indicating when the message was submitted for delivery. <br>
|
37
|
+
# Null indicates the message is still in the queue.
|
38
|
+
attr_reader :sent_at
|
39
|
+
# @return [Pinnacle::Types::MessageStatusEnum]
|
40
|
+
attr_reader :status
|
41
|
+
# @return [Pinnacle::Types::MessageProtocolEnum]
|
42
|
+
attr_reader :type
|
43
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
44
|
+
attr_reader :additional_properties
|
45
|
+
# @return [Object]
|
46
|
+
attr_reader :_field_set
|
47
|
+
protected :_field_set
|
48
|
+
|
49
|
+
OMIT = Object.new
|
50
|
+
|
51
|
+
# @param content [Pinnacle::Types::MessageContent]
|
52
|
+
# @param cost [Float] Total cost charged for sending the message. <br>
|
53
|
+
# Null means the message incurred no cost or has not been charged yet.
|
54
|
+
# @param delivered_at [String] Timestamp indicating when the message was successfully delivered to the
|
55
|
+
# recipient. <br>
|
56
|
+
# Null indicates the message has not yet been delivered.
|
57
|
+
# @param error [String] Detailed explanation of any errors that occurred while delivering the message.
|
58
|
+
# <br>
|
59
|
+
# Null indicates no errors.
|
60
|
+
# @param id [Integer] Unique identifier of the message.
|
61
|
+
# @param method [Pinnacle::Types::MessageMethodEnum]
|
62
|
+
# @param num_segments [Integer] Number of segments the message was split into for delivery.
|
63
|
+
# @param receiver [String] Phone number that received the message in E.164 format.
|
64
|
+
# @param sender [String] Phone number or agent that sent the message.
|
65
|
+
# @param sent_at [String] Timestamp indicating when the message was submitted for delivery. <br>
|
66
|
+
# Null indicates the message is still in the queue.
|
67
|
+
# @param status [Pinnacle::Types::MessageStatusEnum]
|
68
|
+
# @param type [Pinnacle::Types::MessageProtocolEnum]
|
69
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
70
|
+
# @return [Pinnacle::Types::Message]
|
71
|
+
def initialize(content:, id:, method:, num_segments:, receiver:, sender:, status:, type:, cost: OMIT,
|
72
|
+
delivered_at: OMIT, error: OMIT, sent_at: OMIT, additional_properties: nil)
|
73
|
+
@content = content
|
74
|
+
@cost = cost if cost != OMIT
|
75
|
+
@delivered_at = delivered_at if delivered_at != OMIT
|
76
|
+
@error = error if error != OMIT
|
77
|
+
@id = id
|
78
|
+
@method = method
|
79
|
+
@num_segments = num_segments
|
80
|
+
@receiver = receiver
|
81
|
+
@sender = sender
|
82
|
+
@sent_at = sent_at if sent_at != OMIT
|
83
|
+
@status = status
|
84
|
+
@type = type
|
85
|
+
@additional_properties = additional_properties
|
86
|
+
@_field_set = {
|
87
|
+
"content": content,
|
88
|
+
"cost": cost,
|
89
|
+
"deliveredAt": delivered_at,
|
90
|
+
"error": error,
|
91
|
+
"id": id,
|
92
|
+
"method": method,
|
93
|
+
"numSegments": num_segments,
|
94
|
+
"receiver": receiver,
|
95
|
+
"sender": sender,
|
96
|
+
"sentAt": sent_at,
|
97
|
+
"status": status,
|
98
|
+
"type": type
|
99
|
+
}.reject do |_k, v|
|
100
|
+
v == OMIT
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
# Deserialize a JSON object to an instance of Message
|
105
|
+
#
|
106
|
+
# @param json_object [String]
|
107
|
+
# @return [Pinnacle::Types::Message]
|
108
|
+
def self.from_json(json_object:)
|
109
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
110
|
+
parsed_json = JSON.parse(json_object)
|
111
|
+
if parsed_json["content"].nil?
|
112
|
+
content = nil
|
113
|
+
else
|
114
|
+
content = parsed_json["content"].to_json
|
115
|
+
content = Pinnacle::Types::MessageContent.from_json(json_object: content)
|
116
|
+
end
|
117
|
+
cost = parsed_json["cost"]
|
118
|
+
delivered_at = parsed_json["deliveredAt"]
|
119
|
+
error = parsed_json["error"]
|
120
|
+
id = parsed_json["id"]
|
121
|
+
method = parsed_json["method"]
|
122
|
+
num_segments = parsed_json["numSegments"]
|
123
|
+
receiver = parsed_json["receiver"]
|
124
|
+
sender = parsed_json["sender"]
|
125
|
+
sent_at = parsed_json["sentAt"]
|
126
|
+
status = parsed_json["status"]
|
127
|
+
type = parsed_json["type"]
|
128
|
+
new(
|
129
|
+
content: content,
|
130
|
+
cost: cost,
|
131
|
+
delivered_at: delivered_at,
|
132
|
+
error: error,
|
133
|
+
id: id,
|
134
|
+
method: method,
|
135
|
+
num_segments: num_segments,
|
136
|
+
receiver: receiver,
|
137
|
+
sender: sender,
|
138
|
+
sent_at: sent_at,
|
139
|
+
status: status,
|
140
|
+
type: type,
|
141
|
+
additional_properties: struct
|
142
|
+
)
|
143
|
+
end
|
144
|
+
|
145
|
+
# Serialize an instance of Message to a JSON object
|
146
|
+
#
|
147
|
+
# @return [String]
|
148
|
+
def to_json(*_args)
|
149
|
+
@_field_set&.to_json
|
150
|
+
end
|
151
|
+
|
152
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
153
|
+
# hash and check each fields type against the current object's property
|
154
|
+
# definitions.
|
155
|
+
#
|
156
|
+
# @param obj [Object]
|
157
|
+
# @return [Void]
|
158
|
+
def self.validate_raw(obj:)
|
159
|
+
Pinnacle::Types::MessageContent.validate_raw(obj: obj.content)
|
160
|
+
obj.cost&.is_a?(Float) != false || raise("Passed value for field obj.cost is not the expected type, validation failed.")
|
161
|
+
obj.delivered_at&.is_a?(String) != false || raise("Passed value for field obj.delivered_at is not the expected type, validation failed.")
|
162
|
+
obj.error&.is_a?(String) != false || raise("Passed value for field obj.error is not the expected type, validation failed.")
|
163
|
+
obj.id.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
164
|
+
obj.method.is_a?(Pinnacle::Types::MessageMethodEnum) != false || raise("Passed value for field obj.method is not the expected type, validation failed.")
|
165
|
+
obj.num_segments.is_a?(Integer) != false || raise("Passed value for field obj.num_segments is not the expected type, validation failed.")
|
166
|
+
obj.receiver.is_a?(String) != false || raise("Passed value for field obj.receiver is not the expected type, validation failed.")
|
167
|
+
obj.sender.is_a?(String) != false || raise("Passed value for field obj.sender is not the expected type, validation failed.")
|
168
|
+
obj.sent_at&.is_a?(String) != false || raise("Passed value for field obj.sent_at is not the expected type, validation failed.")
|
169
|
+
obj.status.is_a?(Pinnacle::Types::MessageStatusEnum) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
|
170
|
+
obj.type.is_a?(Pinnacle::Types::MessageProtocolEnum) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
171
|
+
end
|
172
|
+
end
|
173
|
+
end
|
174
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "json"
|
4
|
+
require_relative "sms_content"
|
5
|
+
require_relative "mms_content"
|
6
|
+
require_relative "rcs_content"
|
7
|
+
require_relative "inbound_button"
|
8
|
+
|
9
|
+
module Pinnacle
|
10
|
+
module Types
|
11
|
+
# Content type of the message.
|
12
|
+
class MessageContent
|
13
|
+
# Deserialize a JSON object to an instance of MessageContent
|
14
|
+
#
|
15
|
+
# @param json_object [String]
|
16
|
+
# @return [Pinnacle::Types::MessageContent]
|
17
|
+
def self.from_json(json_object:)
|
18
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
19
|
+
begin
|
20
|
+
Pinnacle::Types::SmsContent.validate_raw(obj: struct)
|
21
|
+
return Pinnacle::Types::SmsContent.from_json(json_object: struct) unless struct.nil?
|
22
|
+
|
23
|
+
return nil
|
24
|
+
rescue StandardError
|
25
|
+
# noop
|
26
|
+
end
|
27
|
+
begin
|
28
|
+
Pinnacle::Types::MmsContent.validate_raw(obj: struct)
|
29
|
+
return Pinnacle::Types::MmsContent.from_json(json_object: struct) unless struct.nil?
|
30
|
+
|
31
|
+
return nil
|
32
|
+
rescue StandardError
|
33
|
+
# noop
|
34
|
+
end
|
35
|
+
begin
|
36
|
+
Pinnacle::Types::RcsContent.validate_raw(obj: struct)
|
37
|
+
return Pinnacle::Types::RcsContent.from_json(json_object: struct) unless struct.nil?
|
38
|
+
|
39
|
+
return nil
|
40
|
+
rescue StandardError
|
41
|
+
# noop
|
42
|
+
end
|
43
|
+
begin
|
44
|
+
Pinnacle::Types::InboundButton.validate_raw(obj: struct)
|
45
|
+
return Pinnacle::Types::InboundButton.from_json(json_object: struct) unless struct.nil?
|
46
|
+
|
47
|
+
return nil
|
48
|
+
rescue StandardError
|
49
|
+
# noop
|
50
|
+
end
|
51
|
+
struct
|
52
|
+
end
|
53
|
+
|
54
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
55
|
+
# hash and check each fields type against the current object's property
|
56
|
+
# definitions.
|
57
|
+
#
|
58
|
+
# @param obj [Object]
|
59
|
+
# @return [Void]
|
60
|
+
def self.validate_raw(obj:)
|
61
|
+
begin
|
62
|
+
return Pinnacle::Types::SmsContent.validate_raw(obj: obj)
|
63
|
+
rescue StandardError
|
64
|
+
# noop
|
65
|
+
end
|
66
|
+
begin
|
67
|
+
return Pinnacle::Types::MmsContent.validate_raw(obj: obj)
|
68
|
+
rescue StandardError
|
69
|
+
# noop
|
70
|
+
end
|
71
|
+
begin
|
72
|
+
return Pinnacle::Types::RcsContent.validate_raw(obj: obj)
|
73
|
+
rescue StandardError
|
74
|
+
# noop
|
75
|
+
end
|
76
|
+
begin
|
77
|
+
return Pinnacle::Types::InboundButton.validate_raw(obj: obj)
|
78
|
+
rescue StandardError
|
79
|
+
# noop
|
80
|
+
end
|
81
|
+
raise("Passed value matched no type within the union, validation failed.")
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "date"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module Pinnacle
|
8
|
+
module Types
|
9
|
+
# Define when and how your message should be sent.
|
10
|
+
class MessageSchedule
|
11
|
+
# @return [DateTime] Date and time when you want recurring messages to stop in ISO 8601 format.
|
12
|
+
attr_reader :end_date
|
13
|
+
# @return [String] Provide an AWS cron expression to control the when messages are sent. <br>
|
14
|
+
# [Learn more about cron
|
15
|
+
# ocs.aws.amazon.com/eventbridge/latest/userguide/eb-scheduled-rule-pattern.html).
|
16
|
+
attr_reader :recurrence
|
17
|
+
# @return [String] Date and time when you want to send your message in ISO 8601 format.
|
18
|
+
attr_reader :send_at
|
19
|
+
# @return [String] Timezone for your scheduled message, using an IANA identifier.
|
20
|
+
attr_reader :timezone
|
21
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
22
|
+
attr_reader :additional_properties
|
23
|
+
# @return [Object]
|
24
|
+
attr_reader :_field_set
|
25
|
+
protected :_field_set
|
26
|
+
|
27
|
+
OMIT = Object.new
|
28
|
+
|
29
|
+
# @param end_date [DateTime] Date and time when you want recurring messages to stop in ISO 8601 format.
|
30
|
+
# @param recurrence [String] Provide an AWS cron expression to control the when messages are sent. <br>
|
31
|
+
# [Learn more about cron
|
32
|
+
# ocs.aws.amazon.com/eventbridge/latest/userguide/eb-scheduled-rule-pattern.html).
|
33
|
+
# @param send_at [String] Date and time when you want to send your message in ISO 8601 format.
|
34
|
+
# @param timezone [String] Timezone for your scheduled message, using an IANA identifier.
|
35
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
36
|
+
# @return [Pinnacle::Types::MessageSchedule]
|
37
|
+
def initialize(send_at:, timezone:, end_date: OMIT, recurrence: OMIT, additional_properties: nil)
|
38
|
+
@end_date = end_date if end_date != OMIT
|
39
|
+
@recurrence = recurrence if recurrence != OMIT
|
40
|
+
@send_at = send_at
|
41
|
+
@timezone = timezone
|
42
|
+
@additional_properties = additional_properties
|
43
|
+
@_field_set = {
|
44
|
+
"endDate": end_date,
|
45
|
+
"recurrence": recurrence,
|
46
|
+
"sendAt": send_at,
|
47
|
+
"timezone": timezone
|
48
|
+
}.reject do |_k, v|
|
49
|
+
v == OMIT
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# Deserialize a JSON object to an instance of MessageSchedule
|
54
|
+
#
|
55
|
+
# @param json_object [String]
|
56
|
+
# @return [Pinnacle::Types::MessageSchedule]
|
57
|
+
def self.from_json(json_object:)
|
58
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
59
|
+
parsed_json = JSON.parse(json_object)
|
60
|
+
end_date = (DateTime.parse(parsed_json["endDate"]) unless parsed_json["endDate"].nil?)
|
61
|
+
recurrence = parsed_json["recurrence"]
|
62
|
+
send_at = parsed_json["sendAt"]
|
63
|
+
timezone = parsed_json["timezone"]
|
64
|
+
new(
|
65
|
+
end_date: end_date,
|
66
|
+
recurrence: recurrence,
|
67
|
+
send_at: send_at,
|
68
|
+
timezone: timezone,
|
69
|
+
additional_properties: struct
|
70
|
+
)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Serialize an instance of MessageSchedule 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.end_date&.is_a?(DateTime) != false || raise("Passed value for field obj.end_date is not the expected type, validation failed.")
|
88
|
+
obj.recurrence&.is_a?(String) != false || raise("Passed value for field obj.recurrence is not the expected type, validation failed.")
|
89
|
+
obj.send_at.is_a?(String) != false || raise("Passed value for field obj.send_at is not the expected type, validation failed.")
|
90
|
+
obj.timezone.is_a?(String) != false || raise("Passed value for field obj.timezone is not the expected type, validation failed.")
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Pinnacle
|
4
|
+
module Types
|
5
|
+
# Current status of the message.
|
6
|
+
class MessageStatusEnum
|
7
|
+
PENDING = "PENDING"
|
8
|
+
SENT = "SENT"
|
9
|
+
SEND_FAILED = "SEND_FAILED"
|
10
|
+
DELIVERED = "DELIVERED"
|
11
|
+
DELIVERY_FAILED = "DELIVERY_FAILED"
|
12
|
+
RECEIVED = "RECEIVED"
|
13
|
+
READ = "READ"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Pinnacle
|
4
|
+
module Types
|
5
|
+
# Message volume.
|
6
|
+
class MessageVolumeEnum
|
7
|
+
TEN = "10"
|
8
|
+
ONE_HUNDRED = "100"
|
9
|
+
ONE_000 = "1,000"
|
10
|
+
TEN_000 = "10,000"
|
11
|
+
ONE_HUNDRED_000 = "100,000"
|
12
|
+
TWO_HUNDRED_FIFTY_000 = "250,000"
|
13
|
+
FIVE_HUNDRED_000 = "500,000"
|
14
|
+
SEVEN_HUNDRED_FIFTY_000 = "750,000"
|
15
|
+
ONE_000000 = "1,000,000"
|
16
|
+
FIVE_000000 = "5,000,000"
|
17
|
+
TEN_000000 = "10,000,000+"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Pinnacle
|
7
|
+
module Types
|
8
|
+
# Message with text and/or media files from a phone number.
|
9
|
+
class MmsContent
|
10
|
+
# @return [Array<String>] URLs of media files in this message. <br>
|
11
|
+
# See [supported media
|
12
|
+
# types](https://app.pinnacle.sh/supported-file-types?type=MMS).
|
13
|
+
attr_reader :media_urls
|
14
|
+
# @return [String] Text content that accompanies the media files.
|
15
|
+
attr_reader :text
|
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 media_urls [Array<String>] URLs of media files in this message. <br>
|
25
|
+
# See [supported media
|
26
|
+
# types](https://app.pinnacle.sh/supported-file-types?type=MMS).
|
27
|
+
# @param text [String] Text content that accompanies the media files.
|
28
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
29
|
+
# @return [Pinnacle::Types::MmsContent]
|
30
|
+
def initialize(media_urls:, text: OMIT, additional_properties: nil)
|
31
|
+
@media_urls = media_urls
|
32
|
+
@text = text if text != OMIT
|
33
|
+
@additional_properties = additional_properties
|
34
|
+
@_field_set = { "mediaUrls": media_urls, "text": text }.reject do |_k, v|
|
35
|
+
v == OMIT
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# Deserialize a JSON object to an instance of MmsContent
|
40
|
+
#
|
41
|
+
# @param json_object [String]
|
42
|
+
# @return [Pinnacle::Types::MmsContent]
|
43
|
+
def self.from_json(json_object:)
|
44
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
45
|
+
parsed_json = JSON.parse(json_object)
|
46
|
+
media_urls = parsed_json["mediaUrls"]
|
47
|
+
text = parsed_json["text"]
|
48
|
+
new(
|
49
|
+
media_urls: media_urls,
|
50
|
+
text: text,
|
51
|
+
additional_properties: struct
|
52
|
+
)
|
53
|
+
end
|
54
|
+
|
55
|
+
# Serialize an instance of MmsContent to a JSON object
|
56
|
+
#
|
57
|
+
# @return [String]
|
58
|
+
def to_json(*_args)
|
59
|
+
@_field_set&.to_json
|
60
|
+
end
|
61
|
+
|
62
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
63
|
+
# hash and check each fields type against the current object's property
|
64
|
+
# definitions.
|
65
|
+
#
|
66
|
+
# @param obj [Object]
|
67
|
+
# @return [Void]
|
68
|
+
def self.validate_raw(obj:)
|
69
|
+
obj.media_urls.is_a?(Array) != false || raise("Passed value for field obj.media_urls is not the expected type, validation failed.")
|
70
|
+
obj.text&.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.")
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
@@ -0,0 +1,85 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "mms_validation_response_segments_value_item"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module Pinnacle
|
8
|
+
module Types
|
9
|
+
# Details about how the MMS content would be segmented for delivery.
|
10
|
+
class MmsValidationResponseSegments
|
11
|
+
# @return [Integer] Number of segments this message would be split into.
|
12
|
+
attr_reader :count
|
13
|
+
# @return [Array<String>] List of unsupported media files included in the message. <br>
|
14
|
+
# This may be because the file is unreachable or not supported by the MMS
|
15
|
+
# protocol. See [supported file
|
16
|
+
# types](https://app.pinnacle.sh/supported-file-types?type=MMS).
|
17
|
+
attr_reader :unsupported_files
|
18
|
+
# @return [Array<Pinnacle::Types::MmsValidationResponseSegmentsValueItem>] Message segments with its content breakdown.
|
19
|
+
attr_reader :value
|
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 count [Integer] Number of segments this message would be split into.
|
29
|
+
# @param unsupported_files [Array<String>] List of unsupported media files included in the message. <br>
|
30
|
+
# This may be because the file is unreachable or not supported by the MMS
|
31
|
+
# protocol. See [supported file
|
32
|
+
# types](https://app.pinnacle.sh/supported-file-types?type=MMS).
|
33
|
+
# @param value [Array<Pinnacle::Types::MmsValidationResponseSegmentsValueItem>] Message segments with its content breakdown.
|
34
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
35
|
+
# @return [Pinnacle::Types::MmsValidationResponseSegments]
|
36
|
+
def initialize(count:, unsupported_files:, value:, additional_properties: nil)
|
37
|
+
@count = count
|
38
|
+
@unsupported_files = unsupported_files
|
39
|
+
@value = value
|
40
|
+
@additional_properties = additional_properties
|
41
|
+
@_field_set = { "count": count, "unsupportedFiles": unsupported_files, "value": value }
|
42
|
+
end
|
43
|
+
|
44
|
+
# Deserialize a JSON object to an instance of MmsValidationResponseSegments
|
45
|
+
#
|
46
|
+
# @param json_object [String]
|
47
|
+
# @return [Pinnacle::Types::MmsValidationResponseSegments]
|
48
|
+
def self.from_json(json_object:)
|
49
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
50
|
+
parsed_json = JSON.parse(json_object)
|
51
|
+
count = parsed_json["count"]
|
52
|
+
unsupported_files = parsed_json["unsupportedFiles"]
|
53
|
+
value = parsed_json["value"]&.map do |item|
|
54
|
+
item = item.to_json
|
55
|
+
Pinnacle::Types::MmsValidationResponseSegmentsValueItem.from_json(json_object: item)
|
56
|
+
end
|
57
|
+
new(
|
58
|
+
count: count,
|
59
|
+
unsupported_files: unsupported_files,
|
60
|
+
value: value,
|
61
|
+
additional_properties: struct
|
62
|
+
)
|
63
|
+
end
|
64
|
+
|
65
|
+
# Serialize an instance of MmsValidationResponseSegments to a JSON object
|
66
|
+
#
|
67
|
+
# @return [String]
|
68
|
+
def to_json(*_args)
|
69
|
+
@_field_set&.to_json
|
70
|
+
end
|
71
|
+
|
72
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
73
|
+
# hash and check each fields type against the current object's property
|
74
|
+
# definitions.
|
75
|
+
#
|
76
|
+
# @param obj [Object]
|
77
|
+
# @return [Void]
|
78
|
+
def self.validate_raw(obj:)
|
79
|
+
obj.count.is_a?(Integer) != false || raise("Passed value for field obj.count is not the expected type, validation failed.")
|
80
|
+
obj.unsupported_files.is_a?(Array) != false || raise("Passed value for field obj.unsupported_files is not the expected type, validation failed.")
|
81
|
+
obj.value.is_a?(Array) != false || raise("Passed value for field obj.value is not the expected type, validation failed.")
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Pinnacle
|
7
|
+
module Types
|
8
|
+
class MmsValidationResponseSegmentsValueItem
|
9
|
+
# @return [Array<String>] Media file URLs that would be included in this segment.
|
10
|
+
attr_reader :files
|
11
|
+
# @return [Integer] Size of this segment in bytes.
|
12
|
+
attr_reader :size
|
13
|
+
# @return [String] Text content in this segment.
|
14
|
+
attr_reader :text
|
15
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
16
|
+
attr_reader :additional_properties
|
17
|
+
# @return [Object]
|
18
|
+
attr_reader :_field_set
|
19
|
+
protected :_field_set
|
20
|
+
|
21
|
+
OMIT = Object.new
|
22
|
+
|
23
|
+
# @param files [Array<String>] Media file URLs that would be included in this segment.
|
24
|
+
# @param size [Integer] Size of this segment in bytes.
|
25
|
+
# @param text [String] Text content in this segment.
|
26
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
27
|
+
# @return [Pinnacle::Types::MmsValidationResponseSegmentsValueItem]
|
28
|
+
def initialize(files:, size:, text:, additional_properties: nil)
|
29
|
+
@files = files
|
30
|
+
@size = size
|
31
|
+
@text = text
|
32
|
+
@additional_properties = additional_properties
|
33
|
+
@_field_set = { "files": files, "size": size, "text": text }
|
34
|
+
end
|
35
|
+
|
36
|
+
# Deserialize a JSON object to an instance of
|
37
|
+
# MmsValidationResponseSegmentsValueItem
|
38
|
+
#
|
39
|
+
# @param json_object [String]
|
40
|
+
# @return [Pinnacle::Types::MmsValidationResponseSegmentsValueItem]
|
41
|
+
def self.from_json(json_object:)
|
42
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
43
|
+
parsed_json = JSON.parse(json_object)
|
44
|
+
files = parsed_json["files"]
|
45
|
+
size = parsed_json["size"]
|
46
|
+
text = parsed_json["text"]
|
47
|
+
new(
|
48
|
+
files: files,
|
49
|
+
size: size,
|
50
|
+
text: text,
|
51
|
+
additional_properties: struct
|
52
|
+
)
|
53
|
+
end
|
54
|
+
|
55
|
+
# Serialize an instance of MmsValidationResponseSegmentsValueItem to a JSON object
|
56
|
+
#
|
57
|
+
# @return [String]
|
58
|
+
def to_json(*_args)
|
59
|
+
@_field_set&.to_json
|
60
|
+
end
|
61
|
+
|
62
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
63
|
+
# hash and check each fields type against the current object's property
|
64
|
+
# definitions.
|
65
|
+
#
|
66
|
+
# @param obj [Object]
|
67
|
+
# @return [Void]
|
68
|
+
def self.validate_raw(obj:)
|
69
|
+
obj.files.is_a?(Array) != false || raise("Passed value for field obj.files is not the expected type, validation failed.")
|
70
|
+
obj.size.is_a?(Integer) != false || raise("Passed value for field obj.size is not the expected type, validation failed.")
|
71
|
+
obj.text.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.")
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|