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,82 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "mms_validation_response_segments"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module Pinnacle
|
8
|
+
module Types
|
9
|
+
class MmsValidationResult
|
10
|
+
# @return [Pinnacle::Types::MmsValidationResponseSegments] Details about how the MMS content would be segmented for delivery.
|
11
|
+
attr_reader :segments
|
12
|
+
# @return [Float] Total price of this message. Calculated by multiplying the number of segments by
|
13
|
+
# the unit cost.
|
14
|
+
attr_reader :total
|
15
|
+
# @return [Float] Cost of each segment.
|
16
|
+
attr_reader :unit
|
17
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
18
|
+
attr_reader :additional_properties
|
19
|
+
# @return [Object]
|
20
|
+
attr_reader :_field_set
|
21
|
+
protected :_field_set
|
22
|
+
|
23
|
+
OMIT = Object.new
|
24
|
+
|
25
|
+
# @param segments [Pinnacle::Types::MmsValidationResponseSegments] Details about how the MMS content would be segmented for delivery.
|
26
|
+
# @param total [Float] Total price of this message. Calculated by multiplying the number of segments by
|
27
|
+
# the unit cost.
|
28
|
+
# @param unit [Float] Cost of each segment.
|
29
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
30
|
+
# @return [Pinnacle::Types::MmsValidationResult]
|
31
|
+
def initialize(segments:, total:, unit:, additional_properties: nil)
|
32
|
+
@segments = segments
|
33
|
+
@total = total
|
34
|
+
@unit = unit
|
35
|
+
@additional_properties = additional_properties
|
36
|
+
@_field_set = { "segments": segments, "total": total, "unit": unit }
|
37
|
+
end
|
38
|
+
|
39
|
+
# Deserialize a JSON object to an instance of MmsValidationResult
|
40
|
+
#
|
41
|
+
# @param json_object [String]
|
42
|
+
# @return [Pinnacle::Types::MmsValidationResult]
|
43
|
+
def self.from_json(json_object:)
|
44
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
45
|
+
parsed_json = JSON.parse(json_object)
|
46
|
+
if parsed_json["segments"].nil?
|
47
|
+
segments = nil
|
48
|
+
else
|
49
|
+
segments = parsed_json["segments"].to_json
|
50
|
+
segments = Pinnacle::Types::MmsValidationResponseSegments.from_json(json_object: segments)
|
51
|
+
end
|
52
|
+
total = parsed_json["total"]
|
53
|
+
unit = parsed_json["unit"]
|
54
|
+
new(
|
55
|
+
segments: segments,
|
56
|
+
total: total,
|
57
|
+
unit: unit,
|
58
|
+
additional_properties: struct
|
59
|
+
)
|
60
|
+
end
|
61
|
+
|
62
|
+
# Serialize an instance of MmsValidationResult 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::MmsValidationResponseSegments.validate_raw(obj: obj.segments)
|
77
|
+
obj.total.is_a?(Float) != false || raise("Passed value for field obj.total is not the expected type, validation failed.")
|
78
|
+
obj.unit.is_a?(Float) != false || raise("Passed value for field obj.unit is not the expected type, validation failed.")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Pinnacle
|
7
|
+
module Types
|
8
|
+
# Contact information for the brand.
|
9
|
+
class NullableContact
|
10
|
+
# @return [String] Email address of the contact person.
|
11
|
+
attr_reader :email
|
12
|
+
# @return [String] Full name of the contact person.
|
13
|
+
attr_reader :name
|
14
|
+
# @return [String] Phone number of the contact person in E.164 format.
|
15
|
+
attr_reader :phone
|
16
|
+
# @return [String] Job title of the contact person.
|
17
|
+
attr_reader :title
|
18
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
19
|
+
attr_reader :additional_properties
|
20
|
+
# @return [Object]
|
21
|
+
attr_reader :_field_set
|
22
|
+
protected :_field_set
|
23
|
+
|
24
|
+
OMIT = Object.new
|
25
|
+
|
26
|
+
# @param email [String] Email address of the contact person.
|
27
|
+
# @param name [String] Full name of the contact person.
|
28
|
+
# @param phone [String] Phone number of the contact person in E.164 format.
|
29
|
+
# @param title [String] Job title of the contact person.
|
30
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
31
|
+
# @return [Pinnacle::Types::NullableContact]
|
32
|
+
def initialize(email: OMIT, name: OMIT, phone: OMIT, title: OMIT, additional_properties: nil)
|
33
|
+
@email = email if email != OMIT
|
34
|
+
@name = name if name != OMIT
|
35
|
+
@phone = phone if phone != OMIT
|
36
|
+
@title = title if title != OMIT
|
37
|
+
@additional_properties = additional_properties
|
38
|
+
@_field_set = { "email": email, "name": name, "phone": phone, "title": title }.reject do |_k, v|
|
39
|
+
v == OMIT
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
# Deserialize a JSON object to an instance of NullableContact
|
44
|
+
#
|
45
|
+
# @param json_object [String]
|
46
|
+
# @return [Pinnacle::Types::NullableContact]
|
47
|
+
def self.from_json(json_object:)
|
48
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
49
|
+
parsed_json = JSON.parse(json_object)
|
50
|
+
email = parsed_json["email"]
|
51
|
+
name = parsed_json["name"]
|
52
|
+
phone = parsed_json["phone"]
|
53
|
+
title = parsed_json["title"]
|
54
|
+
new(
|
55
|
+
email: email,
|
56
|
+
name: name,
|
57
|
+
phone: phone,
|
58
|
+
title: title,
|
59
|
+
additional_properties: struct
|
60
|
+
)
|
61
|
+
end
|
62
|
+
|
63
|
+
# Serialize an instance of NullableContact to a JSON object
|
64
|
+
#
|
65
|
+
# @return [String]
|
66
|
+
def to_json(*_args)
|
67
|
+
@_field_set&.to_json
|
68
|
+
end
|
69
|
+
|
70
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
71
|
+
# hash and check each fields type against the current object's property
|
72
|
+
# definitions.
|
73
|
+
#
|
74
|
+
# @param obj [Object]
|
75
|
+
# @return [Void]
|
76
|
+
def self.validate_raw(obj:)
|
77
|
+
obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.")
|
78
|
+
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
79
|
+
obj.phone&.is_a?(String) != false || raise("Passed value for field obj.phone is not the expected type, validation failed.")
|
80
|
+
obj.title&.is_a?(String) != false || raise("Passed value for field obj.title is not the expected type, validation failed.")
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Pinnacle
|
7
|
+
module Types
|
8
|
+
# Multiple formatting representations of the same phone number for different use
|
9
|
+
# cases.
|
10
|
+
# Provides flexibility for display, storage, and integration requirements.
|
11
|
+
class NumberFormat
|
12
|
+
# @return [String] Phone number in E.164 format with country code prefix.
|
13
|
+
attr_reader :international
|
14
|
+
# @return [String] Phone number formatted according to national conventions. <br>
|
15
|
+
# Includes parentheses, spaces, and dashes as commonly used in the country.
|
16
|
+
attr_reader :national
|
17
|
+
# @return [String] Phone number with only digits, no formatting or country code prefix.
|
18
|
+
attr_reader :raw
|
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 international [String] Phone number in E.164 format with country code prefix.
|
28
|
+
# @param national [String] Phone number formatted according to national conventions. <br>
|
29
|
+
# Includes parentheses, spaces, and dashes as commonly used in the country.
|
30
|
+
# @param raw [String] Phone number with only digits, no formatting or country code prefix.
|
31
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
32
|
+
# @return [Pinnacle::Types::NumberFormat]
|
33
|
+
def initialize(international:, national:, raw:, additional_properties: nil)
|
34
|
+
@international = international
|
35
|
+
@national = national
|
36
|
+
@raw = raw
|
37
|
+
@additional_properties = additional_properties
|
38
|
+
@_field_set = { "international": international, "national": national, "raw": raw }
|
39
|
+
end
|
40
|
+
|
41
|
+
# Deserialize a JSON object to an instance of NumberFormat
|
42
|
+
#
|
43
|
+
# @param json_object [String]
|
44
|
+
# @return [Pinnacle::Types::NumberFormat]
|
45
|
+
def self.from_json(json_object:)
|
46
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
47
|
+
parsed_json = JSON.parse(json_object)
|
48
|
+
international = parsed_json["international"]
|
49
|
+
national = parsed_json["national"]
|
50
|
+
raw = parsed_json["raw"]
|
51
|
+
new(
|
52
|
+
international: international,
|
53
|
+
national: national,
|
54
|
+
raw: raw,
|
55
|
+
additional_properties: struct
|
56
|
+
)
|
57
|
+
end
|
58
|
+
|
59
|
+
# Serialize an instance of NumberFormat to a JSON object
|
60
|
+
#
|
61
|
+
# @return [String]
|
62
|
+
def to_json(*_args)
|
63
|
+
@_field_set&.to_json
|
64
|
+
end
|
65
|
+
|
66
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
67
|
+
# hash and check each fields type against the current object's property
|
68
|
+
# definitions.
|
69
|
+
#
|
70
|
+
# @param obj [Object]
|
71
|
+
# @return [Void]
|
72
|
+
def self.validate_raw(obj:)
|
73
|
+
obj.international.is_a?(String) != false || raise("Passed value for field obj.international is not the expected type, validation failed.")
|
74
|
+
obj.national.is_a?(String) != false || raise("Passed value for field obj.national is not the expected type, validation failed.")
|
75
|
+
obj.raw.is_a?(String) != false || raise("Passed value for field obj.raw is not the expected type, validation failed.")
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,145 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "optional_contacts"
|
4
|
+
require_relative "company_sector_enum"
|
5
|
+
require_relative "company_type_enum"
|
6
|
+
require "ostruct"
|
7
|
+
require "json"
|
8
|
+
|
9
|
+
module Pinnacle
|
10
|
+
module Types
|
11
|
+
class OptionalBrandInfo
|
12
|
+
# @return [String] Primary brand address where this brand is located.
|
13
|
+
attr_reader :address
|
14
|
+
# @return [Pinnacle::Types::OptionalContacts]
|
15
|
+
attr_reader :contact
|
16
|
+
# @return [String] "Doing Business As" name - the public name this brand operates under.
|
17
|
+
attr_reader :dba
|
18
|
+
# @return [String] Brief description of what this brand does.
|
19
|
+
attr_reader :description
|
20
|
+
# @return [String] Employer Identification Number (EIN) assigned by the IRS.
|
21
|
+
attr_reader :ein
|
22
|
+
# @return [String] Main contact email address for this brand.
|
23
|
+
attr_reader :email
|
24
|
+
# @return [String] Legal name of the brand as registered.
|
25
|
+
attr_reader :name
|
26
|
+
# @return [Pinnacle::Types::CompanySectorEnum]
|
27
|
+
attr_reader :sector
|
28
|
+
# @return [Pinnacle::Types::CompanyTypeEnum]
|
29
|
+
attr_reader :type
|
30
|
+
# @return [String] Brand website URL.
|
31
|
+
attr_reader :website
|
32
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
33
|
+
attr_reader :additional_properties
|
34
|
+
# @return [Object]
|
35
|
+
attr_reader :_field_set
|
36
|
+
protected :_field_set
|
37
|
+
|
38
|
+
OMIT = Object.new
|
39
|
+
|
40
|
+
# @param address [String] Primary brand address where this brand is located.
|
41
|
+
# @param contact [Pinnacle::Types::OptionalContacts]
|
42
|
+
# @param dba [String] "Doing Business As" name - the public name this brand operates under.
|
43
|
+
# @param description [String] Brief description of what this brand does.
|
44
|
+
# @param ein [String] Employer Identification Number (EIN) assigned by the IRS.
|
45
|
+
# @param email [String] Main contact email address for this brand.
|
46
|
+
# @param name [String] Legal name of the brand as registered.
|
47
|
+
# @param sector [Pinnacle::Types::CompanySectorEnum]
|
48
|
+
# @param type [Pinnacle::Types::CompanyTypeEnum]
|
49
|
+
# @param website [String] Brand website URL.
|
50
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
51
|
+
# @return [Pinnacle::Types::OptionalBrandInfo]
|
52
|
+
def initialize(address: OMIT, contact: OMIT, dba: OMIT, description: OMIT, ein: OMIT, email: OMIT, name: OMIT,
|
53
|
+
sector: OMIT, type: OMIT, website: OMIT, additional_properties: nil)
|
54
|
+
@address = address if address != OMIT
|
55
|
+
@contact = contact if contact != OMIT
|
56
|
+
@dba = dba if dba != OMIT
|
57
|
+
@description = description if description != OMIT
|
58
|
+
@ein = ein if ein != OMIT
|
59
|
+
@email = email if email != OMIT
|
60
|
+
@name = name if name != OMIT
|
61
|
+
@sector = sector if sector != OMIT
|
62
|
+
@type = type if type != OMIT
|
63
|
+
@website = website if website != OMIT
|
64
|
+
@additional_properties = additional_properties
|
65
|
+
@_field_set = {
|
66
|
+
"address": address,
|
67
|
+
"contact": contact,
|
68
|
+
"dba": dba,
|
69
|
+
"description": description,
|
70
|
+
"ein": ein,
|
71
|
+
"email": email,
|
72
|
+
"name": name,
|
73
|
+
"sector": sector,
|
74
|
+
"type": type,
|
75
|
+
"website": website
|
76
|
+
}.reject do |_k, v|
|
77
|
+
v == OMIT
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
# Deserialize a JSON object to an instance of OptionalBrandInfo
|
82
|
+
#
|
83
|
+
# @param json_object [String]
|
84
|
+
# @return [Pinnacle::Types::OptionalBrandInfo]
|
85
|
+
def self.from_json(json_object:)
|
86
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
87
|
+
parsed_json = JSON.parse(json_object)
|
88
|
+
address = parsed_json["address"]
|
89
|
+
if parsed_json["contact"].nil?
|
90
|
+
contact = nil
|
91
|
+
else
|
92
|
+
contact = parsed_json["contact"].to_json
|
93
|
+
contact = Pinnacle::Types::OptionalContacts.from_json(json_object: contact)
|
94
|
+
end
|
95
|
+
dba = parsed_json["dba"]
|
96
|
+
description = parsed_json["description"]
|
97
|
+
ein = parsed_json["ein"]
|
98
|
+
email = parsed_json["email"]
|
99
|
+
name = parsed_json["name"]
|
100
|
+
sector = parsed_json["sector"]
|
101
|
+
type = parsed_json["type"]
|
102
|
+
website = parsed_json["website"]
|
103
|
+
new(
|
104
|
+
address: address,
|
105
|
+
contact: contact,
|
106
|
+
dba: dba,
|
107
|
+
description: description,
|
108
|
+
ein: ein,
|
109
|
+
email: email,
|
110
|
+
name: name,
|
111
|
+
sector: sector,
|
112
|
+
type: type,
|
113
|
+
website: website,
|
114
|
+
additional_properties: struct
|
115
|
+
)
|
116
|
+
end
|
117
|
+
|
118
|
+
# Serialize an instance of OptionalBrandInfo to a JSON object
|
119
|
+
#
|
120
|
+
# @return [String]
|
121
|
+
def to_json(*_args)
|
122
|
+
@_field_set&.to_json
|
123
|
+
end
|
124
|
+
|
125
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
126
|
+
# hash and check each fields type against the current object's property
|
127
|
+
# definitions.
|
128
|
+
#
|
129
|
+
# @param obj [Object]
|
130
|
+
# @return [Void]
|
131
|
+
def self.validate_raw(obj:)
|
132
|
+
obj.address&.is_a?(String) != false || raise("Passed value for field obj.address is not the expected type, validation failed.")
|
133
|
+
obj.contact.nil? || Pinnacle::Types::OptionalContacts.validate_raw(obj: obj.contact)
|
134
|
+
obj.dba&.is_a?(String) != false || raise("Passed value for field obj.dba is not the expected type, validation failed.")
|
135
|
+
obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
136
|
+
obj.ein&.is_a?(String) != false || raise("Passed value for field obj.ein is not the expected type, validation failed.")
|
137
|
+
obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.")
|
138
|
+
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
139
|
+
obj.sector&.is_a?(Pinnacle::Types::CompanySectorEnum) != false || raise("Passed value for field obj.sector is not the expected type, validation failed.")
|
140
|
+
obj.type&.is_a?(Pinnacle::Types::CompanyTypeEnum) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
141
|
+
obj.website&.is_a?(String) != false || raise("Passed value for field obj.website is not the expected type, validation failed.")
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Pinnacle
|
7
|
+
module Types
|
8
|
+
class OptionalContact
|
9
|
+
# @return [String] New notes or details for your contact.
|
10
|
+
attr_reader :description
|
11
|
+
# @return [String] New email address for your contact.
|
12
|
+
attr_reader :email
|
13
|
+
# @return [String] New name for your contact.
|
14
|
+
attr_reader :name
|
15
|
+
# @return [Array<String>] New tags for your contact.
|
16
|
+
attr_reader :tags
|
17
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
18
|
+
attr_reader :additional_properties
|
19
|
+
# @return [Object]
|
20
|
+
attr_reader :_field_set
|
21
|
+
protected :_field_set
|
22
|
+
|
23
|
+
OMIT = Object.new
|
24
|
+
|
25
|
+
# @param description [String] New notes or details for your contact.
|
26
|
+
# @param email [String] New email address for your contact.
|
27
|
+
# @param name [String] New name for your contact.
|
28
|
+
# @param tags [Array<String>] New tags for your contact.
|
29
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
30
|
+
# @return [Pinnacle::Types::OptionalContact]
|
31
|
+
def initialize(description: OMIT, email: OMIT, name: OMIT, tags: OMIT, additional_properties: nil)
|
32
|
+
@description = description if description != OMIT
|
33
|
+
@email = email if email != OMIT
|
34
|
+
@name = name if name != OMIT
|
35
|
+
@tags = tags if tags != OMIT
|
36
|
+
@additional_properties = additional_properties
|
37
|
+
@_field_set = { "description": description, "email": email, "name": name, "tags": tags }.reject do |_k, v|
|
38
|
+
v == OMIT
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# Deserialize a JSON object to an instance of OptionalContact
|
43
|
+
#
|
44
|
+
# @param json_object [String]
|
45
|
+
# @return [Pinnacle::Types::OptionalContact]
|
46
|
+
def self.from_json(json_object:)
|
47
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
48
|
+
parsed_json = JSON.parse(json_object)
|
49
|
+
description = parsed_json["description"]
|
50
|
+
email = parsed_json["email"]
|
51
|
+
name = parsed_json["name"]
|
52
|
+
tags = parsed_json["tags"]
|
53
|
+
new(
|
54
|
+
description: description,
|
55
|
+
email: email,
|
56
|
+
name: name,
|
57
|
+
tags: tags,
|
58
|
+
additional_properties: struct
|
59
|
+
)
|
60
|
+
end
|
61
|
+
|
62
|
+
# Serialize an instance of OptionalContact 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
|
+
obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
|
77
|
+
obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.")
|
78
|
+
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
79
|
+
obj.tags&.is_a?(Array) != false || raise("Passed value for field obj.tags is not the expected type, validation failed.")
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "ostruct"
|
4
|
+
require "json"
|
5
|
+
|
6
|
+
module Pinnacle
|
7
|
+
module Types
|
8
|
+
# Contact information for the primary brand representative.
|
9
|
+
class OptionalContacts
|
10
|
+
# @return [String] Email address of the contact person.
|
11
|
+
attr_reader :email
|
12
|
+
# @return [String] Full name of the contact person.
|
13
|
+
attr_reader :name
|
14
|
+
# @return [String] Phone number of the contact person in E.164 format.
|
15
|
+
attr_reader :phone
|
16
|
+
# @return [String] Job title or position oft he contact person.
|
17
|
+
attr_reader :title
|
18
|
+
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
19
|
+
attr_reader :additional_properties
|
20
|
+
# @return [Object]
|
21
|
+
attr_reader :_field_set
|
22
|
+
protected :_field_set
|
23
|
+
|
24
|
+
OMIT = Object.new
|
25
|
+
|
26
|
+
# @param email [String] Email address of the contact person.
|
27
|
+
# @param name [String] Full name of the contact person.
|
28
|
+
# @param phone [String] Phone number of the contact person in E.164 format.
|
29
|
+
# @param title [String] Job title or position oft he contact person.
|
30
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
31
|
+
# @return [Pinnacle::Types::OptionalContacts]
|
32
|
+
def initialize(email: OMIT, name: OMIT, phone: OMIT, title: OMIT, additional_properties: nil)
|
33
|
+
@email = email if email != OMIT
|
34
|
+
@name = name if name != OMIT
|
35
|
+
@phone = phone if phone != OMIT
|
36
|
+
@title = title if title != OMIT
|
37
|
+
@additional_properties = additional_properties
|
38
|
+
@_field_set = { "email": email, "name": name, "phone": phone, "title": title }.reject do |_k, v|
|
39
|
+
v == OMIT
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
# Deserialize a JSON object to an instance of OptionalContacts
|
44
|
+
#
|
45
|
+
# @param json_object [String]
|
46
|
+
# @return [Pinnacle::Types::OptionalContacts]
|
47
|
+
def self.from_json(json_object:)
|
48
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
49
|
+
parsed_json = JSON.parse(json_object)
|
50
|
+
email = parsed_json["email"]
|
51
|
+
name = parsed_json["name"]
|
52
|
+
phone = parsed_json["phone"]
|
53
|
+
title = parsed_json["title"]
|
54
|
+
new(
|
55
|
+
email: email,
|
56
|
+
name: name,
|
57
|
+
phone: phone,
|
58
|
+
title: title,
|
59
|
+
additional_properties: struct
|
60
|
+
)
|
61
|
+
end
|
62
|
+
|
63
|
+
# Serialize an instance of OptionalContacts to a JSON object
|
64
|
+
#
|
65
|
+
# @return [String]
|
66
|
+
def to_json(*_args)
|
67
|
+
@_field_set&.to_json
|
68
|
+
end
|
69
|
+
|
70
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
71
|
+
# hash and check each fields type against the current object's property
|
72
|
+
# definitions.
|
73
|
+
#
|
74
|
+
# @param obj [Object]
|
75
|
+
# @return [Void]
|
76
|
+
def self.validate_raw(obj:)
|
77
|
+
obj.email&.is_a?(String) != false || raise("Passed value for field obj.email is not the expected type, validation failed.")
|
78
|
+
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
79
|
+
obj.phone&.is_a?(String) != false || raise("Passed value for field obj.phone is not the expected type, validation failed.")
|
80
|
+
obj.title&.is_a?(String) != false || raise("Passed value for field obj.title is not the expected type, validation failed.")
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "phone_capabilities"
|
4
|
+
require "ostruct"
|
5
|
+
require "json"
|
6
|
+
|
7
|
+
module Pinnacle
|
8
|
+
module Types
|
9
|
+
# Information about a phone number sender in a conversation.
|
10
|
+
class Phone
|
11
|
+
# @return [Pinnacle::Types::PhoneCapabilities]
|
12
|
+
attr_reader :capabilities
|
13
|
+
# @return [String] ISO 8601 timestamp when the phone sender was created.
|
14
|
+
attr_reader :created_at
|
15
|
+
# @return [Boolean] Whether this phone number is in sandbox/testing mode.
|
16
|
+
attr_reader :is_sandbox
|
17
|
+
# @return [String] The sender's phone number in E.164 format.
|
18
|
+
attr_reader :phone_number
|
19
|
+
# @return [String] ISO 8601 timestamp when the phone sender was last updated
|
20
|
+
attr_reader :updated_at
|
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 capabilities [Pinnacle::Types::PhoneCapabilities]
|
30
|
+
# @param created_at [String] ISO 8601 timestamp when the phone sender was created.
|
31
|
+
# @param is_sandbox [Boolean] Whether this phone number is in sandbox/testing mode.
|
32
|
+
# @param phone_number [String] The sender's phone number in E.164 format.
|
33
|
+
# @param updated_at [String] ISO 8601 timestamp when the phone sender was last updated
|
34
|
+
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
35
|
+
# @return [Pinnacle::Types::Phone]
|
36
|
+
def initialize(capabilities:, created_at:, is_sandbox:, phone_number:, updated_at:, additional_properties: nil)
|
37
|
+
@capabilities = capabilities
|
38
|
+
@created_at = created_at
|
39
|
+
@is_sandbox = is_sandbox
|
40
|
+
@phone_number = phone_number
|
41
|
+
@updated_at = updated_at
|
42
|
+
@additional_properties = additional_properties
|
43
|
+
@_field_set = {
|
44
|
+
"capabilities": capabilities,
|
45
|
+
"createdAt": created_at,
|
46
|
+
"isSandbox": is_sandbox,
|
47
|
+
"phoneNumber": phone_number,
|
48
|
+
"updatedAt": updated_at
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
# Deserialize a JSON object to an instance of Phone
|
53
|
+
#
|
54
|
+
# @param json_object [String]
|
55
|
+
# @return [Pinnacle::Types::Phone]
|
56
|
+
def self.from_json(json_object:)
|
57
|
+
struct = JSON.parse(json_object, object_class: OpenStruct)
|
58
|
+
parsed_json = JSON.parse(json_object)
|
59
|
+
if parsed_json["capabilities"].nil?
|
60
|
+
capabilities = nil
|
61
|
+
else
|
62
|
+
capabilities = parsed_json["capabilities"].to_json
|
63
|
+
capabilities = Pinnacle::Types::PhoneCapabilities.from_json(json_object: capabilities)
|
64
|
+
end
|
65
|
+
created_at = parsed_json["createdAt"]
|
66
|
+
is_sandbox = parsed_json["isSandbox"]
|
67
|
+
phone_number = parsed_json["phoneNumber"]
|
68
|
+
updated_at = parsed_json["updatedAt"]
|
69
|
+
new(
|
70
|
+
capabilities: capabilities,
|
71
|
+
created_at: created_at,
|
72
|
+
is_sandbox: is_sandbox,
|
73
|
+
phone_number: phone_number,
|
74
|
+
updated_at: updated_at,
|
75
|
+
additional_properties: struct
|
76
|
+
)
|
77
|
+
end
|
78
|
+
|
79
|
+
# Serialize an instance of Phone to a JSON object
|
80
|
+
#
|
81
|
+
# @return [String]
|
82
|
+
def to_json(*_args)
|
83
|
+
@_field_set&.to_json
|
84
|
+
end
|
85
|
+
|
86
|
+
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
87
|
+
# hash and check each fields type against the current object's property
|
88
|
+
# definitions.
|
89
|
+
#
|
90
|
+
# @param obj [Object]
|
91
|
+
# @return [Void]
|
92
|
+
def self.validate_raw(obj:)
|
93
|
+
Pinnacle::Types::PhoneCapabilities.validate_raw(obj: obj.capabilities)
|
94
|
+
obj.created_at.is_a?(String) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
|
95
|
+
obj.is_sandbox.is_a?(Boolean) != false || raise("Passed value for field obj.is_sandbox is not the expected type, validation failed.")
|
96
|
+
obj.phone_number.is_a?(String) != false || raise("Passed value for field obj.phone_number is not the expected type, validation failed.")
|
97
|
+
obj.updated_at.is_a?(String) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|