sunshine-conversations-client 9.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG_RB.md +12 -0
- data/Gemfile +9 -0
- data/LICENSE +176 -0
- data/README.md +456 -0
- data/Rakefile +10 -0
- data/docs/AcceptControlBody.md +17 -0
- data/docs/Action.md +41 -0
- data/docs/ActionSubset.md +39 -0
- data/docs/ActivitiesApi.md +71 -0
- data/docs/Activity.md +21 -0
- data/docs/ActivityAllOf.md +19 -0
- data/docs/ActivityPost.md +19 -0
- data/docs/ActivityPostAllOf.md +17 -0
- data/docs/ActivityTypes.md +17 -0
- data/docs/Android.md +23 -0
- data/docs/AndroidAllOf.md +23 -0
- data/docs/AndroidUpdate.md +23 -0
- data/docs/AndroidUpdateAllOf.md +21 -0
- data/docs/ApiKey.md +21 -0
- data/docs/App.md +23 -0
- data/docs/AppCreateBody.md +21 -0
- data/docs/AppKey.md +21 -0
- data/docs/AppKeyCreateBody.md +17 -0
- data/docs/AppKeyListResponse.md +17 -0
- data/docs/AppKeyResponse.md +17 -0
- data/docs/AppKeysApi.md +250 -0
- data/docs/AppListFilter.md +17 -0
- data/docs/AppListResponse.md +21 -0
- data/docs/AppResponse.md +17 -0
- data/docs/AppSettings.md +31 -0
- data/docs/AppSubSchema.md +17 -0
- data/docs/AppUpdateBody.md +21 -0
- data/docs/Apple.md +23 -0
- data/docs/AppleAllOf.md +23 -0
- data/docs/AppleUpdate.md +16 -0
- data/docs/AppsApi.md +309 -0
- data/docs/AttachmentDeleteBody.md +17 -0
- data/docs/AttachmentMediaTokenBody.md +17 -0
- data/docs/AttachmentMediaTokenResponse.md +17 -0
- data/docs/AttachmentResponse.md +17 -0
- data/docs/AttachmentSchema.md +19 -0
- data/docs/AttachmentUploadBody.md +17 -0
- data/docs/AttachmentsApi.md +254 -0
- data/docs/Author.md +25 -0
- data/docs/AuthorWebhook.md +21 -0
- data/docs/Buy.md +25 -0
- data/docs/CarouselMessage.md +23 -0
- data/docs/CarouselMessageDisplaySettings.md +17 -0
- data/docs/Client.md +37 -0
- data/docs/ClientAssociation.md +19 -0
- data/docs/ClientCreate.md +21 -0
- data/docs/ClientListResponse.md +21 -0
- data/docs/ClientResponse.md +17 -0
- data/docs/ClientType.md +16 -0
- data/docs/ClientsApi.md +199 -0
- data/docs/Confirmation.md +19 -0
- data/docs/Content.md +41 -0
- data/docs/Conversation.md +37 -0
- data/docs/ConversationAllOf.md +29 -0
- data/docs/ConversationCreateBody.md +27 -0
- data/docs/ConversationCreateEvent.md +23 -0
- data/docs/ConversationCreateEventAllOf.md +17 -0
- data/docs/ConversationCreateEventAllOfPayload.md +25 -0
- data/docs/ConversationListFilter.md +19 -0
- data/docs/ConversationListResponse.md +21 -0
- data/docs/ConversationMessageDeliveryChannelEvent.md +23 -0
- data/docs/ConversationMessageDeliveryChannelEventAllOf.md +17 -0
- data/docs/ConversationMessageDeliveryFailureEvent.md +23 -0
- data/docs/ConversationMessageDeliveryFailureEventAllOf.md +17 -0
- data/docs/ConversationMessageDeliveryPayload.md +27 -0
- data/docs/ConversationMessageDeliveryPayloadDestination.md +19 -0
- data/docs/ConversationMessageDeliveryPayloadExternalMessages.md +17 -0
- data/docs/ConversationMessageDeliveryPayloadMessage.md +17 -0
- data/docs/ConversationMessageDeliveryUserEvent.md +23 -0
- data/docs/ConversationMessageEvent.md +23 -0
- data/docs/ConversationMessageEventAllOf.md +17 -0
- data/docs/ConversationMessageEventAllOfPayload.md +21 -0
- data/docs/ConversationPostbackEvent.md +23 -0
- data/docs/ConversationPostbackEventAllOf.md +17 -0
- data/docs/ConversationPostbackEventAllOfPayload.md +23 -0
- data/docs/ConversationReadEvent.md +23 -0
- data/docs/ConversationReadEventAllOf.md +17 -0
- data/docs/ConversationReadEventAllOfPayload.md +19 -0
- data/docs/ConversationResponse.md +17 -0
- data/docs/ConversationTruncated.md +23 -0
- data/docs/ConversationType.md +16 -0
- data/docs/ConversationTypingEvent.md +23 -0
- data/docs/ConversationTypingEventAllOf.md +17 -0
- data/docs/ConversationTypingEventAllOfPayload.md +19 -0
- data/docs/ConversationUpdateBody.md +23 -0
- data/docs/ConversationsApi.md +319 -0
- data/docs/Custom.md +19 -0
- data/docs/CustomAllOf.md +19 -0
- data/docs/CustomIntegrationApiKeysApi.md +258 -0
- data/docs/CustomUpdate.md +16 -0
- data/docs/Destination.md +19 -0
- data/docs/Device.md +35 -0
- data/docs/EventSubSchema.md +21 -0
- data/docs/ExtraChannelOptions.md +17 -0
- data/docs/ExtraChannelOptionsMessenger.md +19 -0
- data/docs/Field.md +35 -0
- data/docs/FileMessage.md +25 -0
- data/docs/FormMessage.md +21 -0
- data/docs/FormResponseMessage.md +21 -0
- data/docs/ImageMessage.md +23 -0
- data/docs/InlineObject.md +23 -0
- data/docs/Integration.md +23 -0
- data/docs/IntegrationApiKey.md +17 -0
- data/docs/IntegrationApiKeyListResponse.md +17 -0
- data/docs/IntegrationApiKeyResponse.md +17 -0
- data/docs/IntegrationId.md +17 -0
- data/docs/IntegrationListFilter.md +17 -0
- data/docs/IntegrationListResponse.md +21 -0
- data/docs/IntegrationResponse.md +17 -0
- data/docs/IntegrationType.md +17 -0
- data/docs/IntegrationUpdate.md +71 -0
- data/docs/IntegrationUpdateBase.md +17 -0
- data/docs/IntegrationsApi.md +319 -0
- data/docs/Ios.md +27 -0
- data/docs/IosAllOf.md +27 -0
- data/docs/IosUpdate.md +27 -0
- data/docs/IosUpdateAllOf.md +25 -0
- data/docs/Item.md +29 -0
- data/docs/Line.md +31 -0
- data/docs/LineAllOf.md +31 -0
- data/docs/LineUpdate.md +16 -0
- data/docs/Link.md +27 -0
- data/docs/Links.md +19 -0
- data/docs/ListMessage.md +21 -0
- data/docs/LocationMessage.md +23 -0
- data/docs/LocationMessageCoordinates.md +19 -0
- data/docs/LocationMessageLocation.md +19 -0
- data/docs/LocationRequest.md +21 -0
- data/docs/Mailgun.md +27 -0
- data/docs/MailgunAllOf.md +27 -0
- data/docs/MailgunUpdate.md +21 -0
- data/docs/MailgunUpdateAllOf.md +19 -0
- data/docs/MatchCriteria.md +27 -0
- data/docs/MatchCriteriaBase.md +21 -0
- data/docs/MatchCriteriaMailgun.md +25 -0
- data/docs/MatchCriteriaMailgunAllOf.md +21 -0
- data/docs/MatchCriteriaMessagebird.md +23 -0
- data/docs/MatchCriteriaMessagebirdAllOf.md +19 -0
- data/docs/MatchCriteriaTwilio.md +23 -0
- data/docs/MatchCriteriaTwilioAllOf.md +19 -0
- data/docs/MatchCriteriaWhatsapp.md +23 -0
- data/docs/MatchCriteriaWhatsappAllOf.md +19 -0
- data/docs/Message.md +31 -0
- data/docs/MessageBirdUpdate.md +16 -0
- data/docs/MessageListResponse.md +21 -0
- data/docs/MessageOverride.md +23 -0
- data/docs/MessageOverrideApple.md +17 -0
- data/docs/MessageOverrideLine.md +17 -0
- data/docs/MessageOverrideMessenger.md +17 -0
- data/docs/MessageOverridePayload.md +17 -0
- data/docs/MessageOverrideWhatsapp.md +17 -0
- data/docs/MessagePost.md +27 -0
- data/docs/MessagePostResponse.md +17 -0
- data/docs/MessageWebhook.md +31 -0
- data/docs/Messagebird.md +25 -0
- data/docs/MessagebirdAllOf.md +25 -0
- data/docs/MessagesApi.md +260 -0
- data/docs/Messenger.md +23 -0
- data/docs/MessengerAllOf.md +23 -0
- data/docs/MessengerUpdate.md +19 -0
- data/docs/MessengerUpdateAllOf.md +17 -0
- data/docs/Meta.md +21 -0
- data/docs/OAuthEndpointsApi.md +168 -0
- data/docs/OfferControlBody.md +19 -0
- data/docs/Page.md +21 -0
- data/docs/Participant.md +27 -0
- data/docs/ParticipantJoinBody.md +16 -0
- data/docs/ParticipantLeaveBody.md +21 -0
- data/docs/ParticipantLeaveBodyParticipantId.md +17 -0
- data/docs/ParticipantLeaveBodyUserExternalId.md +17 -0
- data/docs/ParticipantLeaveBodyUserId.md +17 -0
- data/docs/ParticipantListResponse.md +21 -0
- data/docs/ParticipantResponse.md +17 -0
- data/docs/ParticipantSubSchema.md +21 -0
- data/docs/ParticipantWithUserExternalId.md +19 -0
- data/docs/ParticipantWithUserId.md +19 -0
- data/docs/ParticipantsApi.md +199 -0
- data/docs/PassControlBody.md +19 -0
- data/docs/Postback.md +23 -0
- data/docs/PostbackWebhook.md +19 -0
- data/docs/PrechatCapture.md +23 -0
- data/docs/Profile.md +23 -0
- data/docs/QuotedMessage.md +21 -0
- data/docs/QuotedMessageExternalMessageId.md +19 -0
- data/docs/QuotedMessageMessage.md +19 -0
- data/docs/Referral.md +19 -0
- data/docs/ReferralDetails.md +21 -0
- data/docs/Reply.md +25 -0
- data/docs/Source.md +27 -0
- data/docs/SourceWebhook.md +27 -0
- data/docs/Status.md +16 -0
- data/docs/Switchboard.md +21 -0
- data/docs/SwitchboardAcceptControl.md +23 -0
- data/docs/SwitchboardAcceptControlAllOf.md +17 -0
- data/docs/SwitchboardAcceptControlAllOfPayload.md +19 -0
- data/docs/SwitchboardAcceptControlFailure.md +23 -0
- data/docs/SwitchboardAcceptControlFailureAllOf.md +17 -0
- data/docs/SwitchboardAcceptControlFailureAllOfPayload.md +21 -0
- data/docs/SwitchboardActionsApi.md +197 -0
- data/docs/SwitchboardIntegration.md +29 -0
- data/docs/SwitchboardIntegrationCreateBody.md +27 -0
- data/docs/SwitchboardIntegrationListResponse.md +17 -0
- data/docs/SwitchboardIntegrationResponse.md +17 -0
- data/docs/SwitchboardIntegrationUpdateBody.md +27 -0
- data/docs/SwitchboardIntegrationWebhook.md +23 -0
- data/docs/SwitchboardIntegrationsApi.md +260 -0
- data/docs/SwitchboardListResponse.md +17 -0
- data/docs/SwitchboardOfferControl.md +23 -0
- data/docs/SwitchboardOfferControlAllOf.md +17 -0
- data/docs/SwitchboardOfferControlAllOfPayload.md +19 -0
- data/docs/SwitchboardOfferControlFailure.md +23 -0
- data/docs/SwitchboardPassControl.md +23 -0
- data/docs/SwitchboardPassControlAllOf.md +17 -0
- data/docs/SwitchboardPassControlAllOfPayload.md +19 -0
- data/docs/SwitchboardPassControlFailure.md +23 -0
- data/docs/SwitchboardResponse.md +17 -0
- data/docs/SwitchboardUpdateBody.md +19 -0
- data/docs/SwitchboardsApi.md +250 -0
- data/docs/Target.md +17 -0
- data/docs/Telegram.md +23 -0
- data/docs/TelegramAllOf.md +23 -0
- data/docs/TelegramUpdate.md +16 -0
- data/docs/TextMessage.md +21 -0
- data/docs/Twilio.md +23 -0
- data/docs/TwilioAllOf.md +23 -0
- data/docs/TwilioUpdate.md +16 -0
- data/docs/Twitter.md +29 -0
- data/docs/TwitterAllOf.md +29 -0
- data/docs/TwitterUpdate.md +16 -0
- data/docs/User.md +25 -0
- data/docs/UserAllOf.md +21 -0
- data/docs/UserCreateBody.md +23 -0
- data/docs/UserMergeEvent.md +23 -0
- data/docs/UserMergeEventAllOf.md +17 -0
- data/docs/UserMergeEventAllOfPayload.md +21 -0
- data/docs/UserMergeEventAllOfPayloadMergedConversations.md +19 -0
- data/docs/UserMergeEventAllOfPayloadMergedUsers.md +19 -0
- data/docs/UserResponse.md +17 -0
- data/docs/UserTruncated.md +19 -0
- data/docs/UserUpdateBody.md +21 -0
- data/docs/UsersApi.md +315 -0
- data/docs/Viber.md +23 -0
- data/docs/ViberAllOf.md +23 -0
- data/docs/ViberUpdate.md +16 -0
- data/docs/Web.md +47 -0
- data/docs/WebAllOf.md +47 -0
- data/docs/WebUpdate.md +47 -0
- data/docs/WebUpdateAllOf.md +45 -0
- data/docs/Webhook.md +29 -0
- data/docs/WebhookBody.md +23 -0
- data/docs/WebhookCreateBody.md +16 -0
- data/docs/WebhookListResponse.md +17 -0
- data/docs/WebhookResponse.md +17 -0
- data/docs/WebhookSubSchema.md +19 -0
- data/docs/WebhooksApi.md +323 -0
- data/docs/Webview.md +33 -0
- data/docs/WhatsAppUpdate.md +23 -0
- data/docs/WhatsAppUpdateAllOf.md +21 -0
- data/docs/Whatsapp.md +25 -0
- data/docs/WhatsappAllOf.md +25 -0
- data/lib/sunshine-conversations-client.rb +306 -0
- data/lib/sunshine-conversations-client/api/activities_api.rb +95 -0
- data/lib/sunshine-conversations-client/api/app_keys_api.rb +287 -0
- data/lib/sunshine-conversations-client/api/apps_api.rb +339 -0
- data/lib/sunshine-conversations-client/api/attachments_api.rb +305 -0
- data/lib/sunshine-conversations-client/api/clients_api.rb +240 -0
- data/lib/sunshine-conversations-client/api/conversations_api.rb +373 -0
- data/lib/sunshine-conversations-client/api/custom_integration_api_keys_api.rb +311 -0
- data/lib/sunshine-conversations-client/api/integrations_api.rb +369 -0
- data/lib/sunshine-conversations-client/api/messages_api.rb +308 -0
- data/lib/sunshine-conversations-client/api/o_auth_endpoints_api.rb +213 -0
- data/lib/sunshine-conversations-client/api/participants_api.rb +242 -0
- data/lib/sunshine-conversations-client/api/switchboard_actions_api.rb +247 -0
- data/lib/sunshine-conversations-client/api/switchboard_integrations_api.rb +319 -0
- data/lib/sunshine-conversations-client/api/switchboards_api.rb +287 -0
- data/lib/sunshine-conversations-client/api/users_api.rb +369 -0
- data/lib/sunshine-conversations-client/api/webhooks_api.rb +393 -0
- data/lib/sunshine-conversations-client/api_client.rb +348 -0
- data/lib/sunshine-conversations-client/api_error.rb +54 -0
- data/lib/sunshine-conversations-client/configuration.rb +284 -0
- data/lib/sunshine-conversations-client/models/accept_control_body.rb +204 -0
- data/lib/sunshine-conversations-client/models/action.rb +421 -0
- data/lib/sunshine-conversations-client/models/action_subset.rb +409 -0
- data/lib/sunshine-conversations-client/models/activity.rb +265 -0
- data/lib/sunshine-conversations-client/models/activity_all_of.rb +213 -0
- data/lib/sunshine-conversations-client/models/activity_post.rb +266 -0
- data/lib/sunshine-conversations-client/models/activity_post_all_of.rb +204 -0
- data/lib/sunshine-conversations-client/models/activity_types.rb +238 -0
- data/lib/sunshine-conversations-client/models/android.rb +280 -0
- data/lib/sunshine-conversations-client/models/android_all_of.rb +268 -0
- data/lib/sunshine-conversations-client/models/android_update.rb +299 -0
- data/lib/sunshine-conversations-client/models/android_update_all_of.rb +256 -0
- data/lib/sunshine-conversations-client/models/api_key.rb +225 -0
- data/lib/sunshine-conversations-client/models/app.rb +234 -0
- data/lib/sunshine-conversations-client/models/app_create_body.rb +229 -0
- data/lib/sunshine-conversations-client/models/app_key.rb +224 -0
- data/lib/sunshine-conversations-client/models/app_key_create_body.rb +209 -0
- data/lib/sunshine-conversations-client/models/app_key_list_response.rb +203 -0
- data/lib/sunshine-conversations-client/models/app_key_response.rb +204 -0
- data/lib/sunshine-conversations-client/models/app_list_filter.rb +204 -0
- data/lib/sunshine-conversations-client/models/app_list_response.rb +221 -0
- data/lib/sunshine-conversations-client/models/app_response.rb +204 -0
- data/lib/sunshine-conversations-client/models/app_settings.rb +290 -0
- data/lib/sunshine-conversations-client/models/app_sub_schema.rb +205 -0
- data/lib/sunshine-conversations-client/models/app_update_body.rb +224 -0
- data/lib/sunshine-conversations-client/models/apple.rb +263 -0
- data/lib/sunshine-conversations-client/models/apple_all_of.rb +252 -0
- data/lib/sunshine-conversations-client/models/apple_update.rb +205 -0
- data/lib/sunshine-conversations-client/models/attachment_delete_body.rb +209 -0
- data/lib/sunshine-conversations-client/models/attachment_media_token_body.rb +208 -0
- data/lib/sunshine-conversations-client/models/attachment_media_token_response.rb +203 -0
- data/lib/sunshine-conversations-client/models/attachment_response.rb +204 -0
- data/lib/sunshine-conversations-client/models/attachment_schema.rb +214 -0
- data/lib/sunshine-conversations-client/models/attachment_upload_body.rb +208 -0
- data/lib/sunshine-conversations-client/models/author.rb +284 -0
- data/lib/sunshine-conversations-client/models/author_webhook.rb +264 -0
- data/lib/sunshine-conversations-client/models/buy.rb +262 -0
- data/lib/sunshine-conversations-client/models/carousel_message.rb +245 -0
- data/lib/sunshine-conversations-client/models/carousel_message_display_settings.rb +239 -0
- data/lib/sunshine-conversations-client/models/client.rb +345 -0
- data/lib/sunshine-conversations-client/models/client_association.rb +213 -0
- data/lib/sunshine-conversations-client/models/client_create.rb +236 -0
- data/lib/sunshine-conversations-client/models/client_list_response.rb +221 -0
- data/lib/sunshine-conversations-client/models/client_response.rb +203 -0
- data/lib/sunshine-conversations-client/models/client_type.rb +42 -0
- data/lib/sunshine-conversations-client/models/confirmation.rb +254 -0
- data/lib/sunshine-conversations-client/models/content.rb +380 -0
- data/lib/sunshine-conversations-client/models/conversation.rb +366 -0
- data/lib/sunshine-conversations-client/models/conversation_all_of.rb +317 -0
- data/lib/sunshine-conversations-client/models/conversation_create_body.rb +308 -0
- data/lib/sunshine-conversations-client/models/conversation_create_event.rb +241 -0
- data/lib/sunshine-conversations-client/models/conversation_create_event_all_of.rb +203 -0
- data/lib/sunshine-conversations-client/models/conversation_create_event_all_of_payload.rb +281 -0
- data/lib/sunshine-conversations-client/models/conversation_list_filter.rb +214 -0
- data/lib/sunshine-conversations-client/models/conversation_list_response.rb +221 -0
- data/lib/sunshine-conversations-client/models/conversation_message_delivery_channel_event.rb +241 -0
- data/lib/sunshine-conversations-client/models/conversation_message_delivery_channel_event_all_of.rb +203 -0
- data/lib/sunshine-conversations-client/models/conversation_message_delivery_failure_event.rb +241 -0
- data/lib/sunshine-conversations-client/models/conversation_message_delivery_failure_event_all_of.rb +203 -0
- data/lib/sunshine-conversations-client/models/conversation_message_delivery_payload.rb +253 -0
- data/lib/sunshine-conversations-client/models/conversation_message_delivery_payload_destination.rb +215 -0
- data/lib/sunshine-conversations-client/models/conversation_message_delivery_payload_external_messages.rb +204 -0
- data/lib/sunshine-conversations-client/models/conversation_message_delivery_payload_message.rb +205 -0
- data/lib/sunshine-conversations-client/models/conversation_message_delivery_user_event.rb +241 -0
- data/lib/sunshine-conversations-client/models/conversation_message_event.rb +241 -0
- data/lib/sunshine-conversations-client/models/conversation_message_event_all_of.rb +203 -0
- data/lib/sunshine-conversations-client/models/conversation_message_event_all_of_payload.rb +224 -0
- data/lib/sunshine-conversations-client/models/conversation_postback_event.rb +241 -0
- data/lib/sunshine-conversations-client/models/conversation_postback_event_all_of.rb +203 -0
- data/lib/sunshine-conversations-client/models/conversation_postback_event_all_of_payload.rb +235 -0
- data/lib/sunshine-conversations-client/models/conversation_read_event.rb +241 -0
- data/lib/sunshine-conversations-client/models/conversation_read_event_all_of.rb +203 -0
- data/lib/sunshine-conversations-client/models/conversation_read_event_all_of_payload.rb +215 -0
- data/lib/sunshine-conversations-client/models/conversation_response.rb +204 -0
- data/lib/sunshine-conversations-client/models/conversation_truncated.rb +235 -0
- data/lib/sunshine-conversations-client/models/conversation_type.rb +33 -0
- data/lib/sunshine-conversations-client/models/conversation_typing_event.rb +241 -0
- data/lib/sunshine-conversations-client/models/conversation_typing_event_all_of.rb +203 -0
- data/lib/sunshine-conversations-client/models/conversation_typing_event_all_of_payload.rb +215 -0
- data/lib/sunshine-conversations-client/models/conversation_update_body.rb +285 -0
- data/lib/sunshine-conversations-client/models/custom.rb +232 -0
- data/lib/sunshine-conversations-client/models/custom_all_of.rb +220 -0
- data/lib/sunshine-conversations-client/models/custom_update.rb +205 -0
- data/lib/sunshine-conversations-client/models/destination.rb +239 -0
- data/lib/sunshine-conversations-client/models/device.rb +343 -0
- data/lib/sunshine-conversations-client/models/event_sub_schema.rb +224 -0
- data/lib/sunshine-conversations-client/models/extra_channel_options.rb +204 -0
- data/lib/sunshine-conversations-client/models/extra_channel_options_messenger.rb +251 -0
- data/lib/sunshine-conversations-client/models/field.rb +522 -0
- data/lib/sunshine-conversations-client/models/file_message.rb +256 -0
- data/lib/sunshine-conversations-client/models/form_message.rb +236 -0
- data/lib/sunshine-conversations-client/models/form_response_message.rb +236 -0
- data/lib/sunshine-conversations-client/models/image_message.rb +245 -0
- data/lib/sunshine-conversations-client/models/inline_object.rb +254 -0
- data/lib/sunshine-conversations-client/models/integration.rb +260 -0
- data/lib/sunshine-conversations-client/models/integration_api_key.rb +209 -0
- data/lib/sunshine-conversations-client/models/integration_api_key_list_response.rb +203 -0
- data/lib/sunshine-conversations-client/models/integration_api_key_response.rb +203 -0
- data/lib/sunshine-conversations-client/models/integration_id.rb +204 -0
- data/lib/sunshine-conversations-client/models/integration_list_filter.rb +204 -0
- data/lib/sunshine-conversations-client/models/integration_list_response.rb +221 -0
- data/lib/sunshine-conversations-client/models/integration_response.rb +203 -0
- data/lib/sunshine-conversations-client/models/integration_type.rb +204 -0
- data/lib/sunshine-conversations-client/models/integration_update.rb +619 -0
- data/lib/sunshine-conversations-client/models/integration_update_base.rb +229 -0
- data/lib/sunshine-conversations-client/models/ios.rb +284 -0
- data/lib/sunshine-conversations-client/models/ios_all_of.rb +272 -0
- data/lib/sunshine-conversations-client/models/ios_update.rb +303 -0
- data/lib/sunshine-conversations-client/models/ios_update_all_of.rb +260 -0
- data/lib/sunshine-conversations-client/models/item.rb +381 -0
- data/lib/sunshine-conversations-client/models/line.rb +313 -0
- data/lib/sunshine-conversations-client/models/line_all_of.rb +302 -0
- data/lib/sunshine-conversations-client/models/line_update.rb +205 -0
- data/lib/sunshine-conversations-client/models/link.rb +272 -0
- data/lib/sunshine-conversations-client/models/links.rb +215 -0
- data/lib/sunshine-conversations-client/models/list_message.rb +235 -0
- data/lib/sunshine-conversations-client/models/location_message.rb +245 -0
- data/lib/sunshine-conversations-client/models/location_message_coordinates.rb +225 -0
- data/lib/sunshine-conversations-client/models/location_message_location.rb +215 -0
- data/lib/sunshine-conversations-client/models/location_request.rb +238 -0
- data/lib/sunshine-conversations-client/models/mailgun.rb +356 -0
- data/lib/sunshine-conversations-client/models/mailgun_all_of.rb +345 -0
- data/lib/sunshine-conversations-client/models/mailgun_update.rb +273 -0
- data/lib/sunshine-conversations-client/models/mailgun_update_all_of.rb +230 -0
- data/lib/sunshine-conversations-client/models/match_criteria.rb +312 -0
- data/lib/sunshine-conversations-client/models/match_criteria_base.rb +237 -0
- data/lib/sunshine-conversations-client/models/match_criteria_mailgun.rb +273 -0
- data/lib/sunshine-conversations-client/models/match_criteria_mailgun_all_of.rb +234 -0
- data/lib/sunshine-conversations-client/models/match_criteria_messagebird.rb +261 -0
- data/lib/sunshine-conversations-client/models/match_criteria_messagebird_all_of.rb +222 -0
- data/lib/sunshine-conversations-client/models/match_criteria_twilio.rb +261 -0
- data/lib/sunshine-conversations-client/models/match_criteria_twilio_all_of.rb +222 -0
- data/lib/sunshine-conversations-client/models/match_criteria_whatsapp.rb +261 -0
- data/lib/sunshine-conversations-client/models/match_criteria_whatsapp_all_of.rb +222 -0
- data/lib/sunshine-conversations-client/models/message.rb +274 -0
- data/lib/sunshine-conversations-client/models/message_bird_update.rb +205 -0
- data/lib/sunshine-conversations-client/models/message_list_response.rb +221 -0
- data/lib/sunshine-conversations-client/models/message_override.rb +253 -0
- data/lib/sunshine-conversations-client/models/message_override_apple.rb +203 -0
- data/lib/sunshine-conversations-client/models/message_override_line.rb +203 -0
- data/lib/sunshine-conversations-client/models/message_override_messenger.rb +203 -0
- data/lib/sunshine-conversations-client/models/message_override_payload.rb +204 -0
- data/lib/sunshine-conversations-client/models/message_override_whatsapp.rb +203 -0
- data/lib/sunshine-conversations-client/models/message_post.rb +263 -0
- data/lib/sunshine-conversations-client/models/message_post_response.rb +203 -0
- data/lib/sunshine-conversations-client/models/message_webhook.rb +274 -0
- data/lib/sunshine-conversations-client/models/messagebird.rb +330 -0
- data/lib/sunshine-conversations-client/models/messagebird_all_of.rb +319 -0
- data/lib/sunshine-conversations-client/models/messenger.rb +263 -0
- data/lib/sunshine-conversations-client/models/messenger_all_of.rb +252 -0
- data/lib/sunshine-conversations-client/models/messenger_update.rb +247 -0
- data/lib/sunshine-conversations-client/models/messenger_update_all_of.rb +204 -0
- data/lib/sunshine-conversations-client/models/meta.rb +225 -0
- data/lib/sunshine-conversations-client/models/offer_control_body.rb +219 -0
- data/lib/sunshine-conversations-client/models/page.rb +250 -0
- data/lib/sunshine-conversations-client/models/participant.rb +255 -0
- data/lib/sunshine-conversations-client/models/participant_join_body.rb +205 -0
- data/lib/sunshine-conversations-client/models/participant_leave_body.rb +249 -0
- data/lib/sunshine-conversations-client/models/participant_leave_body_participant_id.rb +204 -0
- data/lib/sunshine-conversations-client/models/participant_leave_body_user_external_id.rb +204 -0
- data/lib/sunshine-conversations-client/models/participant_leave_body_user_id.rb +204 -0
- data/lib/sunshine-conversations-client/models/participant_list_response.rb +221 -0
- data/lib/sunshine-conversations-client/models/participant_response.rb +204 -0
- data/lib/sunshine-conversations-client/models/participant_sub_schema.rb +244 -0
- data/lib/sunshine-conversations-client/models/participant_with_user_external_id.rb +214 -0
- data/lib/sunshine-conversations-client/models/participant_with_user_id.rb +214 -0
- data/lib/sunshine-conversations-client/models/pass_control_body.rb +219 -0
- data/lib/sunshine-conversations-client/models/postback.rb +252 -0
- data/lib/sunshine-conversations-client/models/postback_webhook.rb +215 -0
- data/lib/sunshine-conversations-client/models/prechat_capture.rb +239 -0
- data/lib/sunshine-conversations-client/models/profile.rb +335 -0
- data/lib/sunshine-conversations-client/models/quoted_message.rb +249 -0
- data/lib/sunshine-conversations-client/models/quoted_message_external_message_id.rb +216 -0
- data/lib/sunshine-conversations-client/models/quoted_message_message.rb +215 -0
- data/lib/sunshine-conversations-client/models/referral.rb +214 -0
- data/lib/sunshine-conversations-client/models/referral_details.rb +226 -0
- data/lib/sunshine-conversations-client/models/reply.rb +260 -0
- data/lib/sunshine-conversations-client/models/source.rb +265 -0
- data/lib/sunshine-conversations-client/models/source_webhook.rb +258 -0
- data/lib/sunshine-conversations-client/models/status.rb +34 -0
- data/lib/sunshine-conversations-client/models/switchboard.rb +234 -0
- data/lib/sunshine-conversations-client/models/switchboard_accept_control.rb +241 -0
- data/lib/sunshine-conversations-client/models/switchboard_accept_control_all_of.rb +203 -0
- data/lib/sunshine-conversations-client/models/switchboard_accept_control_all_of_payload.rb +216 -0
- data/lib/sunshine-conversations-client/models/switchboard_accept_control_failure.rb +241 -0
- data/lib/sunshine-conversations-client/models/switchboard_accept_control_failure_all_of.rb +203 -0
- data/lib/sunshine-conversations-client/models/switchboard_accept_control_failure_all_of_payload.rb +226 -0
- data/lib/sunshine-conversations-client/models/switchboard_integration.rb +333 -0
- data/lib/sunshine-conversations-client/models/switchboard_integration_create_body.rb +302 -0
- data/lib/sunshine-conversations-client/models/switchboard_integration_list_response.rb +203 -0
- data/lib/sunshine-conversations-client/models/switchboard_integration_response.rb +204 -0
- data/lib/sunshine-conversations-client/models/switchboard_integration_update_body.rb +294 -0
- data/lib/sunshine-conversations-client/models/switchboard_integration_webhook.rb +249 -0
- data/lib/sunshine-conversations-client/models/switchboard_list_response.rb +203 -0
- data/lib/sunshine-conversations-client/models/switchboard_offer_control.rb +241 -0
- data/lib/sunshine-conversations-client/models/switchboard_offer_control_all_of.rb +203 -0
- data/lib/sunshine-conversations-client/models/switchboard_offer_control_all_of_payload.rb +216 -0
- data/lib/sunshine-conversations-client/models/switchboard_offer_control_failure.rb +241 -0
- data/lib/sunshine-conversations-client/models/switchboard_pass_control.rb +241 -0
- data/lib/sunshine-conversations-client/models/switchboard_pass_control_all_of.rb +203 -0
- data/lib/sunshine-conversations-client/models/switchboard_pass_control_all_of_payload.rb +216 -0
- data/lib/sunshine-conversations-client/models/switchboard_pass_control_failure.rb +241 -0
- data/lib/sunshine-conversations-client/models/switchboard_response.rb +204 -0
- data/lib/sunshine-conversations-client/models/switchboard_update_body.rb +214 -0
- data/lib/sunshine-conversations-client/models/target.rb +210 -0
- data/lib/sunshine-conversations-client/models/telegram.rb +272 -0
- data/lib/sunshine-conversations-client/models/telegram_all_of.rb +261 -0
- data/lib/sunshine-conversations-client/models/telegram_update.rb +205 -0
- data/lib/sunshine-conversations-client/models/text_message.rb +245 -0
- data/lib/sunshine-conversations-client/models/twilio.rb +301 -0
- data/lib/sunshine-conversations-client/models/twilio_all_of.rb +290 -0
- data/lib/sunshine-conversations-client/models/twilio_update.rb +205 -0
- data/lib/sunshine-conversations-client/models/twitter.rb +419 -0
- data/lib/sunshine-conversations-client/models/twitter_all_of.rb +408 -0
- data/lib/sunshine-conversations-client/models/twitter_update.rb +205 -0
- data/lib/sunshine-conversations-client/models/user.rb +250 -0
- data/lib/sunshine-conversations-client/models/user_all_of.rb +221 -0
- data/lib/sunshine-conversations-client/models/user_create_body.rb +267 -0
- data/lib/sunshine-conversations-client/models/user_merge_event.rb +241 -0
- data/lib/sunshine-conversations-client/models/user_merge_event_all_of.rb +203 -0
- data/lib/sunshine-conversations-client/models/user_merge_event_all_of_payload.rb +225 -0
- data/lib/sunshine-conversations-client/models/user_merge_event_all_of_payload_merged_conversations.rb +215 -0
- data/lib/sunshine-conversations-client/models/user_merge_event_all_of_payload_merged_users.rb +215 -0
- data/lib/sunshine-conversations-client/models/user_response.rb +204 -0
- data/lib/sunshine-conversations-client/models/user_truncated.rb +215 -0
- data/lib/sunshine-conversations-client/models/user_update_body.rb +223 -0
- data/lib/sunshine-conversations-client/models/viber.rb +272 -0
- data/lib/sunshine-conversations-client/models/viber_all_of.rb +261 -0
- data/lib/sunshine-conversations-client/models/viber_update.rb +205 -0
- data/lib/sunshine-conversations-client/models/web.rb +383 -0
- data/lib/sunshine-conversations-client/models/web_all_of.rb +372 -0
- data/lib/sunshine-conversations-client/models/web_update.rb +402 -0
- data/lib/sunshine-conversations-client/models/web_update_all_of.rb +360 -0
- data/lib/sunshine-conversations-client/models/webhook.rb +277 -0
- data/lib/sunshine-conversations-client/models/webhook_body.rb +237 -0
- data/lib/sunshine-conversations-client/models/webhook_create_body.rb +205 -0
- data/lib/sunshine-conversations-client/models/webhook_list_response.rb +203 -0
- data/lib/sunshine-conversations-client/models/webhook_response.rb +204 -0
- data/lib/sunshine-conversations-client/models/webhook_sub_schema.rb +215 -0
- data/lib/sunshine-conversations-client/models/webview.rb +339 -0
- data/lib/sunshine-conversations-client/models/whats_app_update.rb +272 -0
- data/lib/sunshine-conversations-client/models/whats_app_update_all_of.rb +229 -0
- data/lib/sunshine-conversations-client/models/whatsapp.rb +268 -0
- data/lib/sunshine-conversations-client/models/whatsapp_all_of.rb +257 -0
- data/lib/sunshine-conversations-client/version.rb +12 -0
- data/spec/api_client_spec.rb +223 -0
- data/spec/configuration_spec.rb +39 -0
- data/spec/spec_helper.rb +108 -0
- data/sunshine-conversations-client.gemspec +36 -0
- metadata +641 -0
@@ -0,0 +1,419 @@
|
|
1
|
+
=begin
|
2
|
+
#Sunshine Conversations API
|
3
|
+
|
4
|
+
The version of the OpenAPI document: 9.1.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 Twitter < Integration
|
14
|
+
# The type of integration.
|
15
|
+
attr_accessor :type
|
16
|
+
|
17
|
+
# Your Twitter app’s tier, sandbox, premium or enterprise.
|
18
|
+
attr_accessor :tier
|
19
|
+
|
20
|
+
# The Twitter dev environments label (required for sandbox and premium tiers).
|
21
|
+
attr_accessor :env_name
|
22
|
+
|
23
|
+
# The consumer key for your Twitter app.
|
24
|
+
attr_accessor :consumer_key
|
25
|
+
|
26
|
+
# The consumer key secret for your Twitter app.
|
27
|
+
attr_accessor :consumer_secret
|
28
|
+
|
29
|
+
# The access token key obtained from your user via oauth.
|
30
|
+
attr_accessor :access_token_key
|
31
|
+
|
32
|
+
# The access token secret obtained from your user via oauth.
|
33
|
+
attr_accessor :access_token_secret
|
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
|
+
:'tier' => :'tier',
|
62
|
+
:'env_name' => :'envName',
|
63
|
+
:'consumer_key' => :'consumerKey',
|
64
|
+
:'consumer_secret' => :'consumerSecret',
|
65
|
+
:'access_token_key' => :'accessTokenKey',
|
66
|
+
:'access_token_secret' => :'accessTokenSecret'
|
67
|
+
}
|
68
|
+
end
|
69
|
+
|
70
|
+
# Attribute type mapping.
|
71
|
+
def self.openapi_types
|
72
|
+
{
|
73
|
+
:'type' => :'String',
|
74
|
+
:'tier' => :'String',
|
75
|
+
:'env_name' => :'String',
|
76
|
+
:'consumer_key' => :'String',
|
77
|
+
:'consumer_secret' => :'String',
|
78
|
+
:'access_token_key' => :'String',
|
79
|
+
:'access_token_secret' => :'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
|
+
:'Integration',
|
93
|
+
:'TwitterAllOf'
|
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::Twitter` 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::Twitter`. 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
|
+
# call parent's initialize
|
113
|
+
super(attributes)
|
114
|
+
|
115
|
+
if attributes.key?(:'type')
|
116
|
+
self.type = attributes[:'type']
|
117
|
+
else
|
118
|
+
self.type = 'twitter'
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.key?(:'tier')
|
122
|
+
self.tier = attributes[:'tier']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.key?(:'env_name')
|
126
|
+
self.env_name = attributes[:'env_name']
|
127
|
+
end
|
128
|
+
|
129
|
+
if attributes.key?(:'consumer_key')
|
130
|
+
self.consumer_key = attributes[:'consumer_key']
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.key?(:'consumer_secret')
|
134
|
+
self.consumer_secret = attributes[:'consumer_secret']
|
135
|
+
end
|
136
|
+
|
137
|
+
if attributes.key?(:'access_token_key')
|
138
|
+
self.access_token_key = attributes[:'access_token_key']
|
139
|
+
end
|
140
|
+
|
141
|
+
if attributes.key?(:'access_token_secret')
|
142
|
+
self.access_token_secret = attributes[:'access_token_secret']
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
147
|
+
# @return Array for valid properties with the reasons
|
148
|
+
def list_invalid_properties
|
149
|
+
invalid_properties = super
|
150
|
+
if @tier.nil?
|
151
|
+
invalid_properties.push('invalid value for "tier", tier cannot be nil.')
|
152
|
+
end
|
153
|
+
|
154
|
+
if !@env_name.nil? && @env_name.to_s.length < 1
|
155
|
+
invalid_properties.push('invalid value for "env_name", the character length must be great than or equal to 1.')
|
156
|
+
end
|
157
|
+
|
158
|
+
if @consumer_key.nil?
|
159
|
+
invalid_properties.push('invalid value for "consumer_key", consumer_key cannot be nil.')
|
160
|
+
end
|
161
|
+
|
162
|
+
if @consumer_key.to_s.length < 1
|
163
|
+
invalid_properties.push('invalid value for "consumer_key", the character length must be great than or equal to 1.')
|
164
|
+
end
|
165
|
+
|
166
|
+
if @consumer_secret.nil?
|
167
|
+
invalid_properties.push('invalid value for "consumer_secret", consumer_secret cannot be nil.')
|
168
|
+
end
|
169
|
+
|
170
|
+
if @consumer_secret.to_s.length < 1
|
171
|
+
invalid_properties.push('invalid value for "consumer_secret", the character length must be great than or equal to 1.')
|
172
|
+
end
|
173
|
+
|
174
|
+
if !@access_token_key.nil? && @access_token_key.to_s.length < 1
|
175
|
+
invalid_properties.push('invalid value for "access_token_key", the character length must be great than or equal to 1.')
|
176
|
+
end
|
177
|
+
|
178
|
+
if @access_token_secret.nil?
|
179
|
+
invalid_properties.push('invalid value for "access_token_secret", access_token_secret cannot be nil.')
|
180
|
+
end
|
181
|
+
|
182
|
+
if @access_token_secret.to_s.length < 1
|
183
|
+
invalid_properties.push('invalid value for "access_token_secret", the character length must be great than or equal to 1.')
|
184
|
+
end
|
185
|
+
|
186
|
+
invalid_properties
|
187
|
+
end
|
188
|
+
|
189
|
+
# Check to see if the all the properties in the model are valid
|
190
|
+
# @return true if the model is valid
|
191
|
+
def valid?
|
192
|
+
return false if @tier.nil?
|
193
|
+
tier_validator = EnumAttributeValidator.new('String', ["sandbox", "premium", "enterprise"])
|
194
|
+
return false unless tier_validator.valid?(@tier)
|
195
|
+
return false if !@env_name.nil? && @env_name.to_s.length < 1
|
196
|
+
return false if @consumer_key.nil?
|
197
|
+
return false if @consumer_key.to_s.length < 1
|
198
|
+
return false if @consumer_secret.nil?
|
199
|
+
return false if @consumer_secret.to_s.length < 1
|
200
|
+
return false if !@access_token_key.nil? && @access_token_key.to_s.length < 1
|
201
|
+
return false if @access_token_secret.nil?
|
202
|
+
return false if @access_token_secret.to_s.length < 1
|
203
|
+
true && super
|
204
|
+
end
|
205
|
+
|
206
|
+
# Custom attribute writer method checking allowed values (enum).
|
207
|
+
# @param [Object] tier Object to be assigned
|
208
|
+
def tier=(tier)
|
209
|
+
validator = EnumAttributeValidator.new('String', ["sandbox", "premium", "enterprise"])
|
210
|
+
unless validator.valid?(tier)
|
211
|
+
fail ArgumentError, "invalid value for \"tier\", must be one of #{validator.allowable_values}."
|
212
|
+
end
|
213
|
+
@tier = tier
|
214
|
+
end
|
215
|
+
|
216
|
+
# Custom attribute writer method with validation
|
217
|
+
# @param [Object] env_name Value to be assigned
|
218
|
+
def env_name=(env_name)
|
219
|
+
if !env_name.nil? && env_name.to_s.length < 1
|
220
|
+
fail ArgumentError, 'invalid value for "env_name", the character length must be great than or equal to 1.'
|
221
|
+
end
|
222
|
+
|
223
|
+
@env_name = env_name
|
224
|
+
end
|
225
|
+
|
226
|
+
# Custom attribute writer method with validation
|
227
|
+
# @param [Object] consumer_key Value to be assigned
|
228
|
+
def consumer_key=(consumer_key)
|
229
|
+
if consumer_key.nil?
|
230
|
+
fail ArgumentError, 'consumer_key cannot be nil'
|
231
|
+
end
|
232
|
+
|
233
|
+
if consumer_key.to_s.length < 1
|
234
|
+
fail ArgumentError, 'invalid value for "consumer_key", the character length must be great than or equal to 1.'
|
235
|
+
end
|
236
|
+
|
237
|
+
@consumer_key = consumer_key
|
238
|
+
end
|
239
|
+
|
240
|
+
# Custom attribute writer method with validation
|
241
|
+
# @param [Object] consumer_secret Value to be assigned
|
242
|
+
def consumer_secret=(consumer_secret)
|
243
|
+
if consumer_secret.nil?
|
244
|
+
fail ArgumentError, 'consumer_secret cannot be nil'
|
245
|
+
end
|
246
|
+
|
247
|
+
if consumer_secret.to_s.length < 1
|
248
|
+
fail ArgumentError, 'invalid value for "consumer_secret", the character length must be great than or equal to 1.'
|
249
|
+
end
|
250
|
+
|
251
|
+
@consumer_secret = consumer_secret
|
252
|
+
end
|
253
|
+
|
254
|
+
# Custom attribute writer method with validation
|
255
|
+
# @param [Object] access_token_key Value to be assigned
|
256
|
+
def access_token_key=(access_token_key)
|
257
|
+
if !access_token_key.nil? && access_token_key.to_s.length < 1
|
258
|
+
fail ArgumentError, 'invalid value for "access_token_key", the character length must be great than or equal to 1.'
|
259
|
+
end
|
260
|
+
|
261
|
+
@access_token_key = access_token_key
|
262
|
+
end
|
263
|
+
|
264
|
+
# Custom attribute writer method with validation
|
265
|
+
# @param [Object] access_token_secret Value to be assigned
|
266
|
+
def access_token_secret=(access_token_secret)
|
267
|
+
if access_token_secret.nil?
|
268
|
+
fail ArgumentError, 'access_token_secret cannot be nil'
|
269
|
+
end
|
270
|
+
|
271
|
+
if access_token_secret.to_s.length < 1
|
272
|
+
fail ArgumentError, 'invalid value for "access_token_secret", the character length must be great than or equal to 1.'
|
273
|
+
end
|
274
|
+
|
275
|
+
@access_token_secret = access_token_secret
|
276
|
+
end
|
277
|
+
|
278
|
+
# Checks equality by comparing each attribute.
|
279
|
+
# @param [Object] Object to be compared
|
280
|
+
def ==(o)
|
281
|
+
return true if self.equal?(o)
|
282
|
+
self.class == o.class &&
|
283
|
+
type == o.type &&
|
284
|
+
tier == o.tier &&
|
285
|
+
env_name == o.env_name &&
|
286
|
+
consumer_key == o.consumer_key &&
|
287
|
+
consumer_secret == o.consumer_secret &&
|
288
|
+
access_token_key == o.access_token_key &&
|
289
|
+
access_token_secret == o.access_token_secret && super(o)
|
290
|
+
end
|
291
|
+
|
292
|
+
# @see the `==` method
|
293
|
+
# @param [Object] Object to be compared
|
294
|
+
def eql?(o)
|
295
|
+
self == o
|
296
|
+
end
|
297
|
+
|
298
|
+
# Calculates hash code according to all attributes.
|
299
|
+
# @return [Integer] Hash code
|
300
|
+
def hash
|
301
|
+
[type, tier, env_name, consumer_key, consumer_secret, access_token_key, access_token_secret].hash
|
302
|
+
end
|
303
|
+
|
304
|
+
# Builds the object from hash
|
305
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
306
|
+
# @return [Object] Returns the model itself
|
307
|
+
def self.build_from_hash(attributes)
|
308
|
+
new.build_from_hash(attributes)
|
309
|
+
end
|
310
|
+
|
311
|
+
# Builds the object from hash
|
312
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
313
|
+
# @return [Object] Returns the model itself
|
314
|
+
def build_from_hash(attributes)
|
315
|
+
return nil unless attributes.is_a?(Hash)
|
316
|
+
super(attributes)
|
317
|
+
self.class.openapi_types.each_pair do |key, type|
|
318
|
+
if type =~ /\AArray<(.*)>/i
|
319
|
+
# check to ensure the input is an array given that the attribute
|
320
|
+
# is documented as an array but the input is not
|
321
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
322
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
323
|
+
end
|
324
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
325
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
326
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
327
|
+
end
|
328
|
+
|
329
|
+
self
|
330
|
+
end
|
331
|
+
|
332
|
+
# Deserializes the data based on type
|
333
|
+
# @param string type Data type
|
334
|
+
# @param string value Value to be deserialized
|
335
|
+
# @return [Object] Deserialized data
|
336
|
+
def _deserialize(type, value)
|
337
|
+
case type.to_sym
|
338
|
+
when :DateTime
|
339
|
+
DateTime.parse(value)
|
340
|
+
when :Date
|
341
|
+
Date.parse(value)
|
342
|
+
when :String
|
343
|
+
value.to_s
|
344
|
+
when :Integer
|
345
|
+
value.to_i
|
346
|
+
when :Float
|
347
|
+
value.to_f
|
348
|
+
when :Boolean
|
349
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
350
|
+
true
|
351
|
+
else
|
352
|
+
false
|
353
|
+
end
|
354
|
+
when :Object
|
355
|
+
# generic object (usually a Hash), return directly
|
356
|
+
value
|
357
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
358
|
+
inner_type = Regexp.last_match[:inner_type]
|
359
|
+
value.map { |v| _deserialize(inner_type, v) }
|
360
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
361
|
+
k_type = Regexp.last_match[:k_type]
|
362
|
+
v_type = Regexp.last_match[:v_type]
|
363
|
+
{}.tap do |hash|
|
364
|
+
value.each do |k, v|
|
365
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
366
|
+
end
|
367
|
+
end
|
368
|
+
else # model
|
369
|
+
SunshineConversationsClient.const_get(type).build_from_hash(value)
|
370
|
+
end
|
371
|
+
end
|
372
|
+
|
373
|
+
# Returns the string representation of the object
|
374
|
+
# @return [String] String presentation of the object
|
375
|
+
def to_s
|
376
|
+
to_hash.to_s
|
377
|
+
end
|
378
|
+
|
379
|
+
# to_body is an alias to to_hash (backward compatibility)
|
380
|
+
# @return [Hash] Returns the object in the form of hash
|
381
|
+
def to_body
|
382
|
+
to_hash
|
383
|
+
end
|
384
|
+
|
385
|
+
# Returns the object in the form of hash
|
386
|
+
# @return [Hash] Returns the object in the form of hash
|
387
|
+
def to_hash
|
388
|
+
hash = super
|
389
|
+
self.class.attribute_map.each_pair do |attr, param|
|
390
|
+
value = self.send(attr)
|
391
|
+
if value.nil?
|
392
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
393
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
394
|
+
end
|
395
|
+
|
396
|
+
hash[param] = _to_hash(value)
|
397
|
+
end
|
398
|
+
hash
|
399
|
+
end
|
400
|
+
|
401
|
+
# Outputs non-array value in the form of hash
|
402
|
+
# For object, use to_hash. Otherwise, just return the value
|
403
|
+
# @param [Object] value Any valid value
|
404
|
+
# @return [Hash] Returns the value in the form of hash
|
405
|
+
def _to_hash(value)
|
406
|
+
if value.is_a?(Array)
|
407
|
+
value.compact.map { |v| _to_hash(v) }
|
408
|
+
elsif value.is_a?(Hash)
|
409
|
+
{}.tap do |hash|
|
410
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
411
|
+
end
|
412
|
+
elsif value.respond_to? :to_hash
|
413
|
+
value.to_hash
|
414
|
+
else
|
415
|
+
value
|
416
|
+
end
|
417
|
+
end
|
418
|
+
end
|
419
|
+
end
|
@@ -0,0 +1,408 @@
|
|
1
|
+
=begin
|
2
|
+
#Sunshine Conversations API
|
3
|
+
|
4
|
+
The version of the OpenAPI document: 9.1.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
|
+
# To set up a Twitter integration, please follow the steps outlined in the [Twitter Setup Guide](https://docs.smooch.io/guide/twitter/#setup).
|
14
|
+
class TwitterAllOf
|
15
|
+
# The type of integration.
|
16
|
+
attr_accessor :type
|
17
|
+
|
18
|
+
# Your Twitter app’s tier, sandbox, premium or enterprise.
|
19
|
+
attr_accessor :tier
|
20
|
+
|
21
|
+
# The Twitter dev environments label (required for sandbox and premium tiers).
|
22
|
+
attr_accessor :env_name
|
23
|
+
|
24
|
+
# The consumer key for your Twitter app.
|
25
|
+
attr_accessor :consumer_key
|
26
|
+
|
27
|
+
# The consumer key secret for your Twitter app.
|
28
|
+
attr_accessor :consumer_secret
|
29
|
+
|
30
|
+
# The access token key obtained from your user via oauth.
|
31
|
+
attr_accessor :access_token_key
|
32
|
+
|
33
|
+
# The access token secret obtained from your user via oauth.
|
34
|
+
attr_accessor :access_token_secret
|
35
|
+
|
36
|
+
class EnumAttributeValidator
|
37
|
+
attr_reader :datatype
|
38
|
+
attr_reader :allowable_values
|
39
|
+
|
40
|
+
def initialize(datatype, allowable_values)
|
41
|
+
@allowable_values = allowable_values.map do |value|
|
42
|
+
case datatype.to_s
|
43
|
+
when /Integer/i
|
44
|
+
value.to_i
|
45
|
+
when /Float/i
|
46
|
+
value.to_f
|
47
|
+
else
|
48
|
+
value
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def valid?(value)
|
54
|
+
!value || allowable_values.include?(value)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
59
|
+
def self.attribute_map
|
60
|
+
{
|
61
|
+
:'type' => :'type',
|
62
|
+
:'tier' => :'tier',
|
63
|
+
:'env_name' => :'envName',
|
64
|
+
:'consumer_key' => :'consumerKey',
|
65
|
+
:'consumer_secret' => :'consumerSecret',
|
66
|
+
:'access_token_key' => :'accessTokenKey',
|
67
|
+
:'access_token_secret' => :'accessTokenSecret'
|
68
|
+
}
|
69
|
+
end
|
70
|
+
|
71
|
+
# Attribute type mapping.
|
72
|
+
def self.openapi_types
|
73
|
+
{
|
74
|
+
:'type' => :'String',
|
75
|
+
:'tier' => :'String',
|
76
|
+
:'env_name' => :'String',
|
77
|
+
:'consumer_key' => :'String',
|
78
|
+
:'consumer_secret' => :'String',
|
79
|
+
:'access_token_key' => :'String',
|
80
|
+
:'access_token_secret' => :'String'
|
81
|
+
}
|
82
|
+
end
|
83
|
+
|
84
|
+
# List of attributes with nullable: true
|
85
|
+
def self.openapi_nullable
|
86
|
+
Set.new([
|
87
|
+
])
|
88
|
+
end
|
89
|
+
|
90
|
+
# Initializes the object
|
91
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
92
|
+
def initialize(attributes = {})
|
93
|
+
if (!attributes.is_a?(Hash))
|
94
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `SunshineConversationsClient::TwitterAllOf` initialize method"
|
95
|
+
end
|
96
|
+
|
97
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
98
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
99
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
100
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `SunshineConversationsClient::TwitterAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
101
|
+
end
|
102
|
+
h[k.to_sym] = v
|
103
|
+
}
|
104
|
+
|
105
|
+
if attributes.key?(:'type')
|
106
|
+
self.type = attributes[:'type']
|
107
|
+
else
|
108
|
+
self.type = 'twitter'
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.key?(:'tier')
|
112
|
+
self.tier = attributes[:'tier']
|
113
|
+
end
|
114
|
+
|
115
|
+
if attributes.key?(:'env_name')
|
116
|
+
self.env_name = attributes[:'env_name']
|
117
|
+
end
|
118
|
+
|
119
|
+
if attributes.key?(:'consumer_key')
|
120
|
+
self.consumer_key = attributes[:'consumer_key']
|
121
|
+
end
|
122
|
+
|
123
|
+
if attributes.key?(:'consumer_secret')
|
124
|
+
self.consumer_secret = attributes[:'consumer_secret']
|
125
|
+
end
|
126
|
+
|
127
|
+
if attributes.key?(:'access_token_key')
|
128
|
+
self.access_token_key = attributes[:'access_token_key']
|
129
|
+
end
|
130
|
+
|
131
|
+
if attributes.key?(:'access_token_secret')
|
132
|
+
self.access_token_secret = attributes[:'access_token_secret']
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
137
|
+
# @return Array for valid properties with the reasons
|
138
|
+
def list_invalid_properties
|
139
|
+
invalid_properties = Array.new
|
140
|
+
if @tier.nil?
|
141
|
+
invalid_properties.push('invalid value for "tier", tier cannot be nil.')
|
142
|
+
end
|
143
|
+
|
144
|
+
if !@env_name.nil? && @env_name.to_s.length < 1
|
145
|
+
invalid_properties.push('invalid value for "env_name", the character length must be great than or equal to 1.')
|
146
|
+
end
|
147
|
+
|
148
|
+
if @consumer_key.nil?
|
149
|
+
invalid_properties.push('invalid value for "consumer_key", consumer_key cannot be nil.')
|
150
|
+
end
|
151
|
+
|
152
|
+
if @consumer_key.to_s.length < 1
|
153
|
+
invalid_properties.push('invalid value for "consumer_key", the character length must be great than or equal to 1.')
|
154
|
+
end
|
155
|
+
|
156
|
+
if @consumer_secret.nil?
|
157
|
+
invalid_properties.push('invalid value for "consumer_secret", consumer_secret cannot be nil.')
|
158
|
+
end
|
159
|
+
|
160
|
+
if @consumer_secret.to_s.length < 1
|
161
|
+
invalid_properties.push('invalid value for "consumer_secret", the character length must be great than or equal to 1.')
|
162
|
+
end
|
163
|
+
|
164
|
+
if !@access_token_key.nil? && @access_token_key.to_s.length < 1
|
165
|
+
invalid_properties.push('invalid value for "access_token_key", the character length must be great than or equal to 1.')
|
166
|
+
end
|
167
|
+
|
168
|
+
if @access_token_secret.nil?
|
169
|
+
invalid_properties.push('invalid value for "access_token_secret", access_token_secret cannot be nil.')
|
170
|
+
end
|
171
|
+
|
172
|
+
if @access_token_secret.to_s.length < 1
|
173
|
+
invalid_properties.push('invalid value for "access_token_secret", the character length must be great than or equal to 1.')
|
174
|
+
end
|
175
|
+
|
176
|
+
invalid_properties
|
177
|
+
end
|
178
|
+
|
179
|
+
# Check to see if the all the properties in the model are valid
|
180
|
+
# @return true if the model is valid
|
181
|
+
def valid?
|
182
|
+
return false if @tier.nil?
|
183
|
+
tier_validator = EnumAttributeValidator.new('String', ["sandbox", "premium", "enterprise"])
|
184
|
+
return false unless tier_validator.valid?(@tier)
|
185
|
+
return false if !@env_name.nil? && @env_name.to_s.length < 1
|
186
|
+
return false if @consumer_key.nil?
|
187
|
+
return false if @consumer_key.to_s.length < 1
|
188
|
+
return false if @consumer_secret.nil?
|
189
|
+
return false if @consumer_secret.to_s.length < 1
|
190
|
+
return false if !@access_token_key.nil? && @access_token_key.to_s.length < 1
|
191
|
+
return false if @access_token_secret.nil?
|
192
|
+
return false if @access_token_secret.to_s.length < 1
|
193
|
+
true
|
194
|
+
end
|
195
|
+
|
196
|
+
# Custom attribute writer method checking allowed values (enum).
|
197
|
+
# @param [Object] tier Object to be assigned
|
198
|
+
def tier=(tier)
|
199
|
+
validator = EnumAttributeValidator.new('String', ["sandbox", "premium", "enterprise"])
|
200
|
+
unless validator.valid?(tier)
|
201
|
+
fail ArgumentError, "invalid value for \"tier\", must be one of #{validator.allowable_values}."
|
202
|
+
end
|
203
|
+
@tier = tier
|
204
|
+
end
|
205
|
+
|
206
|
+
# Custom attribute writer method with validation
|
207
|
+
# @param [Object] env_name Value to be assigned
|
208
|
+
def env_name=(env_name)
|
209
|
+
if !env_name.nil? && env_name.to_s.length < 1
|
210
|
+
fail ArgumentError, 'invalid value for "env_name", the character length must be great than or equal to 1.'
|
211
|
+
end
|
212
|
+
|
213
|
+
@env_name = env_name
|
214
|
+
end
|
215
|
+
|
216
|
+
# Custom attribute writer method with validation
|
217
|
+
# @param [Object] consumer_key Value to be assigned
|
218
|
+
def consumer_key=(consumer_key)
|
219
|
+
if consumer_key.nil?
|
220
|
+
fail ArgumentError, 'consumer_key cannot be nil'
|
221
|
+
end
|
222
|
+
|
223
|
+
if consumer_key.to_s.length < 1
|
224
|
+
fail ArgumentError, 'invalid value for "consumer_key", the character length must be great than or equal to 1.'
|
225
|
+
end
|
226
|
+
|
227
|
+
@consumer_key = consumer_key
|
228
|
+
end
|
229
|
+
|
230
|
+
# Custom attribute writer method with validation
|
231
|
+
# @param [Object] consumer_secret Value to be assigned
|
232
|
+
def consumer_secret=(consumer_secret)
|
233
|
+
if consumer_secret.nil?
|
234
|
+
fail ArgumentError, 'consumer_secret cannot be nil'
|
235
|
+
end
|
236
|
+
|
237
|
+
if consumer_secret.to_s.length < 1
|
238
|
+
fail ArgumentError, 'invalid value for "consumer_secret", the character length must be great than or equal to 1.'
|
239
|
+
end
|
240
|
+
|
241
|
+
@consumer_secret = consumer_secret
|
242
|
+
end
|
243
|
+
|
244
|
+
# Custom attribute writer method with validation
|
245
|
+
# @param [Object] access_token_key Value to be assigned
|
246
|
+
def access_token_key=(access_token_key)
|
247
|
+
if !access_token_key.nil? && access_token_key.to_s.length < 1
|
248
|
+
fail ArgumentError, 'invalid value for "access_token_key", the character length must be great than or equal to 1.'
|
249
|
+
end
|
250
|
+
|
251
|
+
@access_token_key = access_token_key
|
252
|
+
end
|
253
|
+
|
254
|
+
# Custom attribute writer method with validation
|
255
|
+
# @param [Object] access_token_secret Value to be assigned
|
256
|
+
def access_token_secret=(access_token_secret)
|
257
|
+
if access_token_secret.nil?
|
258
|
+
fail ArgumentError, 'access_token_secret cannot be nil'
|
259
|
+
end
|
260
|
+
|
261
|
+
if access_token_secret.to_s.length < 1
|
262
|
+
fail ArgumentError, 'invalid value for "access_token_secret", the character length must be great than or equal to 1.'
|
263
|
+
end
|
264
|
+
|
265
|
+
@access_token_secret = access_token_secret
|
266
|
+
end
|
267
|
+
|
268
|
+
# Checks equality by comparing each attribute.
|
269
|
+
# @param [Object] Object to be compared
|
270
|
+
def ==(o)
|
271
|
+
return true if self.equal?(o)
|
272
|
+
self.class == o.class &&
|
273
|
+
type == o.type &&
|
274
|
+
tier == o.tier &&
|
275
|
+
env_name == o.env_name &&
|
276
|
+
consumer_key == o.consumer_key &&
|
277
|
+
consumer_secret == o.consumer_secret &&
|
278
|
+
access_token_key == o.access_token_key &&
|
279
|
+
access_token_secret == o.access_token_secret
|
280
|
+
end
|
281
|
+
|
282
|
+
# @see the `==` method
|
283
|
+
# @param [Object] Object to be compared
|
284
|
+
def eql?(o)
|
285
|
+
self == o
|
286
|
+
end
|
287
|
+
|
288
|
+
# Calculates hash code according to all attributes.
|
289
|
+
# @return [Integer] Hash code
|
290
|
+
def hash
|
291
|
+
[type, tier, env_name, consumer_key, consumer_secret, access_token_key, access_token_secret].hash
|
292
|
+
end
|
293
|
+
|
294
|
+
# Builds the object from hash
|
295
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
296
|
+
# @return [Object] Returns the model itself
|
297
|
+
def self.build_from_hash(attributes)
|
298
|
+
new.build_from_hash(attributes)
|
299
|
+
end
|
300
|
+
|
301
|
+
# Builds the object from hash
|
302
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
303
|
+
# @return [Object] Returns the model itself
|
304
|
+
def build_from_hash(attributes)
|
305
|
+
return nil unless attributes.is_a?(Hash)
|
306
|
+
self.class.openapi_types.each_pair do |key, type|
|
307
|
+
if type =~ /\AArray<(.*)>/i
|
308
|
+
# check to ensure the input is an array given that the attribute
|
309
|
+
# is documented as an array but the input is not
|
310
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
311
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
312
|
+
end
|
313
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
314
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
315
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
316
|
+
end
|
317
|
+
|
318
|
+
self
|
319
|
+
end
|
320
|
+
|
321
|
+
# Deserializes the data based on type
|
322
|
+
# @param string type Data type
|
323
|
+
# @param string value Value to be deserialized
|
324
|
+
# @return [Object] Deserialized data
|
325
|
+
def _deserialize(type, value)
|
326
|
+
case type.to_sym
|
327
|
+
when :DateTime
|
328
|
+
DateTime.parse(value)
|
329
|
+
when :Date
|
330
|
+
Date.parse(value)
|
331
|
+
when :String
|
332
|
+
value.to_s
|
333
|
+
when :Integer
|
334
|
+
value.to_i
|
335
|
+
when :Float
|
336
|
+
value.to_f
|
337
|
+
when :Boolean
|
338
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
339
|
+
true
|
340
|
+
else
|
341
|
+
false
|
342
|
+
end
|
343
|
+
when :Object
|
344
|
+
# generic object (usually a Hash), return directly
|
345
|
+
value
|
346
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
347
|
+
inner_type = Regexp.last_match[:inner_type]
|
348
|
+
value.map { |v| _deserialize(inner_type, v) }
|
349
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
350
|
+
k_type = Regexp.last_match[:k_type]
|
351
|
+
v_type = Regexp.last_match[:v_type]
|
352
|
+
{}.tap do |hash|
|
353
|
+
value.each do |k, v|
|
354
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
355
|
+
end
|
356
|
+
end
|
357
|
+
else # model
|
358
|
+
SunshineConversationsClient.const_get(type).build_from_hash(value)
|
359
|
+
end
|
360
|
+
end
|
361
|
+
|
362
|
+
# Returns the string representation of the object
|
363
|
+
# @return [String] String presentation of the object
|
364
|
+
def to_s
|
365
|
+
to_hash.to_s
|
366
|
+
end
|
367
|
+
|
368
|
+
# to_body is an alias to to_hash (backward compatibility)
|
369
|
+
# @return [Hash] Returns the object in the form of hash
|
370
|
+
def to_body
|
371
|
+
to_hash
|
372
|
+
end
|
373
|
+
|
374
|
+
# Returns the object in the form of hash
|
375
|
+
# @return [Hash] Returns the object in the form of hash
|
376
|
+
def to_hash
|
377
|
+
hash = {}
|
378
|
+
self.class.attribute_map.each_pair do |attr, param|
|
379
|
+
value = self.send(attr)
|
380
|
+
if value.nil?
|
381
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
382
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
383
|
+
end
|
384
|
+
|
385
|
+
hash[param] = _to_hash(value)
|
386
|
+
end
|
387
|
+
hash
|
388
|
+
end
|
389
|
+
|
390
|
+
# Outputs non-array value in the form of hash
|
391
|
+
# For object, use to_hash. Otherwise, just return the value
|
392
|
+
# @param [Object] value Any valid value
|
393
|
+
# @return [Hash] Returns the value in the form of hash
|
394
|
+
def _to_hash(value)
|
395
|
+
if value.is_a?(Array)
|
396
|
+
value.compact.map { |v| _to_hash(v) }
|
397
|
+
elsif value.is_a?(Hash)
|
398
|
+
{}.tap do |hash|
|
399
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
400
|
+
end
|
401
|
+
elsif value.respond_to? :to_hash
|
402
|
+
value.to_hash
|
403
|
+
else
|
404
|
+
value
|
405
|
+
end
|
406
|
+
end
|
407
|
+
end
|
408
|
+
end
|