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
@@ -1,79 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "sender_metadata"
|
4
|
-
require_relative "message_metadata"
|
5
|
-
require "ostruct"
|
6
|
-
require "json"
|
7
|
-
|
8
|
-
module Pinnacle
|
9
|
-
class InboundMessageMetadata
|
10
|
-
# @return [Pinnacle::SenderMetadata]
|
11
|
-
attr_reader :sender
|
12
|
-
# @return [Pinnacle::MessageMetadata]
|
13
|
-
attr_reader :message
|
14
|
-
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
-
attr_reader :additional_properties
|
16
|
-
# @return [Object]
|
17
|
-
attr_reader :_field_set
|
18
|
-
protected :_field_set
|
19
|
-
|
20
|
-
OMIT = Object.new
|
21
|
-
|
22
|
-
# @param sender [Pinnacle::SenderMetadata]
|
23
|
-
# @param message [Pinnacle::MessageMetadata]
|
24
|
-
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
25
|
-
# @return [Pinnacle::InboundMessageMetadata]
|
26
|
-
def initialize(sender: OMIT, message: OMIT, additional_properties: nil)
|
27
|
-
@sender = sender if sender != OMIT
|
28
|
-
@message = message if message != OMIT
|
29
|
-
@additional_properties = additional_properties
|
30
|
-
@_field_set = { "sender": sender, "message": message }.reject do |_k, v|
|
31
|
-
v == OMIT
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
# Deserialize a JSON object to an instance of InboundMessageMetadata
|
36
|
-
#
|
37
|
-
# @param json_object [String]
|
38
|
-
# @return [Pinnacle::InboundMessageMetadata]
|
39
|
-
def self.from_json(json_object:)
|
40
|
-
struct = JSON.parse(json_object, object_class: OpenStruct)
|
41
|
-
parsed_json = JSON.parse(json_object)
|
42
|
-
if parsed_json["sender"].nil?
|
43
|
-
sender = nil
|
44
|
-
else
|
45
|
-
sender = parsed_json["sender"].to_json
|
46
|
-
sender = Pinnacle::SenderMetadata.from_json(json_object: sender)
|
47
|
-
end
|
48
|
-
if parsed_json["message"].nil?
|
49
|
-
message = nil
|
50
|
-
else
|
51
|
-
message = parsed_json["message"].to_json
|
52
|
-
message = Pinnacle::MessageMetadata.from_json(json_object: message)
|
53
|
-
end
|
54
|
-
new(
|
55
|
-
sender: sender,
|
56
|
-
message: message,
|
57
|
-
additional_properties: struct
|
58
|
-
)
|
59
|
-
end
|
60
|
-
|
61
|
-
# Serialize an instance of InboundMessageMetadata to a JSON object
|
62
|
-
#
|
63
|
-
# @return [String]
|
64
|
-
def to_json(*_args)
|
65
|
-
@_field_set&.to_json
|
66
|
-
end
|
67
|
-
|
68
|
-
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
69
|
-
# hash and check each fields type against the current object's property
|
70
|
-
# definitions.
|
71
|
-
#
|
72
|
-
# @param obj [Object]
|
73
|
-
# @return [Void]
|
74
|
-
def self.validate_raw(obj:)
|
75
|
-
obj.sender.nil? || Pinnacle::SenderMetadata.validate_raw(obj: obj.sender)
|
76
|
-
obj.message.nil? || Pinnacle::MessageMetadata.validate_raw(obj: obj.message)
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
@@ -1,100 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "inbound_message_metadata"
|
4
|
-
require "ostruct"
|
5
|
-
require "json"
|
6
|
-
|
7
|
-
module Pinnacle
|
8
|
-
class InboundTextMessage
|
9
|
-
# @return [String]
|
10
|
-
attr_reader :message_type
|
11
|
-
# @return [String]
|
12
|
-
attr_reader :text
|
13
|
-
# @return [String]
|
14
|
-
attr_reader :from
|
15
|
-
# @return [String]
|
16
|
-
attr_reader :to
|
17
|
-
# @return [Pinnacle::InboundMessageMetadata]
|
18
|
-
attr_reader :metadata
|
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 message_type [String]
|
28
|
-
# @param text [String]
|
29
|
-
# @param from [String]
|
30
|
-
# @param to [String]
|
31
|
-
# @param metadata [Pinnacle::InboundMessageMetadata]
|
32
|
-
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
33
|
-
# @return [Pinnacle::InboundTextMessage]
|
34
|
-
def initialize(text:, from:, to:, message_type: OMIT, metadata: OMIT, additional_properties: nil)
|
35
|
-
@message_type = message_type if message_type != OMIT
|
36
|
-
@text = text
|
37
|
-
@from = from
|
38
|
-
@to = to
|
39
|
-
@metadata = metadata if metadata != OMIT
|
40
|
-
@additional_properties = additional_properties
|
41
|
-
@_field_set = {
|
42
|
-
"messageType": message_type,
|
43
|
-
"text": text,
|
44
|
-
"from": from,
|
45
|
-
"to": to,
|
46
|
-
"metadata": metadata
|
47
|
-
}.reject do |_k, v|
|
48
|
-
v == OMIT
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
# Deserialize a JSON object to an instance of InboundTextMessage
|
53
|
-
#
|
54
|
-
# @param json_object [String]
|
55
|
-
# @return [Pinnacle::InboundTextMessage]
|
56
|
-
def self.from_json(json_object:)
|
57
|
-
struct = JSON.parse(json_object, object_class: OpenStruct)
|
58
|
-
parsed_json = JSON.parse(json_object)
|
59
|
-
message_type = parsed_json["messageType"]
|
60
|
-
text = parsed_json["text"]
|
61
|
-
from = parsed_json["from"]
|
62
|
-
to = parsed_json["to"]
|
63
|
-
if parsed_json["metadata"].nil?
|
64
|
-
metadata = nil
|
65
|
-
else
|
66
|
-
metadata = parsed_json["metadata"].to_json
|
67
|
-
metadata = Pinnacle::InboundMessageMetadata.from_json(json_object: metadata)
|
68
|
-
end
|
69
|
-
new(
|
70
|
-
message_type: message_type,
|
71
|
-
text: text,
|
72
|
-
from: from,
|
73
|
-
to: to,
|
74
|
-
metadata: metadata,
|
75
|
-
additional_properties: struct
|
76
|
-
)
|
77
|
-
end
|
78
|
-
|
79
|
-
# Serialize an instance of InboundTextMessage 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
|
-
obj.message_type&.is_a?(String) != false || raise("Passed value for field obj.message_type is not the expected type, validation failed.")
|
94
|
-
obj.text.is_a?(String) != false || raise("Passed value for field obj.text is not the expected type, validation failed.")
|
95
|
-
obj.from.is_a?(String) != false || raise("Passed value for field obj.from is not the expected type, validation failed.")
|
96
|
-
obj.to.is_a?(String) != false || raise("Passed value for field obj.to is not the expected type, validation failed.")
|
97
|
-
obj.metadata.nil? || Pinnacle::InboundMessageMetadata.validate_raw(obj: obj.metadata)
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "ostruct"
|
4
|
-
require "json"
|
5
|
-
|
6
|
-
module Pinnacle
|
7
|
-
class InternalServerErrorBody
|
8
|
-
# @return [Array<String>]
|
9
|
-
attr_reader :errors
|
10
|
-
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
11
|
-
attr_reader :additional_properties
|
12
|
-
# @return [Object]
|
13
|
-
attr_reader :_field_set
|
14
|
-
protected :_field_set
|
15
|
-
|
16
|
-
OMIT = Object.new
|
17
|
-
|
18
|
-
# @param errors [Array<String>]
|
19
|
-
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
20
|
-
# @return [Pinnacle::InternalServerErrorBody]
|
21
|
-
def initialize(errors: OMIT, additional_properties: nil)
|
22
|
-
@errors = errors if errors != OMIT
|
23
|
-
@additional_properties = additional_properties
|
24
|
-
@_field_set = { "errors": errors }.reject do |_k, v|
|
25
|
-
v == OMIT
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
# Deserialize a JSON object to an instance of InternalServerErrorBody
|
30
|
-
#
|
31
|
-
# @param json_object [String]
|
32
|
-
# @return [Pinnacle::InternalServerErrorBody]
|
33
|
-
def self.from_json(json_object:)
|
34
|
-
struct = JSON.parse(json_object, object_class: OpenStruct)
|
35
|
-
parsed_json = JSON.parse(json_object)
|
36
|
-
errors = parsed_json["errors"]
|
37
|
-
new(errors: errors, additional_properties: struct)
|
38
|
-
end
|
39
|
-
|
40
|
-
# Serialize an instance of InternalServerErrorBody to a JSON object
|
41
|
-
#
|
42
|
-
# @return [String]
|
43
|
-
def to_json(*_args)
|
44
|
-
@_field_set&.to_json
|
45
|
-
end
|
46
|
-
|
47
|
-
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
48
|
-
# hash and check each fields type against the current object's property
|
49
|
-
# definitions.
|
50
|
-
#
|
51
|
-
# @param obj [Object]
|
52
|
-
# @return [Void]
|
53
|
-
def self.validate_raw(obj:)
|
54
|
-
obj.errors&.is_a?(Array) != false || raise("Passed value for field obj.errors is not the expected type, validation failed.")
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
@@ -1,65 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "ostruct"
|
4
|
-
require "json"
|
5
|
-
|
6
|
-
module Pinnacle
|
7
|
-
class MediaPayload
|
8
|
-
# @return [String]
|
9
|
-
attr_reader :type
|
10
|
-
# @return [String]
|
11
|
-
attr_reader :url
|
12
|
-
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
13
|
-
attr_reader :additional_properties
|
14
|
-
# @return [Object]
|
15
|
-
attr_reader :_field_set
|
16
|
-
protected :_field_set
|
17
|
-
|
18
|
-
OMIT = Object.new
|
19
|
-
|
20
|
-
# @param type [String]
|
21
|
-
# @param url [String]
|
22
|
-
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
23
|
-
# @return [Pinnacle::MediaPayload]
|
24
|
-
def initialize(type:, url:, additional_properties: nil)
|
25
|
-
@type = type
|
26
|
-
@url = url
|
27
|
-
@additional_properties = additional_properties
|
28
|
-
@_field_set = { "type": type, "url": url }
|
29
|
-
end
|
30
|
-
|
31
|
-
# Deserialize a JSON object to an instance of MediaPayload
|
32
|
-
#
|
33
|
-
# @param json_object [String]
|
34
|
-
# @return [Pinnacle::MediaPayload]
|
35
|
-
def self.from_json(json_object:)
|
36
|
-
struct = JSON.parse(json_object, object_class: OpenStruct)
|
37
|
-
parsed_json = JSON.parse(json_object)
|
38
|
-
type = parsed_json["type"]
|
39
|
-
url = parsed_json["url"]
|
40
|
-
new(
|
41
|
-
type: type,
|
42
|
-
url: url,
|
43
|
-
additional_properties: struct
|
44
|
-
)
|
45
|
-
end
|
46
|
-
|
47
|
-
# Serialize an instance of MediaPayload to a JSON object
|
48
|
-
#
|
49
|
-
# @return [String]
|
50
|
-
def to_json(*_args)
|
51
|
-
@_field_set&.to_json
|
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
|
-
obj.type.is_a?(String) != false || raise("Passed value for field obj.type is not the expected type, validation failed.")
|
62
|
-
obj.url.is_a?(String) != false || raise("Passed value for field obj.url is not the expected type, validation failed.")
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
@@ -1,56 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "date"
|
4
|
-
require "ostruct"
|
5
|
-
require "json"
|
6
|
-
|
7
|
-
module Pinnacle
|
8
|
-
class MessageMetadata
|
9
|
-
# @return [DateTime]
|
10
|
-
attr_reader :timestamp
|
11
|
-
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
12
|
-
attr_reader :additional_properties
|
13
|
-
# @return [Object]
|
14
|
-
attr_reader :_field_set
|
15
|
-
protected :_field_set
|
16
|
-
|
17
|
-
OMIT = Object.new
|
18
|
-
|
19
|
-
# @param timestamp [DateTime]
|
20
|
-
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
21
|
-
# @return [Pinnacle::MessageMetadata]
|
22
|
-
def initialize(timestamp:, additional_properties: nil)
|
23
|
-
@timestamp = timestamp
|
24
|
-
@additional_properties = additional_properties
|
25
|
-
@_field_set = { "timestamp": timestamp }
|
26
|
-
end
|
27
|
-
|
28
|
-
# Deserialize a JSON object to an instance of MessageMetadata
|
29
|
-
#
|
30
|
-
# @param json_object [String]
|
31
|
-
# @return [Pinnacle::MessageMetadata]
|
32
|
-
def self.from_json(json_object:)
|
33
|
-
struct = JSON.parse(json_object, object_class: OpenStruct)
|
34
|
-
parsed_json = JSON.parse(json_object)
|
35
|
-
timestamp = (DateTime.parse(parsed_json["timestamp"]) unless parsed_json["timestamp"].nil?)
|
36
|
-
new(timestamp: timestamp, additional_properties: struct)
|
37
|
-
end
|
38
|
-
|
39
|
-
# Serialize an instance of MessageMetadata to a JSON object
|
40
|
-
#
|
41
|
-
# @return [String]
|
42
|
-
def to_json(*_args)
|
43
|
-
@_field_set&.to_json
|
44
|
-
end
|
45
|
-
|
46
|
-
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
47
|
-
# hash and check each fields type against the current object's property
|
48
|
-
# definitions.
|
49
|
-
#
|
50
|
-
# @param obj [Object]
|
51
|
-
# @return [Void]
|
52
|
-
def self.validate_raw(obj:)
|
53
|
-
obj.timestamp.is_a?(DateTime) != false || raise("Passed value for field obj.timestamp is not the expected type, validation failed.")
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
data/lib/rcs/types/messaging.rb
DELETED
@@ -1,95 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "ostruct"
|
4
|
-
require "json"
|
5
|
-
|
6
|
-
module Pinnacle
|
7
|
-
class Messaging
|
8
|
-
# @return [String] Explain how users will opt in to receive messages.
|
9
|
-
attr_reader :opt_in
|
10
|
-
# @return [String] Explain how users will opt out of receiving messages.
|
11
|
-
attr_reader :opt_out
|
12
|
-
# @return [Array<String>] Please provide the unique keywords to opt out. Each keyword should not contain
|
13
|
-
# spaces.
|
14
|
-
attr_reader :opt_out_keywords
|
15
|
-
# @return [String] Please define what your agent will do.
|
16
|
-
attr_reader :agent_use_case
|
17
|
-
# @return [String] Please provide some example messages that your agent will send.
|
18
|
-
attr_reader :expected_agent_responses
|
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 opt_in [String] Explain how users will opt in to receive messages.
|
28
|
-
# @param opt_out [String] Explain how users will opt out of receiving messages.
|
29
|
-
# @param opt_out_keywords [Array<String>] Please provide the unique keywords to opt out. Each keyword should not contain
|
30
|
-
# spaces.
|
31
|
-
# @param agent_use_case [String] Please define what your agent will do.
|
32
|
-
# @param expected_agent_responses [String] Please provide some example messages that your agent will send.
|
33
|
-
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
34
|
-
# @return [Pinnacle::Messaging]
|
35
|
-
def initialize(opt_in:, opt_out:, opt_out_keywords:, agent_use_case:, expected_agent_responses:,
|
36
|
-
additional_properties: nil)
|
37
|
-
@opt_in = opt_in
|
38
|
-
@opt_out = opt_out
|
39
|
-
@opt_out_keywords = opt_out_keywords
|
40
|
-
@agent_use_case = agent_use_case
|
41
|
-
@expected_agent_responses = expected_agent_responses
|
42
|
-
@additional_properties = additional_properties
|
43
|
-
@_field_set = {
|
44
|
-
"optIn": opt_in,
|
45
|
-
"optOut": opt_out,
|
46
|
-
"optOutKeywords": opt_out_keywords,
|
47
|
-
"agentUseCase": agent_use_case,
|
48
|
-
"expectedAgentResponses": expected_agent_responses
|
49
|
-
}
|
50
|
-
end
|
51
|
-
|
52
|
-
# Deserialize a JSON object to an instance of Messaging
|
53
|
-
#
|
54
|
-
# @param json_object [String]
|
55
|
-
# @return [Pinnacle::Messaging]
|
56
|
-
def self.from_json(json_object:)
|
57
|
-
struct = JSON.parse(json_object, object_class: OpenStruct)
|
58
|
-
parsed_json = JSON.parse(json_object)
|
59
|
-
opt_in = parsed_json["optIn"]
|
60
|
-
opt_out = parsed_json["optOut"]
|
61
|
-
opt_out_keywords = parsed_json["optOutKeywords"]
|
62
|
-
agent_use_case = parsed_json["agentUseCase"]
|
63
|
-
expected_agent_responses = parsed_json["expectedAgentResponses"]
|
64
|
-
new(
|
65
|
-
opt_in: opt_in,
|
66
|
-
opt_out: opt_out,
|
67
|
-
opt_out_keywords: opt_out_keywords,
|
68
|
-
agent_use_case: agent_use_case,
|
69
|
-
expected_agent_responses: expected_agent_responses,
|
70
|
-
additional_properties: struct
|
71
|
-
)
|
72
|
-
end
|
73
|
-
|
74
|
-
# Serialize an instance of Messaging to a JSON object
|
75
|
-
#
|
76
|
-
# @return [String]
|
77
|
-
def to_json(*_args)
|
78
|
-
@_field_set&.to_json
|
79
|
-
end
|
80
|
-
|
81
|
-
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
82
|
-
# hash and check each fields type against the current object's property
|
83
|
-
# definitions.
|
84
|
-
#
|
85
|
-
# @param obj [Object]
|
86
|
-
# @return [Void]
|
87
|
-
def self.validate_raw(obj:)
|
88
|
-
obj.opt_in.is_a?(String) != false || raise("Passed value for field obj.opt_in is not the expected type, validation failed.")
|
89
|
-
obj.opt_out.is_a?(String) != false || raise("Passed value for field obj.opt_out is not the expected type, validation failed.")
|
90
|
-
obj.opt_out_keywords.is_a?(Array) != false || raise("Passed value for field obj.opt_out_keywords is not the expected type, validation failed.")
|
91
|
-
obj.agent_use_case.is_a?(String) != false || raise("Passed value for field obj.agent_use_case is not the expected type, validation failed.")
|
92
|
-
obj.expected_agent_responses.is_a?(String) != false || raise("Passed value for field obj.expected_agent_responses is not the expected type, validation failed.")
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
data/lib/rcs/types/optionals.rb
DELETED
@@ -1,99 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "additional_website"
|
4
|
-
require_relative "additional_phone_number"
|
5
|
-
require_relative "additional_email"
|
6
|
-
require "ostruct"
|
7
|
-
require "json"
|
8
|
-
|
9
|
-
module Pinnacle
|
10
|
-
class Optionals
|
11
|
-
# @return [Array<Pinnacle::AdditionalWebsite>] List of additional websites, up to 2.
|
12
|
-
attr_reader :additional_websites
|
13
|
-
# @return [Array<Pinnacle::AdditionalPhoneNumber>] List of additional phone numbers, up to 2.
|
14
|
-
attr_reader :additional_phone_numbers
|
15
|
-
# @return [Array<Pinnacle::AdditionalEmail>] List of additional email addresses, up to 2.
|
16
|
-
attr_reader :additional_emails
|
17
|
-
# @return [Array<String>]
|
18
|
-
attr_reader :test_numbers
|
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 additional_websites [Array<Pinnacle::AdditionalWebsite>] List of additional websites, up to 2.
|
28
|
-
# @param additional_phone_numbers [Array<Pinnacle::AdditionalPhoneNumber>] List of additional phone numbers, up to 2.
|
29
|
-
# @param additional_emails [Array<Pinnacle::AdditionalEmail>] List of additional email addresses, up to 2.
|
30
|
-
# @param test_numbers [Array<String>]
|
31
|
-
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
32
|
-
# @return [Pinnacle::Optionals]
|
33
|
-
def initialize(additional_websites: OMIT, additional_phone_numbers: OMIT, additional_emails: OMIT,
|
34
|
-
test_numbers: OMIT, additional_properties: nil)
|
35
|
-
@additional_websites = additional_websites if additional_websites != OMIT
|
36
|
-
@additional_phone_numbers = additional_phone_numbers if additional_phone_numbers != OMIT
|
37
|
-
@additional_emails = additional_emails if additional_emails != OMIT
|
38
|
-
@test_numbers = test_numbers if test_numbers != OMIT
|
39
|
-
@additional_properties = additional_properties
|
40
|
-
@_field_set = {
|
41
|
-
"additionalWebsites": additional_websites,
|
42
|
-
"additionalPhoneNumbers": additional_phone_numbers,
|
43
|
-
"additionalEmails": additional_emails,
|
44
|
-
"testNumbers": test_numbers
|
45
|
-
}.reject do |_k, v|
|
46
|
-
v == OMIT
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
# Deserialize a JSON object to an instance of Optionals
|
51
|
-
#
|
52
|
-
# @param json_object [String]
|
53
|
-
# @return [Pinnacle::Optionals]
|
54
|
-
def self.from_json(json_object:)
|
55
|
-
struct = JSON.parse(json_object, object_class: OpenStruct)
|
56
|
-
parsed_json = JSON.parse(json_object)
|
57
|
-
additional_websites = parsed_json["additionalWebsites"]&.map do |item|
|
58
|
-
item = item.to_json
|
59
|
-
Pinnacle::AdditionalWebsite.from_json(json_object: item)
|
60
|
-
end
|
61
|
-
additional_phone_numbers = parsed_json["additionalPhoneNumbers"]&.map do |item|
|
62
|
-
item = item.to_json
|
63
|
-
Pinnacle::AdditionalPhoneNumber.from_json(json_object: item)
|
64
|
-
end
|
65
|
-
additional_emails = parsed_json["additionalEmails"]&.map do |item|
|
66
|
-
item = item.to_json
|
67
|
-
Pinnacle::AdditionalEmail.from_json(json_object: item)
|
68
|
-
end
|
69
|
-
test_numbers = parsed_json["testNumbers"]
|
70
|
-
new(
|
71
|
-
additional_websites: additional_websites,
|
72
|
-
additional_phone_numbers: additional_phone_numbers,
|
73
|
-
additional_emails: additional_emails,
|
74
|
-
test_numbers: test_numbers,
|
75
|
-
additional_properties: struct
|
76
|
-
)
|
77
|
-
end
|
78
|
-
|
79
|
-
# Serialize an instance of Optionals 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
|
-
obj.additional_websites&.is_a?(Array) != false || raise("Passed value for field obj.additional_websites is not the expected type, validation failed.")
|
94
|
-
obj.additional_phone_numbers&.is_a?(Array) != false || raise("Passed value for field obj.additional_phone_numbers is not the expected type, validation failed.")
|
95
|
-
obj.additional_emails&.is_a?(Array) != false || raise("Passed value for field obj.additional_emails is not the expected type, validation failed.")
|
96
|
-
obj.test_numbers&.is_a?(Array) != false || raise("Passed value for field obj.test_numbers is not the expected type, validation failed.")
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|
@@ -1,57 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "ostruct"
|
4
|
-
require "json"
|
5
|
-
|
6
|
-
module Pinnacle
|
7
|
-
class PaymentRequiredErrorBody
|
8
|
-
# @return [Array<String>]
|
9
|
-
attr_reader :errors
|
10
|
-
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
11
|
-
attr_reader :additional_properties
|
12
|
-
# @return [Object]
|
13
|
-
attr_reader :_field_set
|
14
|
-
protected :_field_set
|
15
|
-
|
16
|
-
OMIT = Object.new
|
17
|
-
|
18
|
-
# @param errors [Array<String>]
|
19
|
-
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
20
|
-
# @return [Pinnacle::PaymentRequiredErrorBody]
|
21
|
-
def initialize(errors: OMIT, additional_properties: nil)
|
22
|
-
@errors = errors if errors != OMIT
|
23
|
-
@additional_properties = additional_properties
|
24
|
-
@_field_set = { "errors": errors }.reject do |_k, v|
|
25
|
-
v == OMIT
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
# Deserialize a JSON object to an instance of PaymentRequiredErrorBody
|
30
|
-
#
|
31
|
-
# @param json_object [String]
|
32
|
-
# @return [Pinnacle::PaymentRequiredErrorBody]
|
33
|
-
def self.from_json(json_object:)
|
34
|
-
struct = JSON.parse(json_object, object_class: OpenStruct)
|
35
|
-
parsed_json = JSON.parse(json_object)
|
36
|
-
errors = parsed_json["errors"]
|
37
|
-
new(errors: errors, additional_properties: struct)
|
38
|
-
end
|
39
|
-
|
40
|
-
# Serialize an instance of PaymentRequiredErrorBody to a JSON object
|
41
|
-
#
|
42
|
-
# @return [String]
|
43
|
-
def to_json(*_args)
|
44
|
-
@_field_set&.to_json
|
45
|
-
end
|
46
|
-
|
47
|
-
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
48
|
-
# hash and check each fields type against the current object's property
|
49
|
-
# definitions.
|
50
|
-
#
|
51
|
-
# @param obj [Object]
|
52
|
-
# @return [Void]
|
53
|
-
def self.validate_raw(obj:)
|
54
|
-
obj.errors&.is_a?(Array) != false || raise("Passed value for field obj.errors is not the expected type, validation failed.")
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
@@ -1,72 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "ostruct"
|
4
|
-
require "json"
|
5
|
-
|
6
|
-
module Pinnacle
|
7
|
-
class PointOfContact
|
8
|
-
# @return [String] Point of contact's name.
|
9
|
-
attr_reader :poc_name
|
10
|
-
# @return [String] Point of contact's title.
|
11
|
-
attr_reader :poc_title
|
12
|
-
# @return [String] Point of contact's email address.
|
13
|
-
attr_reader :poc_email
|
14
|
-
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
15
|
-
attr_reader :additional_properties
|
16
|
-
# @return [Object]
|
17
|
-
attr_reader :_field_set
|
18
|
-
protected :_field_set
|
19
|
-
|
20
|
-
OMIT = Object.new
|
21
|
-
|
22
|
-
# @param poc_name [String] Point of contact's name.
|
23
|
-
# @param poc_title [String] Point of contact's title.
|
24
|
-
# @param poc_email [String] Point of contact's email address.
|
25
|
-
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
26
|
-
# @return [Pinnacle::PointOfContact]
|
27
|
-
def initialize(poc_name:, poc_title:, poc_email:, additional_properties: nil)
|
28
|
-
@poc_name = poc_name
|
29
|
-
@poc_title = poc_title
|
30
|
-
@poc_email = poc_email
|
31
|
-
@additional_properties = additional_properties
|
32
|
-
@_field_set = { "pocName": poc_name, "pocTitle": poc_title, "pocEmail": poc_email }
|
33
|
-
end
|
34
|
-
|
35
|
-
# Deserialize a JSON object to an instance of PointOfContact
|
36
|
-
#
|
37
|
-
# @param json_object [String]
|
38
|
-
# @return [Pinnacle::PointOfContact]
|
39
|
-
def self.from_json(json_object:)
|
40
|
-
struct = JSON.parse(json_object, object_class: OpenStruct)
|
41
|
-
parsed_json = JSON.parse(json_object)
|
42
|
-
poc_name = parsed_json["pocName"]
|
43
|
-
poc_title = parsed_json["pocTitle"]
|
44
|
-
poc_email = parsed_json["pocEmail"]
|
45
|
-
new(
|
46
|
-
poc_name: poc_name,
|
47
|
-
poc_title: poc_title,
|
48
|
-
poc_email: poc_email,
|
49
|
-
additional_properties: struct
|
50
|
-
)
|
51
|
-
end
|
52
|
-
|
53
|
-
# Serialize an instance of PointOfContact to a JSON object
|
54
|
-
#
|
55
|
-
# @return [String]
|
56
|
-
def to_json(*_args)
|
57
|
-
@_field_set&.to_json
|
58
|
-
end
|
59
|
-
|
60
|
-
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
61
|
-
# hash and check each fields type against the current object's property
|
62
|
-
# definitions.
|
63
|
-
#
|
64
|
-
# @param obj [Object]
|
65
|
-
# @return [Void]
|
66
|
-
def self.validate_raw(obj:)
|
67
|
-
obj.poc_name.is_a?(String) != false || raise("Passed value for field obj.poc_name is not the expected type, validation failed.")
|
68
|
-
obj.poc_title.is_a?(String) != false || raise("Passed value for field obj.poc_title is not the expected type, validation failed.")
|
69
|
-
obj.poc_email.is_a?(String) != false || raise("Passed value for field obj.poc_email is not the expected type, validation failed.")
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|