sunshine-conversations-client 10.0.1 → 11.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG_RB.md +50 -38
- data/README.md +9 -5
- data/docs/Content.md +3 -1
- data/docs/Field.md +1 -9
- data/docs/FormMessage.md +3 -1
- data/docs/FormMessageField.md +35 -0
- data/docs/FormMessageFieldAllOf.md +23 -0
- data/docs/FormResponseMessage.md +1 -1
- data/docs/FormResponseMessageField.md +29 -0
- data/docs/FormResponseMessageFieldAllOf.md +17 -0
- data/lib/sunshine-conversations-client/api/activities_api.rb +1 -1
- data/lib/sunshine-conversations-client/api/app_keys_api.rb +1 -1
- data/lib/sunshine-conversations-client/api/apps_api.rb +1 -1
- data/lib/sunshine-conversations-client/api/attachments_api.rb +1 -1
- data/lib/sunshine-conversations-client/api/clients_api.rb +1 -1
- data/lib/sunshine-conversations-client/api/conversations_api.rb +1 -1
- data/lib/sunshine-conversations-client/api/custom_integration_api_keys_api.rb +1 -1
- data/lib/sunshine-conversations-client/api/integrations_api.rb +1 -1
- data/lib/sunshine-conversations-client/api/messages_api.rb +1 -1
- data/lib/sunshine-conversations-client/api/o_auth_endpoints_api.rb +1 -1
- data/lib/sunshine-conversations-client/api/participants_api.rb +1 -1
- data/lib/sunshine-conversations-client/api/switchboard_actions_api.rb +1 -1
- data/lib/sunshine-conversations-client/api/switchboard_integrations_api.rb +1 -1
- data/lib/sunshine-conversations-client/api/switchboards_api.rb +1 -1
- data/lib/sunshine-conversations-client/api/users_api.rb +1 -1
- data/lib/sunshine-conversations-client/api/webhooks_api.rb +1 -1
- data/lib/sunshine-conversations-client/api_client.rb +1 -1
- data/lib/sunshine-conversations-client/api_error.rb +1 -1
- data/lib/sunshine-conversations-client/configuration.rb +1 -1
- data/lib/sunshine-conversations-client/models/accept_control_body.rb +1 -1
- data/lib/sunshine-conversations-client/models/action.rb +1 -1
- data/lib/sunshine-conversations-client/models/action_subset.rb +1 -1
- data/lib/sunshine-conversations-client/models/activity.rb +1 -1
- data/lib/sunshine-conversations-client/models/activity_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/activity_post.rb +1 -1
- data/lib/sunshine-conversations-client/models/activity_post_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/activity_types.rb +1 -1
- data/lib/sunshine-conversations-client/models/android.rb +1 -1
- data/lib/sunshine-conversations-client/models/android_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/android_update.rb +1 -1
- data/lib/sunshine-conversations-client/models/android_update_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/api_key.rb +1 -1
- data/lib/sunshine-conversations-client/models/app.rb +1 -1
- data/lib/sunshine-conversations-client/models/app_create_body.rb +1 -1
- data/lib/sunshine-conversations-client/models/app_key.rb +1 -1
- data/lib/sunshine-conversations-client/models/app_key_create_body.rb +1 -1
- data/lib/sunshine-conversations-client/models/app_key_list_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/app_key_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/app_list_filter.rb +1 -1
- data/lib/sunshine-conversations-client/models/app_list_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/app_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/app_settings.rb +1 -1
- data/lib/sunshine-conversations-client/models/app_sub_schema.rb +1 -1
- data/lib/sunshine-conversations-client/models/app_update_body.rb +1 -1
- data/lib/sunshine-conversations-client/models/apple.rb +1 -1
- data/lib/sunshine-conversations-client/models/apple_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/apple_update.rb +1 -1
- data/lib/sunshine-conversations-client/models/attachment_delete_body.rb +1 -1
- data/lib/sunshine-conversations-client/models/attachment_media_token_body.rb +1 -1
- data/lib/sunshine-conversations-client/models/attachment_media_token_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/attachment_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/attachment_schema.rb +1 -1
- data/lib/sunshine-conversations-client/models/attachment_upload_body.rb +1 -1
- data/lib/sunshine-conversations-client/models/author.rb +1 -1
- data/lib/sunshine-conversations-client/models/author_webhook.rb +1 -1
- data/lib/sunshine-conversations-client/models/buy.rb +1 -1
- data/lib/sunshine-conversations-client/models/campaign.rb +1 -1
- data/lib/sunshine-conversations-client/models/carousel_message.rb +1 -1
- data/lib/sunshine-conversations-client/models/carousel_message_display_settings.rb +1 -1
- data/lib/sunshine-conversations-client/models/client.rb +1 -1
- data/lib/sunshine-conversations-client/models/client_add_event.rb +1 -1
- data/lib/sunshine-conversations-client/models/client_add_event_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/client_add_event_all_of_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/client_association.rb +1 -1
- data/lib/sunshine-conversations-client/models/client_create.rb +1 -1
- data/lib/sunshine-conversations-client/models/client_list_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/client_remove_event.rb +1 -1
- data/lib/sunshine-conversations-client/models/client_remove_event_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/client_remove_event_all_of_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/client_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/client_type.rb +1 -1
- data/lib/sunshine-conversations-client/models/client_update_event.rb +1 -1
- data/lib/sunshine-conversations-client/models/client_update_event_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/client_update_event_all_of_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/confirmation.rb +1 -1
- data/lib/sunshine-conversations-client/models/content.rb +13 -3
- data/lib/sunshine-conversations-client/models/conversation.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_create_body.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_create_event.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_create_event_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_create_event_all_of_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_join_event.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_join_event_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_join_event_all_of_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_leave_event.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_leave_event_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_leave_event_all_of_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_list_filter.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_list_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_message_delivery_channel_event.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_message_delivery_channel_event_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_message_delivery_failure_event.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_message_delivery_failure_event_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_message_delivery_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_message_delivery_payload_destination.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_message_delivery_payload_external_messages.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_message_delivery_payload_message.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_message_delivery_user_event.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_message_event.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_message_event_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_message_event_all_of_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_postback_event.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_postback_event_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_postback_event_all_of_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_read_event.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_read_event_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_read_event_all_of_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_referral_event.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_referral_event_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_referral_event_all_of_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_remove_event.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_remove_event_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_remove_event_all_of_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_truncated.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_type.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_typing_event.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_typing_event_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_typing_event_all_of_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/conversation_update_body.rb +1 -1
- data/lib/sunshine-conversations-client/models/custom.rb +1 -1
- data/lib/sunshine-conversations-client/models/custom_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/custom_update.rb +1 -1
- data/lib/sunshine-conversations-client/models/destination.rb +1 -1
- data/lib/sunshine-conversations-client/models/device.rb +1 -1
- data/lib/sunshine-conversations-client/models/event_sub_schema.rb +1 -1
- data/lib/sunshine-conversations-client/models/extra_channel_options.rb +1 -1
- data/lib/sunshine-conversations-client/models/extra_channel_options_messenger.rb +1 -1
- data/lib/sunshine-conversations-client/models/field.rb +10 -126
- data/lib/sunshine-conversations-client/models/file_message.rb +1 -1
- data/lib/sunshine-conversations-client/models/form_message.rb +13 -3
- data/lib/sunshine-conversations-client/models/form_message_field.rb +529 -0
- data/lib/sunshine-conversations-client/models/form_message_field_all_of.rb +310 -0
- data/lib/sunshine-conversations-client/models/form_response_message.rb +2 -2
- data/lib/sunshine-conversations-client/models/form_response_message_field.rb +424 -0
- data/lib/sunshine-conversations-client/models/form_response_message_field_all_of.rb +205 -0
- data/lib/sunshine-conversations-client/models/identity.rb +1 -1
- data/lib/sunshine-conversations-client/models/image_message.rb +1 -1
- data/lib/sunshine-conversations-client/models/inline_object.rb +1 -1
- data/lib/sunshine-conversations-client/models/instagram.rb +1 -1
- data/lib/sunshine-conversations-client/models/instagram_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/instagram_update.rb +1 -1
- data/lib/sunshine-conversations-client/models/instagram_update_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/integration.rb +1 -1
- data/lib/sunshine-conversations-client/models/integration_api_key.rb +1 -1
- data/lib/sunshine-conversations-client/models/integration_api_key_list_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/integration_api_key_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/integration_id.rb +1 -1
- data/lib/sunshine-conversations-client/models/integration_list_filter.rb +1 -1
- data/lib/sunshine-conversations-client/models/integration_list_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/integration_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/integration_type.rb +1 -1
- data/lib/sunshine-conversations-client/models/integration_update.rb +1 -1
- data/lib/sunshine-conversations-client/models/integration_update_base.rb +1 -1
- data/lib/sunshine-conversations-client/models/ios.rb +1 -1
- data/lib/sunshine-conversations-client/models/ios_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/ios_update.rb +1 -1
- data/lib/sunshine-conversations-client/models/ios_update_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/item.rb +1 -1
- data/lib/sunshine-conversations-client/models/line.rb +1 -1
- data/lib/sunshine-conversations-client/models/line_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/line_update.rb +1 -1
- data/lib/sunshine-conversations-client/models/link.rb +1 -1
- data/lib/sunshine-conversations-client/models/links.rb +1 -1
- data/lib/sunshine-conversations-client/models/list_message.rb +1 -1
- data/lib/sunshine-conversations-client/models/location_message.rb +1 -1
- data/lib/sunshine-conversations-client/models/location_message_coordinates.rb +1 -1
- data/lib/sunshine-conversations-client/models/location_message_location.rb +1 -1
- data/lib/sunshine-conversations-client/models/location_request.rb +1 -1
- data/lib/sunshine-conversations-client/models/mailgun.rb +1 -1
- data/lib/sunshine-conversations-client/models/mailgun_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/mailgun_update.rb +1 -1
- data/lib/sunshine-conversations-client/models/mailgun_update_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/match_criteria.rb +1 -1
- data/lib/sunshine-conversations-client/models/match_criteria_base.rb +1 -1
- data/lib/sunshine-conversations-client/models/match_criteria_mailgun.rb +1 -1
- data/lib/sunshine-conversations-client/models/match_criteria_mailgun_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/match_criteria_messagebird.rb +1 -1
- data/lib/sunshine-conversations-client/models/match_criteria_messagebird_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/match_criteria_twilio.rb +1 -1
- data/lib/sunshine-conversations-client/models/match_criteria_twilio_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/match_criteria_whatsapp.rb +1 -1
- data/lib/sunshine-conversations-client/models/match_criteria_whatsapp_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/message.rb +1 -1
- data/lib/sunshine-conversations-client/models/message_bird_update.rb +1 -1
- data/lib/sunshine-conversations-client/models/message_list_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/message_override.rb +1 -1
- data/lib/sunshine-conversations-client/models/message_override_apple.rb +1 -1
- data/lib/sunshine-conversations-client/models/message_override_line.rb +1 -1
- data/lib/sunshine-conversations-client/models/message_override_messenger.rb +1 -1
- data/lib/sunshine-conversations-client/models/message_override_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/message_override_whatsapp.rb +1 -1
- data/lib/sunshine-conversations-client/models/message_post.rb +1 -1
- data/lib/sunshine-conversations-client/models/message_post_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/message_webhook.rb +1 -1
- data/lib/sunshine-conversations-client/models/messagebird.rb +1 -1
- data/lib/sunshine-conversations-client/models/messagebird_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/messenger.rb +1 -1
- data/lib/sunshine-conversations-client/models/messenger_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/messenger_update.rb +1 -1
- data/lib/sunshine-conversations-client/models/meta.rb +1 -1
- data/lib/sunshine-conversations-client/models/offer_control_body.rb +1 -1
- data/lib/sunshine-conversations-client/models/page.rb +1 -1
- data/lib/sunshine-conversations-client/models/participant.rb +1 -1
- data/lib/sunshine-conversations-client/models/participant_join_body.rb +1 -1
- data/lib/sunshine-conversations-client/models/participant_leave_body.rb +1 -1
- data/lib/sunshine-conversations-client/models/participant_leave_body_participant_id.rb +1 -1
- data/lib/sunshine-conversations-client/models/participant_leave_body_user_external_id.rb +1 -1
- data/lib/sunshine-conversations-client/models/participant_leave_body_user_id.rb +1 -1
- data/lib/sunshine-conversations-client/models/participant_list_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/participant_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/participant_sub_schema.rb +1 -1
- data/lib/sunshine-conversations-client/models/participant_with_user_external_id.rb +1 -1
- data/lib/sunshine-conversations-client/models/participant_with_user_id.rb +1 -1
- data/lib/sunshine-conversations-client/models/pass_control_body.rb +1 -1
- data/lib/sunshine-conversations-client/models/postback.rb +1 -1
- data/lib/sunshine-conversations-client/models/postback_webhook.rb +1 -1
- data/lib/sunshine-conversations-client/models/prechat_capture.rb +1 -1
- data/lib/sunshine-conversations-client/models/profile.rb +1 -1
- data/lib/sunshine-conversations-client/models/quoted_message.rb +1 -1
- data/lib/sunshine-conversations-client/models/quoted_message_external_message_id.rb +1 -1
- data/lib/sunshine-conversations-client/models/quoted_message_message.rb +1 -1
- data/lib/sunshine-conversations-client/models/referral.rb +1 -1
- data/lib/sunshine-conversations-client/models/referral_details.rb +1 -1
- data/lib/sunshine-conversations-client/models/reply.rb +1 -1
- data/lib/sunshine-conversations-client/models/source.rb +1 -1
- data/lib/sunshine-conversations-client/models/source_webhook.rb +1 -1
- data/lib/sunshine-conversations-client/models/source_with_campaign_webhook.rb +1 -1
- data/lib/sunshine-conversations-client/models/source_with_campaign_webhook_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/status.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_accept_control.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_accept_control_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_accept_control_all_of_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_accept_control_failure.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_accept_control_failure_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_accept_control_failure_all_of_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_integration.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_integration_create_body.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_integration_list_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_integration_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_integration_update_body.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_integration_webhook.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_list_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_offer_control.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_offer_control_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_offer_control_all_of_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_offer_control_failure.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_pass_control.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_pass_control_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_pass_control_all_of_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_pass_control_failure.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/switchboard_update_body.rb +1 -1
- data/lib/sunshine-conversations-client/models/target.rb +1 -1
- data/lib/sunshine-conversations-client/models/telegram.rb +1 -1
- data/lib/sunshine-conversations-client/models/telegram_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/telegram_update.rb +1 -1
- data/lib/sunshine-conversations-client/models/template_message.rb +1 -1
- data/lib/sunshine-conversations-client/models/text_message.rb +1 -1
- data/lib/sunshine-conversations-client/models/twilio.rb +1 -1
- data/lib/sunshine-conversations-client/models/twilio_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/twilio_update.rb +1 -1
- data/lib/sunshine-conversations-client/models/twitter.rb +1 -1
- data/lib/sunshine-conversations-client/models/twitter_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/twitter_update.rb +1 -1
- data/lib/sunshine-conversations-client/models/user.rb +1 -1
- data/lib/sunshine-conversations-client/models/user_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/user_create_body.rb +1 -1
- data/lib/sunshine-conversations-client/models/user_merge_event.rb +1 -1
- data/lib/sunshine-conversations-client/models/user_merge_event_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/user_merge_event_all_of_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/user_merge_event_all_of_payload_merged_clients.rb +1 -1
- data/lib/sunshine-conversations-client/models/user_merge_event_all_of_payload_merged_conversations.rb +1 -1
- data/lib/sunshine-conversations-client/models/user_merge_event_all_of_payload_merged_users.rb +1 -1
- data/lib/sunshine-conversations-client/models/user_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/user_truncated.rb +1 -1
- data/lib/sunshine-conversations-client/models/user_update_body.rb +1 -1
- data/lib/sunshine-conversations-client/models/user_update_event.rb +1 -1
- data/lib/sunshine-conversations-client/models/user_update_event_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/user_update_event_all_of_payload.rb +1 -1
- data/lib/sunshine-conversations-client/models/viber.rb +1 -1
- data/lib/sunshine-conversations-client/models/viber_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/viber_update.rb +1 -1
- data/lib/sunshine-conversations-client/models/web.rb +1 -1
- data/lib/sunshine-conversations-client/models/web_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/web_update.rb +1 -1
- data/lib/sunshine-conversations-client/models/web_update_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/webhook.rb +1 -1
- data/lib/sunshine-conversations-client/models/webhook_body.rb +1 -1
- data/lib/sunshine-conversations-client/models/webhook_create_body.rb +1 -1
- data/lib/sunshine-conversations-client/models/webhook_list_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/webhook_response.rb +1 -1
- data/lib/sunshine-conversations-client/models/webhook_sub_schema.rb +1 -1
- data/lib/sunshine-conversations-client/models/webview.rb +1 -1
- data/lib/sunshine-conversations-client/models/whats_app_update.rb +1 -1
- data/lib/sunshine-conversations-client/models/whats_app_update_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/models/whatsapp.rb +1 -1
- data/lib/sunshine-conversations-client/models/whatsapp_all_of.rb +1 -1
- data/lib/sunshine-conversations-client/version.rb +2 -2
- data/lib/sunshine-conversations-client.rb +5 -1
- data/spec/api_client_spec.rb +1 -1
- data/spec/configuration_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/sunshine-conversations-client.gemspec +1 -1
- metadata +10 -2
@@ -0,0 +1,424 @@
|
|
1
|
+
=begin
|
2
|
+
#Sunshine Conversations API
|
3
|
+
|
4
|
+
The version of the OpenAPI document: 11.0.0
|
5
|
+
|
6
|
+
Generated by: https://openapi-generator.tech
|
7
|
+
OpenAPI Generator version: 4.3.1
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'date'
|
11
|
+
|
12
|
+
module SunshineConversationsClient
|
13
|
+
class FormResponseMessageField
|
14
|
+
# The field type.
|
15
|
+
attr_accessor :type
|
16
|
+
|
17
|
+
# The name of the field. Must be unique per form or formResponse.
|
18
|
+
attr_accessor :name
|
19
|
+
|
20
|
+
# The label of the field. What the field is displayed as on Web Messenger.
|
21
|
+
attr_accessor :label
|
22
|
+
|
23
|
+
# Specifies the response for a text field.
|
24
|
+
attr_accessor :text
|
25
|
+
|
26
|
+
# Specifies the response for a email field.
|
27
|
+
attr_accessor :email
|
28
|
+
|
29
|
+
# Array of objects representing the response for a field of type select. Form and formResponse messages only.
|
30
|
+
attr_accessor :select
|
31
|
+
|
32
|
+
# The messageId for the form that this response belongs to.
|
33
|
+
attr_accessor :quoted_message_id
|
34
|
+
|
35
|
+
class EnumAttributeValidator
|
36
|
+
attr_reader :datatype
|
37
|
+
attr_reader :allowable_values
|
38
|
+
|
39
|
+
def initialize(datatype, allowable_values)
|
40
|
+
@allowable_values = allowable_values.map do |value|
|
41
|
+
case datatype.to_s
|
42
|
+
when /Integer/i
|
43
|
+
value.to_i
|
44
|
+
when /Float/i
|
45
|
+
value.to_f
|
46
|
+
else
|
47
|
+
value
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def valid?(value)
|
53
|
+
!value || allowable_values.include?(value)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
58
|
+
def self.attribute_map
|
59
|
+
{
|
60
|
+
:'type' => :'type',
|
61
|
+
:'name' => :'name',
|
62
|
+
:'label' => :'label',
|
63
|
+
:'text' => :'text',
|
64
|
+
:'email' => :'email',
|
65
|
+
:'select' => :'select',
|
66
|
+
:'quoted_message_id' => :'quotedMessageId'
|
67
|
+
}
|
68
|
+
end
|
69
|
+
|
70
|
+
# Attribute type mapping.
|
71
|
+
def self.openapi_types
|
72
|
+
{
|
73
|
+
:'type' => :'String',
|
74
|
+
:'name' => :'String',
|
75
|
+
:'label' => :'String',
|
76
|
+
:'text' => :'String',
|
77
|
+
:'email' => :'String',
|
78
|
+
:'select' => :'Array<Object>',
|
79
|
+
:'quoted_message_id' => :'String'
|
80
|
+
}
|
81
|
+
end
|
82
|
+
|
83
|
+
# List of attributes with nullable: true
|
84
|
+
def self.openapi_nullable
|
85
|
+
Set.new([
|
86
|
+
])
|
87
|
+
end
|
88
|
+
|
89
|
+
# List of class defined in allOf (OpenAPI v3)
|
90
|
+
def self.openapi_all_of
|
91
|
+
[
|
92
|
+
:'Field',
|
93
|
+
:'FormResponseMessageFieldAllOf'
|
94
|
+
]
|
95
|
+
end
|
96
|
+
|
97
|
+
# Initializes the object
|
98
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
99
|
+
def initialize(attributes = {})
|
100
|
+
if (!attributes.is_a?(Hash))
|
101
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SunshineConversationsClient::FormResponseMessageField` initialize method"
|
102
|
+
end
|
103
|
+
|
104
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
105
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
106
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
107
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SunshineConversationsClient::FormResponseMessageField`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
108
|
+
end
|
109
|
+
h[k.to_sym] = v
|
110
|
+
}
|
111
|
+
|
112
|
+
if attributes.key?(:'type')
|
113
|
+
self.type = attributes[:'type']
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.key?(:'name')
|
117
|
+
self.name = attributes[:'name']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.key?(:'label')
|
121
|
+
self.label = attributes[:'label']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'text')
|
125
|
+
self.text = attributes[:'text']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'email')
|
129
|
+
self.email = attributes[:'email']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.key?(:'select')
|
133
|
+
end
|
134
|
+
|
135
|
+
if attributes.key?(:'quoted_message_id')
|
136
|
+
self.quoted_message_id = attributes[:'quoted_message_id']
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
141
|
+
# @return Array for valid properties with the reasons
|
142
|
+
def list_invalid_properties
|
143
|
+
invalid_properties = Array.new
|
144
|
+
if @type.nil?
|
145
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
146
|
+
end
|
147
|
+
|
148
|
+
if @name.nil?
|
149
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
150
|
+
end
|
151
|
+
|
152
|
+
if @name.to_s.length > 128
|
153
|
+
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 128.')
|
154
|
+
end
|
155
|
+
|
156
|
+
if @name.to_s.length < 1
|
157
|
+
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
158
|
+
end
|
159
|
+
|
160
|
+
if @label.nil?
|
161
|
+
invalid_properties.push('invalid value for "label", label cannot be nil.')
|
162
|
+
end
|
163
|
+
|
164
|
+
if @label.to_s.length > 128
|
165
|
+
invalid_properties.push('invalid value for "label", the character length must be smaller than or equal to 128.')
|
166
|
+
end
|
167
|
+
|
168
|
+
if @label.to_s.length < 1
|
169
|
+
invalid_properties.push('invalid value for "label", the character length must be great than or equal to 1.')
|
170
|
+
end
|
171
|
+
|
172
|
+
if !@text.nil? && @text.to_s.length > 256
|
173
|
+
invalid_properties.push('invalid value for "text", the character length must be smaller than or equal to 256.')
|
174
|
+
end
|
175
|
+
|
176
|
+
if !@text.nil? && @text.to_s.length < 1
|
177
|
+
invalid_properties.push('invalid value for "text", the character length must be great than or equal to 1.')
|
178
|
+
end
|
179
|
+
|
180
|
+
if !@email.nil? && @email.to_s.length > 128
|
181
|
+
invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 128.')
|
182
|
+
end
|
183
|
+
|
184
|
+
if !@email.nil? && @email.to_s.length < 1
|
185
|
+
invalid_properties.push('invalid value for "email", the character length must be great than or equal to 1.')
|
186
|
+
end
|
187
|
+
|
188
|
+
invalid_properties
|
189
|
+
end
|
190
|
+
|
191
|
+
# Check to see if the all the properties in the model are valid
|
192
|
+
# @return true if the model is valid
|
193
|
+
def valid?
|
194
|
+
return false if @type.nil?
|
195
|
+
type_validator = EnumAttributeValidator.new('String', ["email", "select", "text"])
|
196
|
+
return false unless type_validator.valid?(@type)
|
197
|
+
return false if @name.nil?
|
198
|
+
return false if @name.to_s.length > 128
|
199
|
+
return false if @name.to_s.length < 1
|
200
|
+
return false if @label.nil?
|
201
|
+
return false if @label.to_s.length > 128
|
202
|
+
return false if @label.to_s.length < 1
|
203
|
+
return false if !@text.nil? && @text.to_s.length > 256
|
204
|
+
return false if !@text.nil? && @text.to_s.length < 1
|
205
|
+
return false if !@email.nil? && @email.to_s.length > 128
|
206
|
+
return false if !@email.nil? && @email.to_s.length < 1
|
207
|
+
true
|
208
|
+
end
|
209
|
+
|
210
|
+
# Custom attribute writer method checking allowed values (enum).
|
211
|
+
# @param [Object] type Object to be assigned
|
212
|
+
def type=(type)
|
213
|
+
validator = EnumAttributeValidator.new('String', ["email", "select", "text"])
|
214
|
+
unless validator.valid?(type)
|
215
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
216
|
+
end
|
217
|
+
@type = type
|
218
|
+
end
|
219
|
+
|
220
|
+
# Custom attribute writer method with validation
|
221
|
+
# @param [Object] name Value to be assigned
|
222
|
+
def name=(name)
|
223
|
+
if name.nil?
|
224
|
+
fail ArgumentError, 'name cannot be nil'
|
225
|
+
end
|
226
|
+
|
227
|
+
if name.to_s.length > 128
|
228
|
+
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 128.'
|
229
|
+
end
|
230
|
+
|
231
|
+
if name.to_s.length < 1
|
232
|
+
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
233
|
+
end
|
234
|
+
|
235
|
+
@name = name
|
236
|
+
end
|
237
|
+
|
238
|
+
# Custom attribute writer method with validation
|
239
|
+
# @param [Object] label Value to be assigned
|
240
|
+
def label=(label)
|
241
|
+
if label.nil?
|
242
|
+
fail ArgumentError, 'label cannot be nil'
|
243
|
+
end
|
244
|
+
|
245
|
+
if label.to_s.length > 128
|
246
|
+
fail ArgumentError, 'invalid value for "label", the character length must be smaller than or equal to 128.'
|
247
|
+
end
|
248
|
+
|
249
|
+
if label.to_s.length < 1
|
250
|
+
fail ArgumentError, 'invalid value for "label", the character length must be great than or equal to 1.'
|
251
|
+
end
|
252
|
+
|
253
|
+
@label = label
|
254
|
+
end
|
255
|
+
|
256
|
+
# Custom attribute writer method with validation
|
257
|
+
# @param [Object] text Value to be assigned
|
258
|
+
def text=(text)
|
259
|
+
if !text.nil? && text.to_s.length > 256
|
260
|
+
fail ArgumentError, 'invalid value for "text", the character length must be smaller than or equal to 256.'
|
261
|
+
end
|
262
|
+
|
263
|
+
if !text.nil? && text.to_s.length < 1
|
264
|
+
fail ArgumentError, 'invalid value for "text", the character length must be great than or equal to 1.'
|
265
|
+
end
|
266
|
+
|
267
|
+
@text = text
|
268
|
+
end
|
269
|
+
|
270
|
+
# Custom attribute writer method with validation
|
271
|
+
# @param [Object] email Value to be assigned
|
272
|
+
def email=(email)
|
273
|
+
if !email.nil? && email.to_s.length > 128
|
274
|
+
fail ArgumentError, 'invalid value for "email", the character length must be smaller than or equal to 128.'
|
275
|
+
end
|
276
|
+
|
277
|
+
if !email.nil? && email.to_s.length < 1
|
278
|
+
fail ArgumentError, 'invalid value for "email", the character length must be great than or equal to 1.'
|
279
|
+
end
|
280
|
+
|
281
|
+
@email = email
|
282
|
+
end
|
283
|
+
|
284
|
+
# Checks equality by comparing each attribute.
|
285
|
+
# @param [Object] Object to be compared
|
286
|
+
def ==(o)
|
287
|
+
return true if self.equal?(o)
|
288
|
+
self.class == o.class &&
|
289
|
+
type == o.type &&
|
290
|
+
name == o.name &&
|
291
|
+
label == o.label &&
|
292
|
+
text == o.text &&
|
293
|
+
email == o.email &&
|
294
|
+
select == o.select &&
|
295
|
+
quoted_message_id == o.quoted_message_id
|
296
|
+
end
|
297
|
+
|
298
|
+
# @see the `==` method
|
299
|
+
# @param [Object] Object to be compared
|
300
|
+
def eql?(o)
|
301
|
+
self == o
|
302
|
+
end
|
303
|
+
|
304
|
+
# Calculates hash code according to all attributes.
|
305
|
+
# @return [Integer] Hash code
|
306
|
+
def hash
|
307
|
+
[type, name, label, text, email, select, quoted_message_id].hash
|
308
|
+
end
|
309
|
+
|
310
|
+
# Builds the object from hash
|
311
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
312
|
+
# @return [Object] Returns the model itself
|
313
|
+
def self.build_from_hash(attributes)
|
314
|
+
new.build_from_hash(attributes)
|
315
|
+
end
|
316
|
+
|
317
|
+
# Builds the object from hash
|
318
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
319
|
+
# @return [Object] Returns the model itself
|
320
|
+
def build_from_hash(attributes)
|
321
|
+
return nil unless attributes.is_a?(Hash)
|
322
|
+
self.class.openapi_types.each_pair do |key, type|
|
323
|
+
if type =~ /\AArray<(.*)>/i
|
324
|
+
# check to ensure the input is an array given that the attribute
|
325
|
+
# is documented as an array but the input is not
|
326
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
327
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
328
|
+
end
|
329
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
330
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
331
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
332
|
+
end
|
333
|
+
|
334
|
+
self
|
335
|
+
end
|
336
|
+
|
337
|
+
# Deserializes the data based on type
|
338
|
+
# @param string type Data type
|
339
|
+
# @param string value Value to be deserialized
|
340
|
+
# @return [Object] Deserialized data
|
341
|
+
def _deserialize(type, value)
|
342
|
+
case type.to_sym
|
343
|
+
when :DateTime
|
344
|
+
DateTime.parse(value)
|
345
|
+
when :Date
|
346
|
+
Date.parse(value)
|
347
|
+
when :String
|
348
|
+
value.to_s
|
349
|
+
when :Integer
|
350
|
+
value.to_i
|
351
|
+
when :Float
|
352
|
+
value.to_f
|
353
|
+
when :Boolean
|
354
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
355
|
+
true
|
356
|
+
else
|
357
|
+
false
|
358
|
+
end
|
359
|
+
when :Object
|
360
|
+
# generic object (usually a Hash), return directly
|
361
|
+
value
|
362
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
363
|
+
inner_type = Regexp.last_match[:inner_type]
|
364
|
+
value.map { |v| _deserialize(inner_type, v) }
|
365
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
366
|
+
k_type = Regexp.last_match[:k_type]
|
367
|
+
v_type = Regexp.last_match[:v_type]
|
368
|
+
{}.tap do |hash|
|
369
|
+
value.each do |k, v|
|
370
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
371
|
+
end
|
372
|
+
end
|
373
|
+
else # model
|
374
|
+
SunshineConversationsClient.const_get(type).build_from_hash(value)
|
375
|
+
end
|
376
|
+
end
|
377
|
+
|
378
|
+
# Returns the string representation of the object
|
379
|
+
# @return [String] String presentation of the object
|
380
|
+
def to_s
|
381
|
+
to_hash.to_s
|
382
|
+
end
|
383
|
+
|
384
|
+
# to_body is an alias to to_hash (backward compatibility)
|
385
|
+
# @return [Hash] Returns the object in the form of hash
|
386
|
+
def to_body
|
387
|
+
to_hash
|
388
|
+
end
|
389
|
+
|
390
|
+
# Returns the object in the form of hash
|
391
|
+
# @return [Hash] Returns the object in the form of hash
|
392
|
+
def to_hash
|
393
|
+
hash = {}
|
394
|
+
self.class.attribute_map.each_pair do |attr, param|
|
395
|
+
value = self.send(attr)
|
396
|
+
if value.nil?
|
397
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
398
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
399
|
+
end
|
400
|
+
|
401
|
+
hash[param] = _to_hash(value)
|
402
|
+
end
|
403
|
+
hash
|
404
|
+
end
|
405
|
+
|
406
|
+
# Outputs non-array value in the form of hash
|
407
|
+
# For object, use to_hash. Otherwise, just return the value
|
408
|
+
# @param [Object] value Any valid value
|
409
|
+
# @return [Hash] Returns the value in the form of hash
|
410
|
+
def _to_hash(value)
|
411
|
+
if value.is_a?(Array)
|
412
|
+
value.compact.map { |v| _to_hash(v) }
|
413
|
+
elsif value.is_a?(Hash)
|
414
|
+
{}.tap do |hash|
|
415
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
416
|
+
end
|
417
|
+
elsif value.respond_to? :to_hash
|
418
|
+
value.to_hash
|
419
|
+
else
|
420
|
+
value
|
421
|
+
end
|
422
|
+
end
|
423
|
+
end
|
424
|
+
end
|
@@ -0,0 +1,205 @@
|
|
1
|
+
=begin
|
2
|
+
#Sunshine Conversations API
|
3
|
+
|
4
|
+
The version of the OpenAPI document: 11.0.0
|
5
|
+
|
6
|
+
Generated by: https://openapi-generator.tech
|
7
|
+
OpenAPI Generator version: 4.3.1
|
8
|
+
=end
|
9
|
+
|
10
|
+
require 'date'
|
11
|
+
|
12
|
+
module SunshineConversationsClient
|
13
|
+
# Properties that can be expected to receive inside a form response message field.
|
14
|
+
class FormResponseMessageFieldAllOf
|
15
|
+
# The messageId for the form that this response belongs to.
|
16
|
+
attr_accessor :quoted_message_id
|
17
|
+
|
18
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
19
|
+
def self.attribute_map
|
20
|
+
{
|
21
|
+
:'quoted_message_id' => :'quotedMessageId'
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
# Attribute type mapping.
|
26
|
+
def self.openapi_types
|
27
|
+
{
|
28
|
+
:'quoted_message_id' => :'String'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# List of attributes with nullable: true
|
33
|
+
def self.openapi_nullable
|
34
|
+
Set.new([
|
35
|
+
])
|
36
|
+
end
|
37
|
+
|
38
|
+
# Initializes the object
|
39
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
40
|
+
def initialize(attributes = {})
|
41
|
+
if (!attributes.is_a?(Hash))
|
42
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SunshineConversationsClient::FormResponseMessageFieldAllOf` initialize method"
|
43
|
+
end
|
44
|
+
|
45
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
46
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
47
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
48
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SunshineConversationsClient::FormResponseMessageFieldAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
49
|
+
end
|
50
|
+
h[k.to_sym] = v
|
51
|
+
}
|
52
|
+
|
53
|
+
if attributes.key?(:'quoted_message_id')
|
54
|
+
self.quoted_message_id = attributes[:'quoted_message_id']
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
59
|
+
# @return Array for valid properties with the reasons
|
60
|
+
def list_invalid_properties
|
61
|
+
invalid_properties = Array.new
|
62
|
+
invalid_properties
|
63
|
+
end
|
64
|
+
|
65
|
+
# Check to see if the all the properties in the model are valid
|
66
|
+
# @return true if the model is valid
|
67
|
+
def valid?
|
68
|
+
true
|
69
|
+
end
|
70
|
+
|
71
|
+
# Checks equality by comparing each attribute.
|
72
|
+
# @param [Object] Object to be compared
|
73
|
+
def ==(o)
|
74
|
+
return true if self.equal?(o)
|
75
|
+
self.class == o.class &&
|
76
|
+
quoted_message_id == o.quoted_message_id
|
77
|
+
end
|
78
|
+
|
79
|
+
# @see the `==` method
|
80
|
+
# @param [Object] Object to be compared
|
81
|
+
def eql?(o)
|
82
|
+
self == o
|
83
|
+
end
|
84
|
+
|
85
|
+
# Calculates hash code according to all attributes.
|
86
|
+
# @return [Integer] Hash code
|
87
|
+
def hash
|
88
|
+
[quoted_message_id].hash
|
89
|
+
end
|
90
|
+
|
91
|
+
# Builds the object from hash
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
93
|
+
# @return [Object] Returns the model itself
|
94
|
+
def self.build_from_hash(attributes)
|
95
|
+
new.build_from_hash(attributes)
|
96
|
+
end
|
97
|
+
|
98
|
+
# Builds the object from hash
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
100
|
+
# @return [Object] Returns the model itself
|
101
|
+
def build_from_hash(attributes)
|
102
|
+
return nil unless attributes.is_a?(Hash)
|
103
|
+
self.class.openapi_types.each_pair do |key, type|
|
104
|
+
if type =~ /\AArray<(.*)>/i
|
105
|
+
# check to ensure the input is an array given that the attribute
|
106
|
+
# is documented as an array but the input is not
|
107
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
108
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
109
|
+
end
|
110
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
111
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
112
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
113
|
+
end
|
114
|
+
|
115
|
+
self
|
116
|
+
end
|
117
|
+
|
118
|
+
# Deserializes the data based on type
|
119
|
+
# @param string type Data type
|
120
|
+
# @param string value Value to be deserialized
|
121
|
+
# @return [Object] Deserialized data
|
122
|
+
def _deserialize(type, value)
|
123
|
+
case type.to_sym
|
124
|
+
when :DateTime
|
125
|
+
DateTime.parse(value)
|
126
|
+
when :Date
|
127
|
+
Date.parse(value)
|
128
|
+
when :String
|
129
|
+
value.to_s
|
130
|
+
when :Integer
|
131
|
+
value.to_i
|
132
|
+
when :Float
|
133
|
+
value.to_f
|
134
|
+
when :Boolean
|
135
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
136
|
+
true
|
137
|
+
else
|
138
|
+
false
|
139
|
+
end
|
140
|
+
when :Object
|
141
|
+
# generic object (usually a Hash), return directly
|
142
|
+
value
|
143
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
144
|
+
inner_type = Regexp.last_match[:inner_type]
|
145
|
+
value.map { |v| _deserialize(inner_type, v) }
|
146
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
147
|
+
k_type = Regexp.last_match[:k_type]
|
148
|
+
v_type = Regexp.last_match[:v_type]
|
149
|
+
{}.tap do |hash|
|
150
|
+
value.each do |k, v|
|
151
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
else # model
|
155
|
+
SunshineConversationsClient.const_get(type).build_from_hash(value)
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
# Returns the string representation of the object
|
160
|
+
# @return [String] String presentation of the object
|
161
|
+
def to_s
|
162
|
+
to_hash.to_s
|
163
|
+
end
|
164
|
+
|
165
|
+
# to_body is an alias to to_hash (backward compatibility)
|
166
|
+
# @return [Hash] Returns the object in the form of hash
|
167
|
+
def to_body
|
168
|
+
to_hash
|
169
|
+
end
|
170
|
+
|
171
|
+
# Returns the object in the form of hash
|
172
|
+
# @return [Hash] Returns the object in the form of hash
|
173
|
+
def to_hash
|
174
|
+
hash = {}
|
175
|
+
self.class.attribute_map.each_pair do |attr, param|
|
176
|
+
value = self.send(attr)
|
177
|
+
if value.nil?
|
178
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
179
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
180
|
+
end
|
181
|
+
|
182
|
+
hash[param] = _to_hash(value)
|
183
|
+
end
|
184
|
+
hash
|
185
|
+
end
|
186
|
+
|
187
|
+
# Outputs non-array value in the form of hash
|
188
|
+
# For object, use to_hash. Otherwise, just return the value
|
189
|
+
# @param [Object] value Any valid value
|
190
|
+
# @return [Hash] Returns the value in the form of hash
|
191
|
+
def _to_hash(value)
|
192
|
+
if value.is_a?(Array)
|
193
|
+
value.compact.map { |v| _to_hash(v) }
|
194
|
+
elsif value.is_a?(Hash)
|
195
|
+
{}.tap do |hash|
|
196
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
197
|
+
end
|
198
|
+
elsif value.respond_to? :to_hash
|
199
|
+
value.to_hash
|
200
|
+
else
|
201
|
+
value
|
202
|
+
end
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|