telegram-bot-openapi 7.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +419 -0
- data/Rakefile +10 -0
- data/docs/Animation.md +34 -0
- data/docs/AnswerWebAppQuery200Response.md +20 -0
- data/docs/Audio.md +34 -0
- data/docs/Birthdate.md +22 -0
- data/docs/BotCommand.md +20 -0
- data/docs/BotCommandScopeAllChatAdministrators.md +18 -0
- data/docs/BotCommandScopeAllGroupChats.md +18 -0
- data/docs/BotCommandScopeAllPrivateChats.md +18 -0
- data/docs/BotCommandScopeChat.md +20 -0
- data/docs/BotCommandScopeChatAdministrators.md +20 -0
- data/docs/BotCommandScopeChatMember.md +22 -0
- data/docs/BotCommandScopeDefault.md +18 -0
- data/docs/BotDescription.md +18 -0
- data/docs/BotName.md +18 -0
- data/docs/BotShortDescription.md +18 -0
- data/docs/BusinessConnection.md +28 -0
- data/docs/BusinessIntro.md +22 -0
- data/docs/BusinessLocation.md +20 -0
- data/docs/BusinessMessagesDeleted.md +22 -0
- data/docs/BusinessOpeningHours.md +20 -0
- data/docs/BusinessOpeningHoursInterval.md +20 -0
- data/docs/CallbackQuery.md +30 -0
- data/docs/Chat.md +100 -0
- data/docs/ChatAdministratorRights.md +46 -0
- data/docs/ChatBoost.md +24 -0
- data/docs/ChatBoostAdded.md +18 -0
- data/docs/ChatBoostRemoved.md +24 -0
- data/docs/ChatBoostSourceGiftCode.md +20 -0
- data/docs/ChatBoostSourceGiveaway.md +24 -0
- data/docs/ChatBoostSourcePremium.md +20 -0
- data/docs/ChatBoostUpdated.md +20 -0
- data/docs/ChatInviteLink.md +34 -0
- data/docs/ChatJoinRequest.md +28 -0
- data/docs/ChatLocation.md +20 -0
- data/docs/ChatMemberAdministrator.md +54 -0
- data/docs/ChatMemberBanned.md +22 -0
- data/docs/ChatMemberLeft.md +20 -0
- data/docs/ChatMemberMember.md +20 -0
- data/docs/ChatMemberOwner.md +24 -0
- data/docs/ChatMemberRestricted.md +52 -0
- data/docs/ChatMemberUpdated.md +30 -0
- data/docs/ChatPermissions.md +44 -0
- data/docs/ChatPhoto.md +24 -0
- data/docs/ChatShared.md +26 -0
- data/docs/ChosenInlineResult.md +26 -0
- data/docs/Contact.md +26 -0
- data/docs/CopyMessage200Response.md +20 -0
- data/docs/CreateChatInviteLink200Response.md +20 -0
- data/docs/CreateForumTopic200Response.md +20 -0
- data/docs/DefaultApi.md +8843 -0
- data/docs/Dice.md +20 -0
- data/docs/Document.md +28 -0
- data/docs/EditMessageText200Response.md +20 -0
- data/docs/EditMessageText200ResponseResultValue.md +49 -0
- data/docs/EncryptedCredentials.md +22 -0
- data/docs/EncryptedPassportElement.md +36 -0
- data/docs/ExportChatInviteLink200Response.md +20 -0
- data/docs/ExternalReplyInfo.md +62 -0
- data/docs/File.md +24 -0
- data/docs/ForceReply.md +22 -0
- data/docs/ForumTopic.md +24 -0
- data/docs/ForumTopicCreated.md +22 -0
- data/docs/ForumTopicEdited.md +20 -0
- data/docs/ForwardMessages200Response.md +20 -0
- data/docs/Game.md +28 -0
- data/docs/GameHighScore.md +22 -0
- data/docs/GetBusinessConnection200Response.md +20 -0
- data/docs/GetChat200Response.md +20 -0
- data/docs/GetChatAdministrators200Response.md +20 -0
- data/docs/GetChatMember200Response.md +20 -0
- data/docs/GetChatMemberCount200Response.md +20 -0
- data/docs/GetChatMenuButton200Response.md +20 -0
- data/docs/GetFile200Response.md +20 -0
- data/docs/GetForumTopicIconStickers200Response.md +20 -0
- data/docs/GetGameHighScores200Response.md +20 -0
- data/docs/GetMe200Response.md +20 -0
- data/docs/GetMyCommands200Response.md +20 -0
- data/docs/GetMyDefaultAdministratorRights200Response.md +20 -0
- data/docs/GetMyDescription200Response.md +20 -0
- data/docs/GetMyName200Response.md +20 -0
- data/docs/GetMyShortDescription200Response.md +20 -0
- data/docs/GetStickerSet200Response.md +20 -0
- data/docs/GetUpdates200Response.md +20 -0
- data/docs/GetUpdates4XXResponse.md +22 -0
- data/docs/GetUserChatBoosts200Response.md +20 -0
- data/docs/GetUserProfilePhotos200Response.md +20 -0
- data/docs/GetWebhookInfo200Response.md +20 -0
- data/docs/Giveaway.md +32 -0
- data/docs/GiveawayCompleted.md +22 -0
- data/docs/GiveawayWinners.md +38 -0
- data/docs/InaccessibleMessage.md +22 -0
- data/docs/InlineKeyboardButton.md +36 -0
- data/docs/InlineKeyboardMarkup.md +18 -0
- data/docs/InlineQuery.md +28 -0
- data/docs/InlineQueryResultArticle.md +38 -0
- data/docs/InlineQueryResultAudio.md +38 -0
- data/docs/InlineQueryResultCachedAudio.md +32 -0
- data/docs/InlineQueryResultCachedDocument.md +36 -0
- data/docs/InlineQueryResultCachedGif.md +34 -0
- data/docs/InlineQueryResultCachedMpeg4Gif.md +34 -0
- data/docs/InlineQueryResultCachedPhoto.md +36 -0
- data/docs/InlineQueryResultCachedSticker.md +26 -0
- data/docs/InlineQueryResultCachedVideo.md +36 -0
- data/docs/InlineQueryResultCachedVoice.md +34 -0
- data/docs/InlineQueryResultContact.md +38 -0
- data/docs/InlineQueryResultDocument.md +44 -0
- data/docs/InlineQueryResultGame.md +24 -0
- data/docs/InlineQueryResultGif.md +44 -0
- data/docs/InlineQueryResultLocation.md +44 -0
- data/docs/InlineQueryResultMpeg4Gif.md +44 -0
- data/docs/InlineQueryResultPhoto.md +42 -0
- data/docs/InlineQueryResultVenue.md +46 -0
- data/docs/InlineQueryResultVideo.md +46 -0
- data/docs/InlineQueryResultVoice.md +36 -0
- data/docs/InlineQueryResultsButton.md +22 -0
- data/docs/InputContactMessageContent.md +24 -0
- data/docs/InputInvoiceMessageContent.md +56 -0
- data/docs/InputLocationMessageContent.md +28 -0
- data/docs/InputMediaAnimation.md +36 -0
- data/docs/InputMediaAudio.md +34 -0
- data/docs/InputMediaDocument.md +30 -0
- data/docs/InputMediaPhoto.md +28 -0
- data/docs/InputMediaVideo.md +38 -0
- data/docs/InputSticker.md +26 -0
- data/docs/InputTextMessageContent.md +24 -0
- data/docs/InputVenueMessageContent.md +32 -0
- data/docs/Invoice.md +26 -0
- data/docs/KeyboardButton.md +30 -0
- data/docs/KeyboardButtonPollType.md +18 -0
- data/docs/KeyboardButtonRequestChat.md +38 -0
- data/docs/KeyboardButtonRequestUsers.md +30 -0
- data/docs/LabeledPrice.md +20 -0
- data/docs/LinkPreviewOptions.md +26 -0
- data/docs/Location.md +28 -0
- data/docs/LoginUrl.md +24 -0
- data/docs/MaskPosition.md +24 -0
- data/docs/MenuButtonCommands.md +18 -0
- data/docs/MenuButtonDefault.md +18 -0
- data/docs/MenuButtonWebApp.md +22 -0
- data/docs/Message.md +176 -0
- data/docs/MessageAutoDeleteTimerChanged.md +18 -0
- data/docs/MessageEntity.md +30 -0
- data/docs/MessageId.md +18 -0
- data/docs/MessageOriginChannel.md +26 -0
- data/docs/MessageOriginChat.md +24 -0
- data/docs/MessageOriginHiddenUser.md +22 -0
- data/docs/MessageOriginUser.md +22 -0
- data/docs/MessageReactionCountUpdated.md +24 -0
- data/docs/MessageReactionUpdated.md +30 -0
- data/docs/OrderInfo.md +24 -0
- data/docs/PassportData.md +20 -0
- data/docs/PassportElementErrorDataField.md +26 -0
- data/docs/PassportElementErrorFile.md +24 -0
- data/docs/PassportElementErrorFiles.md +24 -0
- data/docs/PassportElementErrorFrontSide.md +24 -0
- data/docs/PassportElementErrorReverseSide.md +24 -0
- data/docs/PassportElementErrorSelfie.md +24 -0
- data/docs/PassportElementErrorTranslationFile.md +24 -0
- data/docs/PassportElementErrorTranslationFiles.md +24 -0
- data/docs/PassportElementErrorUnspecified.md +24 -0
- data/docs/PassportFile.md +24 -0
- data/docs/PhotoSize.md +26 -0
- data/docs/Poll.md +42 -0
- data/docs/PollAnswer.md +24 -0
- data/docs/PollOption.md +20 -0
- data/docs/PreCheckoutQuery.md +30 -0
- data/docs/ProximityAlertTriggered.md +22 -0
- data/docs/ReactionCount.md +20 -0
- data/docs/ReactionTypeCustomEmoji.md +20 -0
- data/docs/ReactionTypeEmoji.md +20 -0
- data/docs/ReplyKeyboardMarkup.md +28 -0
- data/docs/ReplyKeyboardRemove.md +20 -0
- data/docs/ReplyParameters.md +30 -0
- data/docs/ResponseParameters.md +20 -0
- data/docs/SendMediaGroup200Response.md +20 -0
- data/docs/SendMediaGroupMediaParameterValue.md +53 -0
- data/docs/SendMessage200Response.md +20 -0
- data/docs/SendMessageChatIdParameterValue.md +49 -0
- data/docs/SendMessageReplyMarkupParameterValue.md +53 -0
- data/docs/SendPhotoPhotoParameterValue.md +49 -0
- data/docs/SentWebAppMessage.md +18 -0
- data/docs/SetWebhook200Response.md +20 -0
- data/docs/SharedUser.md +26 -0
- data/docs/ShippingAddress.md +28 -0
- data/docs/ShippingOption.md +22 -0
- data/docs/ShippingQuery.md +24 -0
- data/docs/Sticker.md +46 -0
- data/docs/StickerSet.md +26 -0
- data/docs/StopPoll200Response.md +20 -0
- data/docs/Story.md +20 -0
- data/docs/SuccessfulPayment.md +30 -0
- data/docs/SwitchInlineQueryChosenChat.md +26 -0
- data/docs/TextQuote.md +24 -0
- data/docs/Update.md +62 -0
- data/docs/User.md +40 -0
- data/docs/UserChatBoosts.md +18 -0
- data/docs/UserProfilePhotos.md +20 -0
- data/docs/UsersShared.md +20 -0
- data/docs/Venue.md +30 -0
- data/docs/Video.md +34 -0
- data/docs/VideoChatEnded.md +18 -0
- data/docs/VideoChatParticipantsInvited.md +18 -0
- data/docs/VideoChatScheduled.md +18 -0
- data/docs/VideoNote.md +28 -0
- data/docs/Voice.md +26 -0
- data/docs/WebAppData.md +20 -0
- data/docs/WebAppInfo.md +18 -0
- data/docs/WebhookInfo.md +34 -0
- data/docs/WriteAccessAllowed.md +22 -0
- data/git_push.sh +57 -0
- data/lib/telegram-bot/api/default_api.rb +9305 -0
- data/lib/telegram-bot/api_client.rb +393 -0
- data/lib/telegram-bot/api_error.rb +58 -0
- data/lib/telegram-bot/configuration.rb +307 -0
- data/lib/telegram-bot/models/animation.rb +331 -0
- data/lib/telegram-bot/models/answer_web_app_query200_response.rb +223 -0
- data/lib/telegram-bot/models/audio.rb +317 -0
- data/lib/telegram-bot/models/birthdate.rb +250 -0
- data/lib/telegram-bot/models/bot_command.rb +240 -0
- data/lib/telegram-bot/models/bot_command_scope_all_chat_administrators.rb +223 -0
- data/lib/telegram-bot/models/bot_command_scope_all_group_chats.rb +223 -0
- data/lib/telegram-bot/models/bot_command_scope_all_private_chats.rb +223 -0
- data/lib/telegram-bot/models/bot_command_scope_chat.rb +242 -0
- data/lib/telegram-bot/models/bot_command_scope_chat_administrators.rb +242 -0
- data/lib/telegram-bot/models/bot_command_scope_chat_member.rb +259 -0
- data/lib/telegram-bot/models/bot_command_scope_default.rb +223 -0
- data/lib/telegram-bot/models/bot_description.rb +223 -0
- data/lib/telegram-bot/models/bot_name.rb +223 -0
- data/lib/telegram-bot/models/bot_short_description.rb +223 -0
- data/lib/telegram-bot/models/business_connection.rb +308 -0
- data/lib/telegram-bot/models/business_intro.rb +236 -0
- data/lib/telegram-bot/models/business_location.rb +233 -0
- data/lib/telegram-bot/models/business_messages_deleted.rb +259 -0
- data/lib/telegram-bot/models/business_opening_hours.rb +242 -0
- data/lib/telegram-bot/models/business_opening_hours_interval.rb +240 -0
- data/lib/telegram-bot/models/callback_query.rb +297 -0
- data/lib/telegram-bot/models/chat.rb +644 -0
- data/lib/telegram-bot/models/chat_administrator_rights.rb +433 -0
- data/lib/telegram-bot/models/chat_boost.rb +274 -0
- data/lib/telegram-bot/models/chat_boost_added.rb +223 -0
- data/lib/telegram-bot/models/chat_boost_removed.rb +274 -0
- data/lib/telegram-bot/models/chat_boost_source_gift_code.rb +240 -0
- data/lib/telegram-bot/models/chat_boost_source_giveaway.rb +260 -0
- data/lib/telegram-bot/models/chat_boost_source_premium.rb +240 -0
- data/lib/telegram-bot/models/chat_boost_updated.rb +240 -0
- data/lib/telegram-bot/models/chat_invite_link.rb +331 -0
- data/lib/telegram-bot/models/chat_join_request.rb +294 -0
- data/lib/telegram-bot/models/chat_location.rb +240 -0
- data/lib/telegram-bot/models/chat_member_administrator.rb +494 -0
- data/lib/telegram-bot/models/chat_member_banned.rb +257 -0
- data/lib/telegram-bot/models/chat_member_left.rb +240 -0
- data/lib/telegram-bot/models/chat_member_member.rb +240 -0
- data/lib/telegram-bot/models/chat_member_owner.rb +267 -0
- data/lib/telegram-bot/models/chat_member_restricted.rb +512 -0
- data/lib/telegram-bot/models/chat_member_updated.rb +311 -0
- data/lib/telegram-bot/models/chat_permissions.rb +346 -0
- data/lib/telegram-bot/models/chat_photo.rb +274 -0
- data/lib/telegram-bot/models/chat_shared.rb +272 -0
- data/lib/telegram-bot/models/chosen_inline_result.rb +277 -0
- data/lib/telegram-bot/models/contact.rb +270 -0
- data/lib/telegram-bot/models/copy_message200_response.rb +223 -0
- data/lib/telegram-bot/models/create_chat_invite_link200_response.rb +223 -0
- data/lib/telegram-bot/models/create_forum_topic200_response.rb +223 -0
- data/lib/telegram-bot/models/dice.rb +240 -0
- data/lib/telegram-bot/models/document.rb +280 -0
- data/lib/telegram-bot/models/edit_message_text200_response.rb +225 -0
- data/lib/telegram-bot/models/edit_message_text200_response_result_value.rb +105 -0
- data/lib/telegram-bot/models/encrypted_credentials.rb +257 -0
- data/lib/telegram-bot/models/encrypted_passport_element.rb +324 -0
- data/lib/telegram-bot/models/export_chat_invite_link200_response.rb +223 -0
- data/lib/telegram-bot/models/external_reply_info.rb +445 -0
- data/lib/telegram-bot/models/file.rb +260 -0
- data/lib/telegram-bot/models/force_reply.rb +243 -0
- data/lib/telegram-bot/models/forum_topic.rb +267 -0
- data/lib/telegram-bot/models/forum_topic_created.rb +250 -0
- data/lib/telegram-bot/models/forum_topic_edited.rb +226 -0
- data/lib/telegram-bot/models/forward_messages200_response.rb +225 -0
- data/lib/telegram-bot/models/game.rb +291 -0
- data/lib/telegram-bot/models/game_high_score.rb +257 -0
- data/lib/telegram-bot/models/get_business_connection200_response.rb +223 -0
- data/lib/telegram-bot/models/get_chat200_response.rb +223 -0
- data/lib/telegram-bot/models/get_chat_administrators200_response.rb +225 -0
- data/lib/telegram-bot/models/get_chat_member200_response.rb +224 -0
- data/lib/telegram-bot/models/get_chat_member_count200_response.rb +223 -0
- data/lib/telegram-bot/models/get_chat_menu_button200_response.rb +224 -0
- data/lib/telegram-bot/models/get_file200_response.rb +223 -0
- data/lib/telegram-bot/models/get_forum_topic_icon_stickers200_response.rb +225 -0
- data/lib/telegram-bot/models/get_game_high_scores200_response.rb +225 -0
- data/lib/telegram-bot/models/get_me200_response.rb +223 -0
- data/lib/telegram-bot/models/get_my_commands200_response.rb +225 -0
- data/lib/telegram-bot/models/get_my_default_administrator_rights200_response.rb +223 -0
- data/lib/telegram-bot/models/get_my_description200_response.rb +223 -0
- data/lib/telegram-bot/models/get_my_name200_response.rb +223 -0
- data/lib/telegram-bot/models/get_my_short_description200_response.rb +223 -0
- data/lib/telegram-bot/models/get_sticker_set200_response.rb +223 -0
- data/lib/telegram-bot/models/get_updates200_response.rb +225 -0
- data/lib/telegram-bot/models/get_updates4_xx_response.rb +232 -0
- data/lib/telegram-bot/models/get_user_chat_boosts200_response.rb +223 -0
- data/lib/telegram-bot/models/get_user_profile_photos200_response.rb +223 -0
- data/lib/telegram-bot/models/get_webhook_info200_response.rb +223 -0
- data/lib/telegram-bot/models/giveaway.rb +311 -0
- data/lib/telegram-bot/models/giveaway_completed.rb +243 -0
- data/lib/telegram-bot/models/giveaway_winners.rb +353 -0
- data/lib/telegram-bot/models/inaccessible_message.rb +257 -0
- data/lib/telegram-bot/models/inline_keyboard_button.rb +313 -0
- data/lib/telegram-bot/models/inline_keyboard_markup.rb +225 -0
- data/lib/telegram-bot/models/inline_query.rb +294 -0
- data/lib/telegram-bot/models/inline_query_result_article.rb +344 -0
- data/lib/telegram-bot/models/inline_query_result_audio.rb +346 -0
- data/lib/telegram-bot/models/inline_query_result_cached_audio.rb +309 -0
- data/lib/telegram-bot/models/inline_query_result_cached_document.rb +336 -0
- data/lib/telegram-bot/models/inline_query_result_cached_gif.rb +319 -0
- data/lib/telegram-bot/models/inline_query_result_cached_mpeg4_gif.rb +319 -0
- data/lib/telegram-bot/models/inline_query_result_cached_photo.rb +329 -0
- data/lib/telegram-bot/models/inline_query_result_cached_sticker.rb +277 -0
- data/lib/telegram-bot/models/inline_query_result_cached_video.rb +336 -0
- data/lib/telegram-bot/models/inline_query_result_cached_voice.rb +326 -0
- data/lib/telegram-bot/models/inline_query_result_contact.rb +344 -0
- data/lib/telegram-bot/models/inline_query_result_document.rb +383 -0
- data/lib/telegram-bot/models/inline_query_result_game.rb +267 -0
- data/lib/telegram-bot/models/inline_query_result_gif.rb +376 -0
- data/lib/telegram-bot/models/inline_query_result_location.rb +381 -0
- data/lib/telegram-bot/models/inline_query_result_mpeg4_gif.rb +376 -0
- data/lib/telegram-bot/models/inline_query_result_photo.rb +366 -0
- data/lib/telegram-bot/models/inline_query_result_venue.rb +398 -0
- data/lib/telegram-bot/models/inline_query_result_video.rb +400 -0
- data/lib/telegram-bot/models/inline_query_result_voice.rb +336 -0
- data/lib/telegram-bot/models/inline_query_results_button.rb +243 -0
- data/lib/telegram-bot/models/input_contact_message_content.rb +260 -0
- data/lib/telegram-bot/models/input_invoice_message_content.rb +452 -0
- data/lib/telegram-bot/models/input_location_message_content.rb +280 -0
- data/lib/telegram-bot/models/input_media_animation.rb +324 -0
- data/lib/telegram-bot/models/input_media_audio.rb +314 -0
- data/lib/telegram-bot/models/input_media_document.rb +294 -0
- data/lib/telegram-bot/models/input_media_photo.rb +282 -0
- data/lib/telegram-bot/models/input_media_video.rb +334 -0
- data/lib/telegram-bot/models/input_sticker.rb +283 -0
- data/lib/telegram-bot/models/input_text_message_content.rb +255 -0
- data/lib/telegram-bot/models/input_venue_message_content.rb +314 -0
- data/lib/telegram-bot/models/invoice.rb +291 -0
- data/lib/telegram-bot/models/keyboard_button.rb +283 -0
- data/lib/telegram-bot/models/keyboard_button_poll_type.rb +216 -0
- data/lib/telegram-bot/models/keyboard_button_request_chat.rb +330 -0
- data/lib/telegram-bot/models/keyboard_button_request_users.rb +283 -0
- data/lib/telegram-bot/models/labeled_price.rb +240 -0
- data/lib/telegram-bot/models/link_preview_options.rb +256 -0
- data/lib/telegram-bot/models/location.rb +280 -0
- data/lib/telegram-bot/models/login_url.rb +253 -0
- data/lib/telegram-bot/models/mask_position.rb +274 -0
- data/lib/telegram-bot/models/menu_button_commands.rb +223 -0
- data/lib/telegram-bot/models/menu_button_default.rb +223 -0
- data/lib/telegram-bot/models/menu_button_web_app.rb +257 -0
- data/lib/telegram-bot/models/message.rb +1037 -0
- data/lib/telegram-bot/models/message_auto_delete_timer_changed.rb +223 -0
- data/lib/telegram-bot/models/message_entity.rb +297 -0
- data/lib/telegram-bot/models/message_id.rb +223 -0
- data/lib/telegram-bot/models/message_origin_channel.rb +284 -0
- data/lib/telegram-bot/models/message_origin_chat.rb +267 -0
- data/lib/telegram-bot/models/message_origin_hidden_user.rb +257 -0
- data/lib/telegram-bot/models/message_origin_user.rb +257 -0
- data/lib/telegram-bot/models/message_reaction_count_updated.rb +276 -0
- data/lib/telegram-bot/models/message_reaction_updated.rb +315 -0
- data/lib/telegram-bot/models/order_info.rb +246 -0
- data/lib/telegram-bot/models/passport_data.rb +242 -0
- data/lib/telegram-bot/models/passport_element_error_data_field.rb +291 -0
- data/lib/telegram-bot/models/passport_element_error_file.rb +274 -0
- data/lib/telegram-bot/models/passport_element_error_files.rb +276 -0
- data/lib/telegram-bot/models/passport_element_error_front_side.rb +274 -0
- data/lib/telegram-bot/models/passport_element_error_reverse_side.rb +274 -0
- data/lib/telegram-bot/models/passport_element_error_selfie.rb +274 -0
- data/lib/telegram-bot/models/passport_element_error_translation_file.rb +274 -0
- data/lib/telegram-bot/models/passport_element_error_translation_files.rb +276 -0
- data/lib/telegram-bot/models/passport_element_error_unspecified.rb +274 -0
- data/lib/telegram-bot/models/passport_file.rb +274 -0
- data/lib/telegram-bot/models/photo_size.rb +284 -0
- data/lib/telegram-bot/models/poll.rb +396 -0
- data/lib/telegram-bot/models/poll_answer.rb +262 -0
- data/lib/telegram-bot/models/poll_option.rb +240 -0
- data/lib/telegram-bot/models/pre_checkout_query.rb +311 -0
- data/lib/telegram-bot/models/proximity_alert_triggered.rb +257 -0
- data/lib/telegram-bot/models/reaction_count.rb +240 -0
- data/lib/telegram-bot/models/reaction_type_custom_emoji.rb +240 -0
- data/lib/telegram-bot/models/reaction_type_emoji.rb +240 -0
- data/lib/telegram-bot/models/reply_keyboard_markup.rb +275 -0
- data/lib/telegram-bot/models/reply_keyboard_remove.rb +233 -0
- data/lib/telegram-bot/models/reply_parameters.rb +287 -0
- data/lib/telegram-bot/models/response_parameters.rb +226 -0
- data/lib/telegram-bot/models/send_media_group200_response.rb +225 -0
- data/lib/telegram-bot/models/send_media_group_media_parameter_value.rb +107 -0
- data/lib/telegram-bot/models/send_message200_response.rb +223 -0
- data/lib/telegram-bot/models/send_message_chat_id_parameter_value.rb +105 -0
- data/lib/telegram-bot/models/send_message_reply_markup_parameter_value.rb +107 -0
- data/lib/telegram-bot/models/send_photo_photo_parameter_value.rb +105 -0
- data/lib/telegram-bot/models/sent_web_app_message.rb +216 -0
- data/lib/telegram-bot/models/set_webhook200_response.rb +223 -0
- data/lib/telegram-bot/models/shared_user.rb +265 -0
- data/lib/telegram-bot/models/shipping_address.rb +308 -0
- data/lib/telegram-bot/models/shipping_option.rb +259 -0
- data/lib/telegram-bot/models/shipping_query.rb +274 -0
- data/lib/telegram-bot/models/sticker.rb +405 -0
- data/lib/telegram-bot/models/sticker_set.rb +286 -0
- data/lib/telegram-bot/models/stop_poll200_response.rb +223 -0
- data/lib/telegram-bot/models/story.rb +240 -0
- data/lib/telegram-bot/models/successful_payment.rb +311 -0
- data/lib/telegram-bot/models/switch_inline_query_chosen_chat.rb +256 -0
- data/lib/telegram-bot/models/text_quote.rb +262 -0
- data/lib/telegram-bot/models/update.rb +443 -0
- data/lib/telegram-bot/models/user.rb +347 -0
- data/lib/telegram-bot/models/user_chat_boosts.rb +225 -0
- data/lib/telegram-bot/models/user_profile_photos.rb +242 -0
- data/lib/telegram-bot/models/users_shared.rb +242 -0
- data/lib/telegram-bot/models/venue.rb +297 -0
- data/lib/telegram-bot/models/video.rb +331 -0
- data/lib/telegram-bot/models/video_chat_ended.rb +223 -0
- data/lib/telegram-bot/models/video_chat_participants_invited.rb +225 -0
- data/lib/telegram-bot/models/video_chat_scheduled.rb +223 -0
- data/lib/telegram-bot/models/video_note.rb +294 -0
- data/lib/telegram-bot/models/voice.rb +277 -0
- data/lib/telegram-bot/models/web_app_data.rb +240 -0
- data/lib/telegram-bot/models/web_app_info.rb +223 -0
- data/lib/telegram-bot/models/webhook_info.rb +319 -0
- data/lib/telegram-bot/models/write_access_allowed.rb +236 -0
- data/lib/telegram-bot/version.rb +15 -0
- data/lib/telegram-bot.rb +248 -0
- data/spec/api/default_api_spec.rb +1904 -0
- data/spec/models/animation_spec.rb +84 -0
- data/spec/models/answer_web_app_query200_response_spec.rb +42 -0
- data/spec/models/audio_spec.rb +84 -0
- data/spec/models/birthdate_spec.rb +48 -0
- data/spec/models/bot_command_scope_all_chat_administrators_spec.rb +36 -0
- data/spec/models/bot_command_scope_all_group_chats_spec.rb +36 -0
- data/spec/models/bot_command_scope_all_private_chats_spec.rb +36 -0
- data/spec/models/bot_command_scope_chat_administrators_spec.rb +42 -0
- data/spec/models/bot_command_scope_chat_member_spec.rb +48 -0
- data/spec/models/bot_command_scope_chat_spec.rb +42 -0
- data/spec/models/bot_command_scope_default_spec.rb +36 -0
- data/spec/models/bot_command_spec.rb +42 -0
- data/spec/models/bot_description_spec.rb +36 -0
- data/spec/models/bot_name_spec.rb +36 -0
- data/spec/models/bot_short_description_spec.rb +36 -0
- data/spec/models/business_connection_spec.rb +66 -0
- data/spec/models/business_intro_spec.rb +48 -0
- data/spec/models/business_location_spec.rb +42 -0
- data/spec/models/business_messages_deleted_spec.rb +48 -0
- data/spec/models/business_opening_hours_interval_spec.rb +42 -0
- data/spec/models/business_opening_hours_spec.rb +42 -0
- data/spec/models/callback_query_spec.rb +72 -0
- data/spec/models/chat_administrator_rights_spec.rb +120 -0
- data/spec/models/chat_boost_added_spec.rb +36 -0
- data/spec/models/chat_boost_removed_spec.rb +54 -0
- data/spec/models/chat_boost_source_gift_code_spec.rb +42 -0
- data/spec/models/chat_boost_source_giveaway_spec.rb +54 -0
- data/spec/models/chat_boost_source_premium_spec.rb +42 -0
- data/spec/models/chat_boost_spec.rb +54 -0
- data/spec/models/chat_boost_updated_spec.rb +42 -0
- data/spec/models/chat_invite_link_spec.rb +84 -0
- data/spec/models/chat_join_request_spec.rb +66 -0
- data/spec/models/chat_location_spec.rb +42 -0
- data/spec/models/chat_member_administrator_spec.rb +144 -0
- data/spec/models/chat_member_banned_spec.rb +48 -0
- data/spec/models/chat_member_left_spec.rb +42 -0
- data/spec/models/chat_member_member_spec.rb +42 -0
- data/spec/models/chat_member_owner_spec.rb +54 -0
- data/spec/models/chat_member_restricted_spec.rb +138 -0
- data/spec/models/chat_member_updated_spec.rb +72 -0
- data/spec/models/chat_permissions_spec.rb +114 -0
- data/spec/models/chat_photo_spec.rb +54 -0
- data/spec/models/chat_shared_spec.rb +60 -0
- data/spec/models/chat_spec.rb +282 -0
- data/spec/models/chosen_inline_result_spec.rb +60 -0
- data/spec/models/contact_spec.rb +60 -0
- data/spec/models/copy_message200_response_spec.rb +42 -0
- data/spec/models/create_chat_invite_link200_response_spec.rb +42 -0
- data/spec/models/create_forum_topic200_response_spec.rb +42 -0
- data/spec/models/dice_spec.rb +42 -0
- data/spec/models/document_spec.rb +66 -0
- data/spec/models/edit_message_text200_response_result_value_spec.rb +32 -0
- data/spec/models/edit_message_text200_response_spec.rb +42 -0
- data/spec/models/encrypted_credentials_spec.rb +48 -0
- data/spec/models/encrypted_passport_element_spec.rb +90 -0
- data/spec/models/export_chat_invite_link200_response_spec.rb +42 -0
- data/spec/models/external_reply_info_spec.rb +168 -0
- data/spec/models/file_spec.rb +54 -0
- data/spec/models/force_reply_spec.rb +48 -0
- data/spec/models/forum_topic_created_spec.rb +48 -0
- data/spec/models/forum_topic_edited_spec.rb +42 -0
- data/spec/models/forum_topic_spec.rb +54 -0
- data/spec/models/forward_messages200_response_spec.rb +42 -0
- data/spec/models/game_high_score_spec.rb +48 -0
- data/spec/models/game_spec.rb +66 -0
- data/spec/models/get_business_connection200_response_spec.rb +42 -0
- data/spec/models/get_chat200_response_spec.rb +42 -0
- data/spec/models/get_chat_administrators200_response_spec.rb +42 -0
- data/spec/models/get_chat_member200_response_spec.rb +42 -0
- data/spec/models/get_chat_member_count200_response_spec.rb +42 -0
- data/spec/models/get_chat_menu_button200_response_spec.rb +42 -0
- data/spec/models/get_file200_response_spec.rb +42 -0
- data/spec/models/get_forum_topic_icon_stickers200_response_spec.rb +42 -0
- data/spec/models/get_game_high_scores200_response_spec.rb +42 -0
- data/spec/models/get_me200_response_spec.rb +42 -0
- data/spec/models/get_my_commands200_response_spec.rb +42 -0
- data/spec/models/get_my_default_administrator_rights200_response_spec.rb +42 -0
- data/spec/models/get_my_description200_response_spec.rb +42 -0
- data/spec/models/get_my_name200_response_spec.rb +42 -0
- data/spec/models/get_my_short_description200_response_spec.rb +42 -0
- data/spec/models/get_sticker_set200_response_spec.rb +42 -0
- data/spec/models/get_updates200_response_spec.rb +42 -0
- data/spec/models/get_updates4_xx_response_spec.rb +48 -0
- data/spec/models/get_user_chat_boosts200_response_spec.rb +42 -0
- data/spec/models/get_user_profile_photos200_response_spec.rb +42 -0
- data/spec/models/get_webhook_info200_response_spec.rb +42 -0
- data/spec/models/giveaway_completed_spec.rb +48 -0
- data/spec/models/giveaway_spec.rb +78 -0
- data/spec/models/giveaway_winners_spec.rb +96 -0
- data/spec/models/inaccessible_message_spec.rb +48 -0
- data/spec/models/inline_keyboard_button_spec.rb +90 -0
- data/spec/models/inline_keyboard_markup_spec.rb +36 -0
- data/spec/models/inline_query_result_article_spec.rb +96 -0
- data/spec/models/inline_query_result_audio_spec.rb +96 -0
- data/spec/models/inline_query_result_cached_audio_spec.rb +78 -0
- data/spec/models/inline_query_result_cached_document_spec.rb +90 -0
- data/spec/models/inline_query_result_cached_gif_spec.rb +84 -0
- data/spec/models/inline_query_result_cached_mpeg4_gif_spec.rb +84 -0
- data/spec/models/inline_query_result_cached_photo_spec.rb +90 -0
- data/spec/models/inline_query_result_cached_sticker_spec.rb +60 -0
- data/spec/models/inline_query_result_cached_video_spec.rb +90 -0
- data/spec/models/inline_query_result_cached_voice_spec.rb +84 -0
- data/spec/models/inline_query_result_contact_spec.rb +96 -0
- data/spec/models/inline_query_result_document_spec.rb +114 -0
- data/spec/models/inline_query_result_game_spec.rb +54 -0
- data/spec/models/inline_query_result_gif_spec.rb +114 -0
- data/spec/models/inline_query_result_location_spec.rb +114 -0
- data/spec/models/inline_query_result_mpeg4_gif_spec.rb +114 -0
- data/spec/models/inline_query_result_photo_spec.rb +108 -0
- data/spec/models/inline_query_result_venue_spec.rb +120 -0
- data/spec/models/inline_query_result_video_spec.rb +120 -0
- data/spec/models/inline_query_result_voice_spec.rb +90 -0
- data/spec/models/inline_query_results_button_spec.rb +48 -0
- data/spec/models/inline_query_spec.rb +66 -0
- data/spec/models/input_contact_message_content_spec.rb +54 -0
- data/spec/models/input_invoice_message_content_spec.rb +150 -0
- data/spec/models/input_location_message_content_spec.rb +66 -0
- data/spec/models/input_media_animation_spec.rb +90 -0
- data/spec/models/input_media_audio_spec.rb +84 -0
- data/spec/models/input_media_document_spec.rb +72 -0
- data/spec/models/input_media_photo_spec.rb +66 -0
- data/spec/models/input_media_video_spec.rb +96 -0
- data/spec/models/input_sticker_spec.rb +60 -0
- data/spec/models/input_text_message_content_spec.rb +54 -0
- data/spec/models/input_venue_message_content_spec.rb +78 -0
- data/spec/models/invoice_spec.rb +60 -0
- data/spec/models/keyboard_button_poll_type_spec.rb +36 -0
- data/spec/models/keyboard_button_request_chat_spec.rb +96 -0
- data/spec/models/keyboard_button_request_users_spec.rb +72 -0
- data/spec/models/keyboard_button_spec.rb +72 -0
- data/spec/models/labeled_price_spec.rb +42 -0
- data/spec/models/link_preview_options_spec.rb +60 -0
- data/spec/models/location_spec.rb +66 -0
- data/spec/models/login_url_spec.rb +54 -0
- data/spec/models/mask_position_spec.rb +54 -0
- data/spec/models/menu_button_commands_spec.rb +36 -0
- data/spec/models/menu_button_default_spec.rb +36 -0
- data/spec/models/menu_button_web_app_spec.rb +48 -0
- data/spec/models/message_auto_delete_timer_changed_spec.rb +36 -0
- data/spec/models/message_entity_spec.rb +72 -0
- data/spec/models/message_id_spec.rb +36 -0
- data/spec/models/message_origin_channel_spec.rb +60 -0
- data/spec/models/message_origin_chat_spec.rb +54 -0
- data/spec/models/message_origin_hidden_user_spec.rb +48 -0
- data/spec/models/message_origin_user_spec.rb +48 -0
- data/spec/models/message_reaction_count_updated_spec.rb +54 -0
- data/spec/models/message_reaction_updated_spec.rb +72 -0
- data/spec/models/message_spec.rb +510 -0
- data/spec/models/order_info_spec.rb +54 -0
- data/spec/models/passport_data_spec.rb +42 -0
- data/spec/models/passport_element_error_data_field_spec.rb +60 -0
- data/spec/models/passport_element_error_file_spec.rb +54 -0
- data/spec/models/passport_element_error_files_spec.rb +54 -0
- data/spec/models/passport_element_error_front_side_spec.rb +54 -0
- data/spec/models/passport_element_error_reverse_side_spec.rb +54 -0
- data/spec/models/passport_element_error_selfie_spec.rb +54 -0
- data/spec/models/passport_element_error_translation_file_spec.rb +54 -0
- data/spec/models/passport_element_error_translation_files_spec.rb +54 -0
- data/spec/models/passport_element_error_unspecified_spec.rb +54 -0
- data/spec/models/passport_file_spec.rb +54 -0
- data/spec/models/photo_size_spec.rb +60 -0
- data/spec/models/poll_answer_spec.rb +54 -0
- data/spec/models/poll_option_spec.rb +42 -0
- data/spec/models/poll_spec.rb +108 -0
- data/spec/models/pre_checkout_query_spec.rb +72 -0
- data/spec/models/proximity_alert_triggered_spec.rb +48 -0
- data/spec/models/reaction_count_spec.rb +42 -0
- data/spec/models/reaction_type_custom_emoji_spec.rb +42 -0
- data/spec/models/reaction_type_emoji_spec.rb +42 -0
- data/spec/models/reply_keyboard_markup_spec.rb +66 -0
- data/spec/models/reply_keyboard_remove_spec.rb +42 -0
- data/spec/models/reply_parameters_spec.rb +72 -0
- data/spec/models/response_parameters_spec.rb +42 -0
- data/spec/models/send_media_group200_response_spec.rb +42 -0
- data/spec/models/send_media_group_media_parameter_value_spec.rb +32 -0
- data/spec/models/send_message200_response_spec.rb +42 -0
- data/spec/models/send_message_chat_id_parameter_value_spec.rb +32 -0
- data/spec/models/send_message_reply_markup_parameter_value_spec.rb +32 -0
- data/spec/models/send_photo_photo_parameter_value_spec.rb +32 -0
- data/spec/models/sent_web_app_message_spec.rb +36 -0
- data/spec/models/set_webhook200_response_spec.rb +42 -0
- data/spec/models/shared_user_spec.rb +60 -0
- data/spec/models/shipping_address_spec.rb +66 -0
- data/spec/models/shipping_option_spec.rb +48 -0
- data/spec/models/shipping_query_spec.rb +54 -0
- data/spec/models/sticker_set_spec.rb +60 -0
- data/spec/models/sticker_spec.rb +120 -0
- data/spec/models/stop_poll200_response_spec.rb +42 -0
- data/spec/models/story_spec.rb +42 -0
- data/spec/models/successful_payment_spec.rb +72 -0
- data/spec/models/switch_inline_query_chosen_chat_spec.rb +60 -0
- data/spec/models/text_quote_spec.rb +54 -0
- data/spec/models/update_spec.rb +168 -0
- data/spec/models/user_chat_boosts_spec.rb +36 -0
- data/spec/models/user_profile_photos_spec.rb +42 -0
- data/spec/models/user_spec.rb +102 -0
- data/spec/models/users_shared_spec.rb +42 -0
- data/spec/models/venue_spec.rb +72 -0
- data/spec/models/video_chat_ended_spec.rb +36 -0
- data/spec/models/video_chat_participants_invited_spec.rb +36 -0
- data/spec/models/video_chat_scheduled_spec.rb +36 -0
- data/spec/models/video_note_spec.rb +66 -0
- data/spec/models/video_spec.rb +84 -0
- data/spec/models/voice_spec.rb +60 -0
- data/spec/models/web_app_data_spec.rb +42 -0
- data/spec/models/web_app_info_spec.rb +36 -0
- data/spec/models/webhook_info_spec.rb +84 -0
- data/spec/models/write_access_allowed_spec.rb +48 -0
- data/spec/spec_helper.rb +111 -0
- data/telegram-bot-7.2.0.gem +0 -0
- data/telegram-bot-openapi-7.2.0.gem +0 -0
- data/telegram-bot.gemspec +40 -0
- metadata +934 -0
@@ -0,0 +1,260 @@
|
|
1
|
+
=begin
|
2
|
+
#telegram-bot-api
|
3
|
+
|
4
|
+
#Unofficial telegram-bot-api OpenAPI spec. Generated from the Bot API docs at https://core.telegram.org/bots/api
|
5
|
+
|
6
|
+
The version of the OpenAPI document: Bot API 7.2
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.7.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module TelegramBot
|
17
|
+
# Represents the content of a contact message to be sent as the result of an inline query.
|
18
|
+
class InputContactMessageContent
|
19
|
+
# Contact's phone number
|
20
|
+
attr_accessor :phone_number
|
21
|
+
|
22
|
+
# Contact's first name
|
23
|
+
attr_accessor :first_name
|
24
|
+
|
25
|
+
# Optional. Contact's last name
|
26
|
+
attr_accessor :last_name
|
27
|
+
|
28
|
+
# Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes
|
29
|
+
attr_accessor :vcard
|
30
|
+
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
32
|
+
def self.attribute_map
|
33
|
+
{
|
34
|
+
:'phone_number' => :'phone_number',
|
35
|
+
:'first_name' => :'first_name',
|
36
|
+
:'last_name' => :'last_name',
|
37
|
+
:'vcard' => :'vcard'
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
# Returns all the JSON keys this model knows about
|
42
|
+
def self.acceptable_attributes
|
43
|
+
attribute_map.values
|
44
|
+
end
|
45
|
+
|
46
|
+
# Attribute type mapping.
|
47
|
+
def self.openapi_types
|
48
|
+
{
|
49
|
+
:'phone_number' => :'String',
|
50
|
+
:'first_name' => :'String',
|
51
|
+
:'last_name' => :'String',
|
52
|
+
:'vcard' => :'String'
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
# List of attributes with nullable: true
|
57
|
+
def self.openapi_nullable
|
58
|
+
Set.new([
|
59
|
+
])
|
60
|
+
end
|
61
|
+
|
62
|
+
# Initializes the object
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
64
|
+
def initialize(attributes = {})
|
65
|
+
if (!attributes.is_a?(Hash))
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TelegramBot::InputContactMessageContent` initialize method"
|
67
|
+
end
|
68
|
+
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
71
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TelegramBot::InputContactMessageContent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
73
|
+
end
|
74
|
+
h[k.to_sym] = v
|
75
|
+
}
|
76
|
+
|
77
|
+
if attributes.key?(:'phone_number')
|
78
|
+
self.phone_number = attributes[:'phone_number']
|
79
|
+
else
|
80
|
+
self.phone_number = nil
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.key?(:'first_name')
|
84
|
+
self.first_name = attributes[:'first_name']
|
85
|
+
else
|
86
|
+
self.first_name = nil
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.key?(:'last_name')
|
90
|
+
self.last_name = attributes[:'last_name']
|
91
|
+
end
|
92
|
+
|
93
|
+
if attributes.key?(:'vcard')
|
94
|
+
self.vcard = attributes[:'vcard']
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
99
|
+
# @return Array for valid properties with the reasons
|
100
|
+
def list_invalid_properties
|
101
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
102
|
+
invalid_properties = Array.new
|
103
|
+
if @phone_number.nil?
|
104
|
+
invalid_properties.push('invalid value for "phone_number", phone_number cannot be nil.')
|
105
|
+
end
|
106
|
+
|
107
|
+
if @first_name.nil?
|
108
|
+
invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
|
109
|
+
end
|
110
|
+
|
111
|
+
invalid_properties
|
112
|
+
end
|
113
|
+
|
114
|
+
# Check to see if the all the properties in the model are valid
|
115
|
+
# @return true if the model is valid
|
116
|
+
def valid?
|
117
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
118
|
+
return false if @phone_number.nil?
|
119
|
+
return false if @first_name.nil?
|
120
|
+
true
|
121
|
+
end
|
122
|
+
|
123
|
+
# Checks equality by comparing each attribute.
|
124
|
+
# @param [Object] Object to be compared
|
125
|
+
def ==(o)
|
126
|
+
return true if self.equal?(o)
|
127
|
+
self.class == o.class &&
|
128
|
+
phone_number == o.phone_number &&
|
129
|
+
first_name == o.first_name &&
|
130
|
+
last_name == o.last_name &&
|
131
|
+
vcard == o.vcard
|
132
|
+
end
|
133
|
+
|
134
|
+
# @see the `==` method
|
135
|
+
# @param [Object] Object to be compared
|
136
|
+
def eql?(o)
|
137
|
+
self == o
|
138
|
+
end
|
139
|
+
|
140
|
+
# Calculates hash code according to all attributes.
|
141
|
+
# @return [Integer] Hash code
|
142
|
+
def hash
|
143
|
+
[phone_number, first_name, last_name, vcard].hash
|
144
|
+
end
|
145
|
+
|
146
|
+
# Builds the object from hash
|
147
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
148
|
+
# @return [Object] Returns the model itself
|
149
|
+
def self.build_from_hash(attributes)
|
150
|
+
return nil unless attributes.is_a?(Hash)
|
151
|
+
attributes = attributes.transform_keys(&:to_sym)
|
152
|
+
transformed_hash = {}
|
153
|
+
openapi_types.each_pair do |key, type|
|
154
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
155
|
+
transformed_hash["#{key}"] = nil
|
156
|
+
elsif type =~ /\AArray<(.*)>/i
|
157
|
+
# check to ensure the input is an array given that the attribute
|
158
|
+
# is documented as an array but the input is not
|
159
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
160
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
161
|
+
end
|
162
|
+
elsif !attributes[attribute_map[key]].nil?
|
163
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
164
|
+
end
|
165
|
+
end
|
166
|
+
new(transformed_hash)
|
167
|
+
end
|
168
|
+
|
169
|
+
# Deserializes the data based on type
|
170
|
+
# @param string type Data type
|
171
|
+
# @param string value Value to be deserialized
|
172
|
+
# @return [Object] Deserialized data
|
173
|
+
def self._deserialize(type, value)
|
174
|
+
case type.to_sym
|
175
|
+
when :Time
|
176
|
+
Time.parse(value)
|
177
|
+
when :Date
|
178
|
+
Date.parse(value)
|
179
|
+
when :String
|
180
|
+
value.to_s
|
181
|
+
when :Integer
|
182
|
+
value.to_i
|
183
|
+
when :Float
|
184
|
+
value.to_f
|
185
|
+
when :Boolean
|
186
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
187
|
+
true
|
188
|
+
else
|
189
|
+
false
|
190
|
+
end
|
191
|
+
when :Object
|
192
|
+
# generic object (usually a Hash), return directly
|
193
|
+
value
|
194
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
195
|
+
inner_type = Regexp.last_match[:inner_type]
|
196
|
+
value.map { |v| _deserialize(inner_type, v) }
|
197
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
198
|
+
k_type = Regexp.last_match[:k_type]
|
199
|
+
v_type = Regexp.last_match[:v_type]
|
200
|
+
{}.tap do |hash|
|
201
|
+
value.each do |k, v|
|
202
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
203
|
+
end
|
204
|
+
end
|
205
|
+
else # model
|
206
|
+
# models (e.g. Pet) or oneOf
|
207
|
+
klass = TelegramBot.const_get(type)
|
208
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
209
|
+
end
|
210
|
+
end
|
211
|
+
|
212
|
+
# Returns the string representation of the object
|
213
|
+
# @return [String] String presentation of the object
|
214
|
+
def to_s
|
215
|
+
to_hash.to_s
|
216
|
+
end
|
217
|
+
|
218
|
+
# to_body is an alias to to_hash (backward compatibility)
|
219
|
+
# @return [Hash] Returns the object in the form of hash
|
220
|
+
def to_body
|
221
|
+
to_hash
|
222
|
+
end
|
223
|
+
|
224
|
+
# Returns the object in the form of hash
|
225
|
+
# @return [Hash] Returns the object in the form of hash
|
226
|
+
def to_hash
|
227
|
+
hash = {}
|
228
|
+
self.class.attribute_map.each_pair do |attr, param|
|
229
|
+
value = self.send(attr)
|
230
|
+
if value.nil?
|
231
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
232
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
233
|
+
end
|
234
|
+
|
235
|
+
hash[param] = _to_hash(value)
|
236
|
+
end
|
237
|
+
hash
|
238
|
+
end
|
239
|
+
|
240
|
+
# Outputs non-array value in the form of hash
|
241
|
+
# For object, use to_hash. Otherwise, just return the value
|
242
|
+
# @param [Object] value Any valid value
|
243
|
+
# @return [Hash] Returns the value in the form of hash
|
244
|
+
def _to_hash(value)
|
245
|
+
if value.is_a?(Array)
|
246
|
+
value.compact.map { |v| _to_hash(v) }
|
247
|
+
elsif value.is_a?(Hash)
|
248
|
+
{}.tap do |hash|
|
249
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
250
|
+
end
|
251
|
+
elsif value.respond_to? :to_hash
|
252
|
+
value.to_hash
|
253
|
+
else
|
254
|
+
value
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
end
|
259
|
+
|
260
|
+
end
|
@@ -0,0 +1,452 @@
|
|
1
|
+
=begin
|
2
|
+
#telegram-bot-api
|
3
|
+
|
4
|
+
#Unofficial telegram-bot-api OpenAPI spec. Generated from the Bot API docs at https://core.telegram.org/bots/api
|
5
|
+
|
6
|
+
The version of the OpenAPI document: Bot API 7.2
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.7.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module TelegramBot
|
17
|
+
# Represents the content of an invoice message to be sent as the result of an inline query.
|
18
|
+
class InputInvoiceMessageContent
|
19
|
+
# Product name, 1-32 characters
|
20
|
+
attr_accessor :title
|
21
|
+
|
22
|
+
# Product description, 1-255 characters
|
23
|
+
attr_accessor :description
|
24
|
+
|
25
|
+
# Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
|
26
|
+
attr_accessor :payload
|
27
|
+
|
28
|
+
# Payment provider token, obtained via @BotFather
|
29
|
+
attr_accessor :provider_token
|
30
|
+
|
31
|
+
# Three-letter ISO 4217 currency code, see more on currencies
|
32
|
+
attr_accessor :currency
|
33
|
+
|
34
|
+
# Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
|
35
|
+
attr_accessor :prices
|
36
|
+
|
37
|
+
# Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0
|
38
|
+
attr_accessor :max_tip_amount
|
39
|
+
|
40
|
+
# Optional. A JSON-serialized array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.
|
41
|
+
attr_accessor :suggested_tip_amounts
|
42
|
+
|
43
|
+
# Optional. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider.
|
44
|
+
attr_accessor :provider_data
|
45
|
+
|
46
|
+
# Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service.
|
47
|
+
attr_accessor :photo_url
|
48
|
+
|
49
|
+
# Optional. Photo size in bytes
|
50
|
+
attr_accessor :photo_size
|
51
|
+
|
52
|
+
# Optional. Photo width
|
53
|
+
attr_accessor :photo_width
|
54
|
+
|
55
|
+
# Optional. Photo height
|
56
|
+
attr_accessor :photo_height
|
57
|
+
|
58
|
+
# Optional. Pass True if you require the user's full name to complete the order
|
59
|
+
attr_accessor :need_name
|
60
|
+
|
61
|
+
# Optional. Pass True if you require the user's phone number to complete the order
|
62
|
+
attr_accessor :need_phone_number
|
63
|
+
|
64
|
+
# Optional. Pass True if you require the user's email address to complete the order
|
65
|
+
attr_accessor :need_email
|
66
|
+
|
67
|
+
# Optional. Pass True if you require the user's shipping address to complete the order
|
68
|
+
attr_accessor :need_shipping_address
|
69
|
+
|
70
|
+
# Optional. Pass True if the user's phone number should be sent to provider
|
71
|
+
attr_accessor :send_phone_number_to_provider
|
72
|
+
|
73
|
+
# Optional. Pass True if the user's email address should be sent to provider
|
74
|
+
attr_accessor :send_email_to_provider
|
75
|
+
|
76
|
+
# Optional. Pass True if the final price depends on the shipping method
|
77
|
+
attr_accessor :is_flexible
|
78
|
+
|
79
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
80
|
+
def self.attribute_map
|
81
|
+
{
|
82
|
+
:'title' => :'title',
|
83
|
+
:'description' => :'description',
|
84
|
+
:'payload' => :'payload',
|
85
|
+
:'provider_token' => :'provider_token',
|
86
|
+
:'currency' => :'currency',
|
87
|
+
:'prices' => :'prices',
|
88
|
+
:'max_tip_amount' => :'max_tip_amount',
|
89
|
+
:'suggested_tip_amounts' => :'suggested_tip_amounts',
|
90
|
+
:'provider_data' => :'provider_data',
|
91
|
+
:'photo_url' => :'photo_url',
|
92
|
+
:'photo_size' => :'photo_size',
|
93
|
+
:'photo_width' => :'photo_width',
|
94
|
+
:'photo_height' => :'photo_height',
|
95
|
+
:'need_name' => :'need_name',
|
96
|
+
:'need_phone_number' => :'need_phone_number',
|
97
|
+
:'need_email' => :'need_email',
|
98
|
+
:'need_shipping_address' => :'need_shipping_address',
|
99
|
+
:'send_phone_number_to_provider' => :'send_phone_number_to_provider',
|
100
|
+
:'send_email_to_provider' => :'send_email_to_provider',
|
101
|
+
:'is_flexible' => :'is_flexible'
|
102
|
+
}
|
103
|
+
end
|
104
|
+
|
105
|
+
# Returns all the JSON keys this model knows about
|
106
|
+
def self.acceptable_attributes
|
107
|
+
attribute_map.values
|
108
|
+
end
|
109
|
+
|
110
|
+
# Attribute type mapping.
|
111
|
+
def self.openapi_types
|
112
|
+
{
|
113
|
+
:'title' => :'String',
|
114
|
+
:'description' => :'String',
|
115
|
+
:'payload' => :'String',
|
116
|
+
:'provider_token' => :'String',
|
117
|
+
:'currency' => :'String',
|
118
|
+
:'prices' => :'Array<LabeledPrice>',
|
119
|
+
:'max_tip_amount' => :'Integer',
|
120
|
+
:'suggested_tip_amounts' => :'Array<Integer>',
|
121
|
+
:'provider_data' => :'String',
|
122
|
+
:'photo_url' => :'String',
|
123
|
+
:'photo_size' => :'Integer',
|
124
|
+
:'photo_width' => :'Integer',
|
125
|
+
:'photo_height' => :'Integer',
|
126
|
+
:'need_name' => :'Boolean',
|
127
|
+
:'need_phone_number' => :'Boolean',
|
128
|
+
:'need_email' => :'Boolean',
|
129
|
+
:'need_shipping_address' => :'Boolean',
|
130
|
+
:'send_phone_number_to_provider' => :'Boolean',
|
131
|
+
:'send_email_to_provider' => :'Boolean',
|
132
|
+
:'is_flexible' => :'Boolean'
|
133
|
+
}
|
134
|
+
end
|
135
|
+
|
136
|
+
# List of attributes with nullable: true
|
137
|
+
def self.openapi_nullable
|
138
|
+
Set.new([
|
139
|
+
])
|
140
|
+
end
|
141
|
+
|
142
|
+
# Initializes the object
|
143
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
144
|
+
def initialize(attributes = {})
|
145
|
+
if (!attributes.is_a?(Hash))
|
146
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TelegramBot::InputInvoiceMessageContent` initialize method"
|
147
|
+
end
|
148
|
+
|
149
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
150
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
151
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
152
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TelegramBot::InputInvoiceMessageContent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
153
|
+
end
|
154
|
+
h[k.to_sym] = v
|
155
|
+
}
|
156
|
+
|
157
|
+
if attributes.key?(:'title')
|
158
|
+
self.title = attributes[:'title']
|
159
|
+
else
|
160
|
+
self.title = nil
|
161
|
+
end
|
162
|
+
|
163
|
+
if attributes.key?(:'description')
|
164
|
+
self.description = attributes[:'description']
|
165
|
+
else
|
166
|
+
self.description = nil
|
167
|
+
end
|
168
|
+
|
169
|
+
if attributes.key?(:'payload')
|
170
|
+
self.payload = attributes[:'payload']
|
171
|
+
else
|
172
|
+
self.payload = nil
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.key?(:'provider_token')
|
176
|
+
self.provider_token = attributes[:'provider_token']
|
177
|
+
else
|
178
|
+
self.provider_token = nil
|
179
|
+
end
|
180
|
+
|
181
|
+
if attributes.key?(:'currency')
|
182
|
+
self.currency = attributes[:'currency']
|
183
|
+
else
|
184
|
+
self.currency = nil
|
185
|
+
end
|
186
|
+
|
187
|
+
if attributes.key?(:'prices')
|
188
|
+
if (value = attributes[:'prices']).is_a?(Array)
|
189
|
+
self.prices = value
|
190
|
+
end
|
191
|
+
else
|
192
|
+
self.prices = nil
|
193
|
+
end
|
194
|
+
|
195
|
+
if attributes.key?(:'max_tip_amount')
|
196
|
+
self.max_tip_amount = attributes[:'max_tip_amount']
|
197
|
+
end
|
198
|
+
|
199
|
+
if attributes.key?(:'suggested_tip_amounts')
|
200
|
+
if (value = attributes[:'suggested_tip_amounts']).is_a?(Array)
|
201
|
+
self.suggested_tip_amounts = value
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
if attributes.key?(:'provider_data')
|
206
|
+
self.provider_data = attributes[:'provider_data']
|
207
|
+
end
|
208
|
+
|
209
|
+
if attributes.key?(:'photo_url')
|
210
|
+
self.photo_url = attributes[:'photo_url']
|
211
|
+
end
|
212
|
+
|
213
|
+
if attributes.key?(:'photo_size')
|
214
|
+
self.photo_size = attributes[:'photo_size']
|
215
|
+
end
|
216
|
+
|
217
|
+
if attributes.key?(:'photo_width')
|
218
|
+
self.photo_width = attributes[:'photo_width']
|
219
|
+
end
|
220
|
+
|
221
|
+
if attributes.key?(:'photo_height')
|
222
|
+
self.photo_height = attributes[:'photo_height']
|
223
|
+
end
|
224
|
+
|
225
|
+
if attributes.key?(:'need_name')
|
226
|
+
self.need_name = attributes[:'need_name']
|
227
|
+
end
|
228
|
+
|
229
|
+
if attributes.key?(:'need_phone_number')
|
230
|
+
self.need_phone_number = attributes[:'need_phone_number']
|
231
|
+
end
|
232
|
+
|
233
|
+
if attributes.key?(:'need_email')
|
234
|
+
self.need_email = attributes[:'need_email']
|
235
|
+
end
|
236
|
+
|
237
|
+
if attributes.key?(:'need_shipping_address')
|
238
|
+
self.need_shipping_address = attributes[:'need_shipping_address']
|
239
|
+
end
|
240
|
+
|
241
|
+
if attributes.key?(:'send_phone_number_to_provider')
|
242
|
+
self.send_phone_number_to_provider = attributes[:'send_phone_number_to_provider']
|
243
|
+
end
|
244
|
+
|
245
|
+
if attributes.key?(:'send_email_to_provider')
|
246
|
+
self.send_email_to_provider = attributes[:'send_email_to_provider']
|
247
|
+
end
|
248
|
+
|
249
|
+
if attributes.key?(:'is_flexible')
|
250
|
+
self.is_flexible = attributes[:'is_flexible']
|
251
|
+
end
|
252
|
+
end
|
253
|
+
|
254
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
255
|
+
# @return Array for valid properties with the reasons
|
256
|
+
def list_invalid_properties
|
257
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
258
|
+
invalid_properties = Array.new
|
259
|
+
if @title.nil?
|
260
|
+
invalid_properties.push('invalid value for "title", title cannot be nil.')
|
261
|
+
end
|
262
|
+
|
263
|
+
if @description.nil?
|
264
|
+
invalid_properties.push('invalid value for "description", description cannot be nil.')
|
265
|
+
end
|
266
|
+
|
267
|
+
if @payload.nil?
|
268
|
+
invalid_properties.push('invalid value for "payload", payload cannot be nil.')
|
269
|
+
end
|
270
|
+
|
271
|
+
if @provider_token.nil?
|
272
|
+
invalid_properties.push('invalid value for "provider_token", provider_token cannot be nil.')
|
273
|
+
end
|
274
|
+
|
275
|
+
if @currency.nil?
|
276
|
+
invalid_properties.push('invalid value for "currency", currency cannot be nil.')
|
277
|
+
end
|
278
|
+
|
279
|
+
if @prices.nil?
|
280
|
+
invalid_properties.push('invalid value for "prices", prices cannot be nil.')
|
281
|
+
end
|
282
|
+
|
283
|
+
invalid_properties
|
284
|
+
end
|
285
|
+
|
286
|
+
# Check to see if the all the properties in the model are valid
|
287
|
+
# @return true if the model is valid
|
288
|
+
def valid?
|
289
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
290
|
+
return false if @title.nil?
|
291
|
+
return false if @description.nil?
|
292
|
+
return false if @payload.nil?
|
293
|
+
return false if @provider_token.nil?
|
294
|
+
return false if @currency.nil?
|
295
|
+
return false if @prices.nil?
|
296
|
+
true
|
297
|
+
end
|
298
|
+
|
299
|
+
# Checks equality by comparing each attribute.
|
300
|
+
# @param [Object] Object to be compared
|
301
|
+
def ==(o)
|
302
|
+
return true if self.equal?(o)
|
303
|
+
self.class == o.class &&
|
304
|
+
title == o.title &&
|
305
|
+
description == o.description &&
|
306
|
+
payload == o.payload &&
|
307
|
+
provider_token == o.provider_token &&
|
308
|
+
currency == o.currency &&
|
309
|
+
prices == o.prices &&
|
310
|
+
max_tip_amount == o.max_tip_amount &&
|
311
|
+
suggested_tip_amounts == o.suggested_tip_amounts &&
|
312
|
+
provider_data == o.provider_data &&
|
313
|
+
photo_url == o.photo_url &&
|
314
|
+
photo_size == o.photo_size &&
|
315
|
+
photo_width == o.photo_width &&
|
316
|
+
photo_height == o.photo_height &&
|
317
|
+
need_name == o.need_name &&
|
318
|
+
need_phone_number == o.need_phone_number &&
|
319
|
+
need_email == o.need_email &&
|
320
|
+
need_shipping_address == o.need_shipping_address &&
|
321
|
+
send_phone_number_to_provider == o.send_phone_number_to_provider &&
|
322
|
+
send_email_to_provider == o.send_email_to_provider &&
|
323
|
+
is_flexible == o.is_flexible
|
324
|
+
end
|
325
|
+
|
326
|
+
# @see the `==` method
|
327
|
+
# @param [Object] Object to be compared
|
328
|
+
def eql?(o)
|
329
|
+
self == o
|
330
|
+
end
|
331
|
+
|
332
|
+
# Calculates hash code according to all attributes.
|
333
|
+
# @return [Integer] Hash code
|
334
|
+
def hash
|
335
|
+
[title, description, payload, provider_token, currency, prices, max_tip_amount, suggested_tip_amounts, provider_data, photo_url, photo_size, photo_width, photo_height, need_name, need_phone_number, need_email, need_shipping_address, send_phone_number_to_provider, send_email_to_provider, is_flexible].hash
|
336
|
+
end
|
337
|
+
|
338
|
+
# Builds the object from hash
|
339
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
340
|
+
# @return [Object] Returns the model itself
|
341
|
+
def self.build_from_hash(attributes)
|
342
|
+
return nil unless attributes.is_a?(Hash)
|
343
|
+
attributes = attributes.transform_keys(&:to_sym)
|
344
|
+
transformed_hash = {}
|
345
|
+
openapi_types.each_pair do |key, type|
|
346
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
347
|
+
transformed_hash["#{key}"] = nil
|
348
|
+
elsif type =~ /\AArray<(.*)>/i
|
349
|
+
# check to ensure the input is an array given that the attribute
|
350
|
+
# is documented as an array but the input is not
|
351
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
352
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
353
|
+
end
|
354
|
+
elsif !attributes[attribute_map[key]].nil?
|
355
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
356
|
+
end
|
357
|
+
end
|
358
|
+
new(transformed_hash)
|
359
|
+
end
|
360
|
+
|
361
|
+
# Deserializes the data based on type
|
362
|
+
# @param string type Data type
|
363
|
+
# @param string value Value to be deserialized
|
364
|
+
# @return [Object] Deserialized data
|
365
|
+
def self._deserialize(type, value)
|
366
|
+
case type.to_sym
|
367
|
+
when :Time
|
368
|
+
Time.parse(value)
|
369
|
+
when :Date
|
370
|
+
Date.parse(value)
|
371
|
+
when :String
|
372
|
+
value.to_s
|
373
|
+
when :Integer
|
374
|
+
value.to_i
|
375
|
+
when :Float
|
376
|
+
value.to_f
|
377
|
+
when :Boolean
|
378
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
379
|
+
true
|
380
|
+
else
|
381
|
+
false
|
382
|
+
end
|
383
|
+
when :Object
|
384
|
+
# generic object (usually a Hash), return directly
|
385
|
+
value
|
386
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
387
|
+
inner_type = Regexp.last_match[:inner_type]
|
388
|
+
value.map { |v| _deserialize(inner_type, v) }
|
389
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
390
|
+
k_type = Regexp.last_match[:k_type]
|
391
|
+
v_type = Regexp.last_match[:v_type]
|
392
|
+
{}.tap do |hash|
|
393
|
+
value.each do |k, v|
|
394
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
395
|
+
end
|
396
|
+
end
|
397
|
+
else # model
|
398
|
+
# models (e.g. Pet) or oneOf
|
399
|
+
klass = TelegramBot.const_get(type)
|
400
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
401
|
+
end
|
402
|
+
end
|
403
|
+
|
404
|
+
# Returns the string representation of the object
|
405
|
+
# @return [String] String presentation of the object
|
406
|
+
def to_s
|
407
|
+
to_hash.to_s
|
408
|
+
end
|
409
|
+
|
410
|
+
# to_body is an alias to to_hash (backward compatibility)
|
411
|
+
# @return [Hash] Returns the object in the form of hash
|
412
|
+
def to_body
|
413
|
+
to_hash
|
414
|
+
end
|
415
|
+
|
416
|
+
# Returns the object in the form of hash
|
417
|
+
# @return [Hash] Returns the object in the form of hash
|
418
|
+
def to_hash
|
419
|
+
hash = {}
|
420
|
+
self.class.attribute_map.each_pair do |attr, param|
|
421
|
+
value = self.send(attr)
|
422
|
+
if value.nil?
|
423
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
424
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
425
|
+
end
|
426
|
+
|
427
|
+
hash[param] = _to_hash(value)
|
428
|
+
end
|
429
|
+
hash
|
430
|
+
end
|
431
|
+
|
432
|
+
# Outputs non-array value in the form of hash
|
433
|
+
# For object, use to_hash. Otherwise, just return the value
|
434
|
+
# @param [Object] value Any valid value
|
435
|
+
# @return [Hash] Returns the value in the form of hash
|
436
|
+
def _to_hash(value)
|
437
|
+
if value.is_a?(Array)
|
438
|
+
value.compact.map { |v| _to_hash(v) }
|
439
|
+
elsif value.is_a?(Hash)
|
440
|
+
{}.tap do |hash|
|
441
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
442
|
+
end
|
443
|
+
elsif value.respond_to? :to_hash
|
444
|
+
value.to_hash
|
445
|
+
else
|
446
|
+
value
|
447
|
+
end
|
448
|
+
end
|
449
|
+
|
450
|
+
end
|
451
|
+
|
452
|
+
end
|