teleswagger 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +69 -0
- data/README.md +260 -0
- data/Rakefile +8 -0
- data/config.json +5 -0
- data/docs/AddStickerToSetLinkBody.md +12 -0
- data/docs/AllowedUpdate.md +7 -0
- data/docs/Animation.md +12 -0
- data/docs/AnswerInlineQueryBody.md +14 -0
- data/docs/AnswerShippingQueryBody.md +11 -0
- data/docs/AttachmentsApi.md +1023 -0
- data/docs/Audio.md +13 -0
- data/docs/CallbackGame.md +7 -0
- data/docs/CallbackQuery.md +14 -0
- data/docs/CallbacksApi.md +70 -0
- data/docs/Chat.md +18 -0
- data/docs/ChatMember.md +23 -0
- data/docs/ChatPhoto.md +9 -0
- data/docs/ChatsApi.md +890 -0
- data/docs/ChosenInlineResult.md +12 -0
- data/docs/Contact.md +11 -0
- data/docs/CreateNewStickerSetLinkBody.md +14 -0
- data/docs/Document.md +12 -0
- data/docs/EditMessageCaptionBody.md +12 -0
- data/docs/EditMessageReplyMarkupBody.md +11 -0
- data/docs/EditMessageTextBody.md +14 -0
- data/docs/Error.md +10 -0
- data/docs/File.md +10 -0
- data/docs/ForceReply.md +9 -0
- data/docs/Game.md +13 -0
- data/docs/GameHighScore.md +10 -0
- data/docs/GamesApi.md +182 -0
- data/docs/InlineApi.md +59 -0
- data/docs/InlineKeyboardButton.md +14 -0
- data/docs/InlineKeyboardMarkup.md +8 -0
- data/docs/InlineQuery.md +12 -0
- data/docs/InlineQueryResultArticle.md +18 -0
- data/docs/InlineQueryResultAudio.md +16 -0
- data/docs/InlineQueryResultCachedAudio.md +13 -0
- data/docs/InlineQueryResultCachedDocument.md +14 -0
- data/docs/InlineQueryResultCachedGif.md +14 -0
- data/docs/InlineQueryResultCachedMpeg4Gif.md +14 -0
- data/docs/InlineQueryResultCachedPhoto.md +15 -0
- data/docs/InlineQueryResultCachedSticker.md +12 -0
- data/docs/InlineQueryResultCachedVideo.md +15 -0
- data/docs/InlineQueryResultCachedVoice.md +14 -0
- data/docs/InlineQueryResultContact.md +17 -0
- data/docs/InlineQueryResultDocument.md +19 -0
- data/docs/InlineQueryResultGame.md +11 -0
- data/docs/InlineQueryResultGif.md +18 -0
- data/docs/InlineQueryResultLocation.md +17 -0
- data/docs/InlineQueryResultMpeg4Gif.md +18 -0
- data/docs/InlineQueryResultPhoto.md +17 -0
- data/docs/InlineQueryResultVenue.md +19 -0
- data/docs/InlineQueryResultVideo.md +20 -0
- data/docs/InlineQueryResultVoice.md +15 -0
- data/docs/InlineResponse200.md +11 -0
- data/docs/InlineResponse2001.md +11 -0
- data/docs/InlineResponse2002.md +11 -0
- data/docs/InlineResponse2003.md +11 -0
- data/docs/InlineResponse2004.md +11 -0
- data/docs/InlineResponse2005.md +11 -0
- data/docs/InlineResponse2006.md +11 -0
- data/docs/InlineResponse2007.md +11 -0
- data/docs/InlineResponse2008.md +11 -0
- data/docs/InlineResponse2009.md +11 -0
- data/docs/InlineType.md +7 -0
- data/docs/InputContactMessageContent.md +10 -0
- data/docs/InputLocationMessageContent.md +9 -0
- data/docs/InputTextMessageContent.md +10 -0
- data/docs/InputVenueMessageContent.md +12 -0
- data/docs/Invoice.md +12 -0
- data/docs/KeyboardButton.md +10 -0
- data/docs/LabeledPrice.md +9 -0
- data/docs/Location.md +9 -0
- data/docs/MaskPosition.md +11 -0
- data/docs/Message.md +45 -0
- data/docs/MessageEntity.md +12 -0
- data/docs/MessagesApi.md +375 -0
- data/docs/OrderInfo.md +11 -0
- data/docs/ParseMode.md +7 -0
- data/docs/PaymentsApi.md +167 -0
- data/docs/PhotoSize.md +11 -0
- data/docs/PreCheckoutQuery.md +14 -0
- data/docs/PromoteChatMemberBody.md +17 -0
- data/docs/ReplyKeyboardMarkup.md +11 -0
- data/docs/ReplyKeyboardRemove.md +9 -0
- data/docs/ResponseBool.md +11 -0
- data/docs/ResponseMessage.md +11 -0
- data/docs/ResponseParameters.md +9 -0
- data/docs/ResponseUpdate.md +11 -0
- data/docs/RestrictChatMemberBody.md +14 -0
- data/docs/SendAudioLinkBody.md +16 -0
- data/docs/SendContactBody.md +14 -0
- data/docs/SendDocumentLinkBody.md +13 -0
- data/docs/SendGameBody.md +12 -0
- data/docs/SendInvoiceBody.md +27 -0
- data/docs/SendLocationBody.md +13 -0
- data/docs/SendMessageBody.md +14 -0
- data/docs/SendPhotoLinkBody.md +13 -0
- data/docs/SendStickerLinkBody.md +12 -0
- data/docs/SendVenueBody.md +16 -0
- data/docs/SendVideoLinkBody.md +16 -0
- data/docs/SendVideoNoteLinkBody.md +14 -0
- data/docs/SendVoiceLinkBody.md +14 -0
- data/docs/ShippingAddress.md +13 -0
- data/docs/ShippingOption.md +10 -0
- data/docs/ShippingQuery.md +11 -0
- data/docs/Sticker.md +15 -0
- data/docs/StickerSet.md +11 -0
- data/docs/StickersApi.md +498 -0
- data/docs/SuccessfulPayment.md +14 -0
- data/docs/Update.md +17 -0
- data/docs/UpdatesApi.md +205 -0
- data/docs/User.md +13 -0
- data/docs/UserProfilePhotos.md +9 -0
- data/docs/UsersApi.md +111 -0
- data/docs/Venue.md +11 -0
- data/docs/Video.md +14 -0
- data/docs/VideoNote.md +12 -0
- data/docs/Voice.md +11 -0
- data/docs/WebhookInfo.md +14 -0
- data/lib/teleswagger.rb +156 -0
- data/lib/teleswagger/api/attachments_api.rb +1243 -0
- data/lib/teleswagger/api/callbacks_api.rb +113 -0
- data/lib/teleswagger/api/chats_api.rb +1141 -0
- data/lib/teleswagger/api/games_api.rb +235 -0
- data/lib/teleswagger/api/inline_api.rb +80 -0
- data/lib/teleswagger/api/messages_api.rb +460 -0
- data/lib/teleswagger/api/payments_api.rb +209 -0
- data/lib/teleswagger/api/stickers_api.rb +658 -0
- data/lib/teleswagger/api/updates_api.rb +265 -0
- data/lib/teleswagger/api/users_api.rb +146 -0
- data/lib/teleswagger/api_client.rb +388 -0
- data/lib/teleswagger/api_error.rb +38 -0
- data/lib/teleswagger/configuration.rb +202 -0
- data/lib/teleswagger/models/add_sticker_to_set_link_body.rb +244 -0
- data/lib/teleswagger/models/allowed_update.rb +27 -0
- data/lib/teleswagger/models/animation.rb +229 -0
- data/lib/teleswagger/models/answer_inline_query_body.rb +254 -0
- data/lib/teleswagger/models/answer_shipping_query_body.rb +227 -0
- data/lib/teleswagger/models/audio.rb +233 -0
- data/lib/teleswagger/models/callback_game.rb +179 -0
- data/lib/teleswagger/models/callback_query.rb +242 -0
- data/lib/teleswagger/models/chat.rb +321 -0
- data/lib/teleswagger/models/chat_member.rb +366 -0
- data/lib/teleswagger/models/chat_photo.rb +197 -0
- data/lib/teleswagger/models/chosen_inline_result.rb +239 -0
- data/lib/teleswagger/models/contact.rb +215 -0
- data/lib/teleswagger/models/create_new_sticker_set_link_body.rb +267 -0
- data/lib/teleswagger/models/document.rb +224 -0
- data/lib/teleswagger/models/edit_message_caption_body.rb +224 -0
- data/lib/teleswagger/models/edit_message_reply_markup_body.rb +215 -0
- data/lib/teleswagger/models/edit_message_text_body.rb +247 -0
- data/lib/teleswagger/models/error.rb +206 -0
- data/lib/teleswagger/models/file.rb +206 -0
- data/lib/teleswagger/models/force_reply.rb +197 -0
- data/lib/teleswagger/models/game.rb +252 -0
- data/lib/teleswagger/models/game_high_score.rb +206 -0
- data/lib/teleswagger/models/inline_keyboard_button.rb +242 -0
- data/lib/teleswagger/models/inline_keyboard_markup.rb +190 -0
- data/lib/teleswagger/models/inline_query.rb +224 -0
- data/lib/teleswagger/models/inline_query_result_article.rb +298 -0
- data/lib/teleswagger/models/inline_query_result_audio.rb +280 -0
- data/lib/teleswagger/models/inline_query_result_cached_audio.rb +248 -0
- data/lib/teleswagger/models/inline_query_result_cached_document.rb +257 -0
- data/lib/teleswagger/models/inline_query_result_cached_gif.rb +257 -0
- data/lib/teleswagger/models/inline_query_result_cached_mpeg4_gif.rb +257 -0
- data/lib/teleswagger/models/inline_query_result_cached_photo.rb +266 -0
- data/lib/teleswagger/models/inline_query_result_cached_sticker.rb +239 -0
- data/lib/teleswagger/models/inline_query_result_cached_video.rb +266 -0
- data/lib/teleswagger/models/inline_query_result_cached_voice.rb +257 -0
- data/lib/teleswagger/models/inline_query_result_contact.rb +289 -0
- data/lib/teleswagger/models/inline_query_result_document.rb +312 -0
- data/lib/teleswagger/models/inline_query_result_game.rb +230 -0
- data/lib/teleswagger/models/inline_query_result_gif.rb +298 -0
- data/lib/teleswagger/models/inline_query_result_location.rb +294 -0
- data/lib/teleswagger/models/inline_query_result_mpeg4_gif.rb +298 -0
- data/lib/teleswagger/models/inline_query_result_photo.rb +289 -0
- data/lib/teleswagger/models/inline_query_result_venue.rb +317 -0
- data/lib/teleswagger/models/inline_query_result_video.rb +326 -0
- data/lib/teleswagger/models/inline_query_result_voice.rb +271 -0
- data/lib/teleswagger/models/inline_response_200.rb +215 -0
- data/lib/teleswagger/models/inline_response_200_1.rb +215 -0
- data/lib/teleswagger/models/inline_response_200_2.rb +215 -0
- data/lib/teleswagger/models/inline_response_200_3.rb +215 -0
- data/lib/teleswagger/models/inline_response_200_4.rb +217 -0
- data/lib/teleswagger/models/inline_response_200_5.rb +215 -0
- data/lib/teleswagger/models/inline_response_200_6.rb +215 -0
- data/lib/teleswagger/models/inline_response_200_7.rb +215 -0
- data/lib/teleswagger/models/inline_response_200_8.rb +215 -0
- data/lib/teleswagger/models/inline_response_200_9.rb +215 -0
- data/lib/teleswagger/models/inline_type.rb +33 -0
- data/lib/teleswagger/models/input_contact_message_content.rb +216 -0
- data/lib/teleswagger/models/input_location_message_content.rb +207 -0
- data/lib/teleswagger/models/input_text_message_content.rb +211 -0
- data/lib/teleswagger/models/input_venue_message_content.rb +244 -0
- data/lib/teleswagger/models/invoice.rb +224 -0
- data/lib/teleswagger/models/keyboard_button.rb +206 -0
- data/lib/teleswagger/models/labeled_price.rb +197 -0
- data/lib/teleswagger/models/location.rb +197 -0
- data/lib/teleswagger/models/mask_position.rb +248 -0
- data/lib/teleswagger/models/message.rb +529 -0
- data/lib/teleswagger/models/message_entity.rb +257 -0
- data/lib/teleswagger/models/order_info.rb +215 -0
- data/lib/teleswagger/models/parse_mode.rb +22 -0
- data/lib/teleswagger/models/photo_size.rb +215 -0
- data/lib/teleswagger/models/pre_checkout_query.rb +242 -0
- data/lib/teleswagger/models/promote_chat_member_body.rb +279 -0
- data/lib/teleswagger/models/reply_keyboard_markup.rb +217 -0
- data/lib/teleswagger/models/reply_keyboard_remove.rb +197 -0
- data/lib/teleswagger/models/response_bool.rb +215 -0
- data/lib/teleswagger/models/response_message.rb +215 -0
- data/lib/teleswagger/models/response_parameters.rb +197 -0
- data/lib/teleswagger/models/response_update.rb +217 -0
- data/lib/teleswagger/models/restrict_chat_member_body.rb +252 -0
- data/lib/teleswagger/models/send_audio_link_body.rb +270 -0
- data/lib/teleswagger/models/send_contact_body.rb +257 -0
- data/lib/teleswagger/models/send_document_link_body.rb +243 -0
- data/lib/teleswagger/models/send_game_body.rb +234 -0
- data/lib/teleswagger/models/send_invoice_body.rb +401 -0
- data/lib/teleswagger/models/send_location_body.rb +248 -0
- data/lib/teleswagger/models/send_message_body.rb +252 -0
- data/lib/teleswagger/models/send_photo_link_body.rb +243 -0
- data/lib/teleswagger/models/send_sticker_link_body.rb +234 -0
- data/lib/teleswagger/models/send_venue_body.rb +285 -0
- data/lib/teleswagger/models/send_video_link_body.rb +270 -0
- data/lib/teleswagger/models/send_video_note_link_body.rb +252 -0
- data/lib/teleswagger/models/send_voice_link_body.rb +252 -0
- data/lib/teleswagger/models/shipping_address.rb +233 -0
- data/lib/teleswagger/models/shipping_option.rb +208 -0
- data/lib/teleswagger/models/shipping_query.rb +215 -0
- data/lib/teleswagger/models/sticker.rb +251 -0
- data/lib/teleswagger/models/sticker_set.rb +217 -0
- data/lib/teleswagger/models/successful_payment.rb +242 -0
- data/lib/teleswagger/models/update.rb +269 -0
- data/lib/teleswagger/models/user.rb +233 -0
- data/lib/teleswagger/models/user_profile_photos.rb +199 -0
- data/lib/teleswagger/models/venue.rb +215 -0
- data/lib/teleswagger/models/video.rb +242 -0
- data/lib/teleswagger/models/video_note.rb +224 -0
- data/lib/teleswagger/models/voice.rb +215 -0
- data/lib/teleswagger/models/webhook_info.rb +259 -0
- data/lib/teleswagger/version.rb +15 -0
- data/spec/api/attachments_api_spec.rb +311 -0
- data/spec/api/callbacks_api_spec.rb +52 -0
- data/spec/api/chats_api_spec.rb +266 -0
- data/spec/api/games_api_spec.rb +83 -0
- data/spec/api/inline_api_spec.rb +48 -0
- data/spec/api/messages_api_spec.rb +130 -0
- data/spec/api/payments_api_spec.rb +76 -0
- data/spec/api/stickers_api_spec.rb +165 -0
- data/spec/api/updates_api_spec.rb +89 -0
- data/spec/api/users_api_spec.rb +62 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/add_sticker_to_set_link_body_spec.rb +66 -0
- data/spec/models/allowed_update_spec.rb +36 -0
- data/spec/models/animation_spec.rb +66 -0
- data/spec/models/answer_inline_query_body_spec.rb +78 -0
- data/spec/models/answer_shipping_query_body_spec.rb +60 -0
- data/spec/models/audio_spec.rb +72 -0
- data/spec/models/callback_game_spec.rb +36 -0
- data/spec/models/callback_query_spec.rb +78 -0
- data/spec/models/chat_member_spec.rb +136 -0
- data/spec/models/chat_photo_spec.rb +48 -0
- data/spec/models/chat_spec.rb +106 -0
- data/spec/models/chosen_inline_result_spec.rb +66 -0
- data/spec/models/contact_spec.rb +60 -0
- data/spec/models/create_new_sticker_set_link_body_spec.rb +78 -0
- data/spec/models/document_spec.rb +66 -0
- data/spec/models/edit_message_caption_body_spec.rb +66 -0
- data/spec/models/edit_message_reply_markup_body_spec.rb +60 -0
- data/spec/models/edit_message_text_body_spec.rb +78 -0
- data/spec/models/error_spec.rb +54 -0
- data/spec/models/file_spec.rb +54 -0
- data/spec/models/force_reply_spec.rb +48 -0
- data/spec/models/game_high_score_spec.rb +54 -0
- data/spec/models/game_spec.rb +72 -0
- data/spec/models/inline_keyboard_button_spec.rb +78 -0
- data/spec/models/inline_keyboard_markup_spec.rb +42 -0
- data/spec/models/inline_query_result_article_spec.rb +102 -0
- data/spec/models/inline_query_result_audio_spec.rb +90 -0
- data/spec/models/inline_query_result_cached_audio_spec.rb +72 -0
- data/spec/models/inline_query_result_cached_document_spec.rb +78 -0
- data/spec/models/inline_query_result_cached_gif_spec.rb +78 -0
- data/spec/models/inline_query_result_cached_mpeg4_gif_spec.rb +78 -0
- data/spec/models/inline_query_result_cached_photo_spec.rb +84 -0
- data/spec/models/inline_query_result_cached_sticker_spec.rb +66 -0
- data/spec/models/inline_query_result_cached_video_spec.rb +84 -0
- data/spec/models/inline_query_result_cached_voice_spec.rb +78 -0
- data/spec/models/inline_query_result_contact_spec.rb +96 -0
- data/spec/models/inline_query_result_document_spec.rb +108 -0
- data/spec/models/inline_query_result_game_spec.rb +60 -0
- data/spec/models/inline_query_result_gif_spec.rb +102 -0
- data/spec/models/inline_query_result_location_spec.rb +96 -0
- data/spec/models/inline_query_result_mpeg4_gif_spec.rb +102 -0
- data/spec/models/inline_query_result_photo_spec.rb +96 -0
- data/spec/models/inline_query_result_venue_spec.rb +108 -0
- data/spec/models/inline_query_result_video_spec.rb +114 -0
- data/spec/models/inline_query_result_voice_spec.rb +84 -0
- data/spec/models/inline_query_spec.rb +66 -0
- data/spec/models/inline_response_200_1_spec.rb +60 -0
- data/spec/models/inline_response_200_2_spec.rb +60 -0
- data/spec/models/inline_response_200_3_spec.rb +60 -0
- data/spec/models/inline_response_200_4_spec.rb +60 -0
- data/spec/models/inline_response_200_5_spec.rb +60 -0
- data/spec/models/inline_response_200_6_spec.rb +60 -0
- data/spec/models/inline_response_200_7_spec.rb +60 -0
- data/spec/models/inline_response_200_8_spec.rb +60 -0
- data/spec/models/inline_response_200_9_spec.rb +60 -0
- data/spec/models/inline_response_200_spec.rb +60 -0
- data/spec/models/inline_type_spec.rb +36 -0
- data/spec/models/input_contact_message_content_spec.rb +54 -0
- data/spec/models/input_location_message_content_spec.rb +48 -0
- data/spec/models/input_text_message_content_spec.rb +54 -0
- data/spec/models/input_venue_message_content_spec.rb +66 -0
- data/spec/models/invoice_spec.rb +66 -0
- data/spec/models/keyboard_button_spec.rb +54 -0
- data/spec/models/labeled_price_spec.rb +48 -0
- data/spec/models/location_spec.rb +48 -0
- data/spec/models/mask_position_spec.rb +64 -0
- data/spec/models/message_entity_spec.rb +70 -0
- data/spec/models/message_spec.rb +264 -0
- data/spec/models/order_info_spec.rb +60 -0
- data/spec/models/parse_mode_spec.rb +36 -0
- data/spec/models/photo_size_spec.rb +60 -0
- data/spec/models/pre_checkout_query_spec.rb +78 -0
- data/spec/models/promote_chat_member_body_spec.rb +96 -0
- data/spec/models/reply_keyboard_markup_spec.rb +60 -0
- data/spec/models/reply_keyboard_remove_spec.rb +48 -0
- data/spec/models/response_bool_spec.rb +60 -0
- data/spec/models/response_message_spec.rb +60 -0
- data/spec/models/response_parameters_spec.rb +48 -0
- data/spec/models/response_update_spec.rb +60 -0
- data/spec/models/restrict_chat_member_body_spec.rb +78 -0
- data/spec/models/send_audio_link_body_spec.rb +90 -0
- data/spec/models/send_contact_body_spec.rb +78 -0
- data/spec/models/send_document_link_body_spec.rb +72 -0
- data/spec/models/send_game_body_spec.rb +66 -0
- data/spec/models/send_invoice_body_spec.rb +156 -0
- data/spec/models/send_location_body_spec.rb +72 -0
- data/spec/models/send_message_body_spec.rb +78 -0
- data/spec/models/send_photo_link_body_spec.rb +72 -0
- data/spec/models/send_sticker_link_body_spec.rb +66 -0
- data/spec/models/send_venue_body_spec.rb +90 -0
- data/spec/models/send_video_link_body_spec.rb +90 -0
- data/spec/models/send_video_note_link_body_spec.rb +78 -0
- data/spec/models/send_voice_link_body_spec.rb +78 -0
- data/spec/models/shipping_address_spec.rb +72 -0
- data/spec/models/shipping_option_spec.rb +54 -0
- data/spec/models/shipping_query_spec.rb +60 -0
- data/spec/models/sticker_set_spec.rb +60 -0
- data/spec/models/sticker_spec.rb +84 -0
- data/spec/models/successful_payment_spec.rb +78 -0
- data/spec/models/update_spec.rb +96 -0
- data/spec/models/user_profile_photos_spec.rb +48 -0
- data/spec/models/user_spec.rb +72 -0
- data/spec/models/venue_spec.rb +60 -0
- data/spec/models/video_note_spec.rb +66 -0
- data/spec/models/video_spec.rb +78 -0
- data/spec/models/voice_spec.rb +60 -0
- data/spec/models/webhook_info_spec.rb +78 -0
- data/spec/spec_helper.rb +111 -0
- data/swagger.yaml +5202 -0
- data/teleswagger.gemspec +46 -0
- metadata +709 -0
@@ -0,0 +1,269 @@
|
|
1
|
+
=begin
|
2
|
+
#Telegram bot API
|
3
|
+
|
4
|
+
#This is a swagger defenition for [Telegram bot API](https://core.telegram.org/bots/api).
|
5
|
+
|
6
|
+
OpenAPI spec version: 3.3
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.2.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Teleswagger
|
16
|
+
|
17
|
+
class Update
|
18
|
+
attr_accessor :update_id
|
19
|
+
|
20
|
+
attr_accessor :message
|
21
|
+
|
22
|
+
attr_accessor :edited_message
|
23
|
+
|
24
|
+
attr_accessor :channel_post
|
25
|
+
|
26
|
+
attr_accessor :edited_channel_post
|
27
|
+
|
28
|
+
attr_accessor :inline_query
|
29
|
+
|
30
|
+
attr_accessor :chosen_inline_result
|
31
|
+
|
32
|
+
attr_accessor :callback_query
|
33
|
+
|
34
|
+
attr_accessor :shipping_query
|
35
|
+
|
36
|
+
attr_accessor :pre_checkout_query
|
37
|
+
|
38
|
+
|
39
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
40
|
+
def self.attribute_map
|
41
|
+
{
|
42
|
+
:'update_id' => :'update_id',
|
43
|
+
:'message' => :'message',
|
44
|
+
:'edited_message' => :'edited_message',
|
45
|
+
:'channel_post' => :'channel_post',
|
46
|
+
:'edited_channel_post' => :'edited_channel_post',
|
47
|
+
:'inline_query' => :'inline_query',
|
48
|
+
:'chosen_inline_result' => :'chosen_inline_result',
|
49
|
+
:'callback_query' => :'callback_query',
|
50
|
+
:'shipping_query' => :'shipping_query',
|
51
|
+
:'pre_checkout_query' => :'pre_checkout_query'
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
# Attribute type mapping.
|
56
|
+
def self.swagger_types
|
57
|
+
{
|
58
|
+
:'update_id' => :'Integer',
|
59
|
+
:'message' => :'Message',
|
60
|
+
:'edited_message' => :'Message',
|
61
|
+
:'channel_post' => :'Message',
|
62
|
+
:'edited_channel_post' => :'Message',
|
63
|
+
:'inline_query' => :'InlineQuery',
|
64
|
+
:'chosen_inline_result' => :'ChosenInlineResult',
|
65
|
+
:'callback_query' => :'CallbackQuery',
|
66
|
+
:'shipping_query' => :'ShippingQuery',
|
67
|
+
:'pre_checkout_query' => :'PreCheckoutQuery'
|
68
|
+
}
|
69
|
+
end
|
70
|
+
|
71
|
+
# Initializes the object
|
72
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
73
|
+
def initialize(attributes = {})
|
74
|
+
return unless attributes.is_a?(Hash)
|
75
|
+
|
76
|
+
# convert string to symbol for hash key
|
77
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
78
|
+
|
79
|
+
if attributes.has_key?(:'update_id')
|
80
|
+
self.update_id = attributes[:'update_id']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.has_key?(:'message')
|
84
|
+
self.message = attributes[:'message']
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.has_key?(:'edited_message')
|
88
|
+
self.edited_message = attributes[:'edited_message']
|
89
|
+
end
|
90
|
+
|
91
|
+
if attributes.has_key?(:'channel_post')
|
92
|
+
self.channel_post = attributes[:'channel_post']
|
93
|
+
end
|
94
|
+
|
95
|
+
if attributes.has_key?(:'edited_channel_post')
|
96
|
+
self.edited_channel_post = attributes[:'edited_channel_post']
|
97
|
+
end
|
98
|
+
|
99
|
+
if attributes.has_key?(:'inline_query')
|
100
|
+
self.inline_query = attributes[:'inline_query']
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.has_key?(:'chosen_inline_result')
|
104
|
+
self.chosen_inline_result = attributes[:'chosen_inline_result']
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.has_key?(:'callback_query')
|
108
|
+
self.callback_query = attributes[:'callback_query']
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.has_key?(:'shipping_query')
|
112
|
+
self.shipping_query = attributes[:'shipping_query']
|
113
|
+
end
|
114
|
+
|
115
|
+
if attributes.has_key?(:'pre_checkout_query')
|
116
|
+
self.pre_checkout_query = attributes[:'pre_checkout_query']
|
117
|
+
end
|
118
|
+
|
119
|
+
end
|
120
|
+
|
121
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
122
|
+
# @return Array for valid properies with the reasons
|
123
|
+
def list_invalid_properties
|
124
|
+
invalid_properties = Array.new
|
125
|
+
return invalid_properties
|
126
|
+
end
|
127
|
+
|
128
|
+
# Check to see if the all the properties in the model are valid
|
129
|
+
# @return true if the model is valid
|
130
|
+
def valid?
|
131
|
+
return true
|
132
|
+
end
|
133
|
+
|
134
|
+
# Checks equality by comparing each attribute.
|
135
|
+
# @param [Object] Object to be compared
|
136
|
+
def ==(o)
|
137
|
+
return true if self.equal?(o)
|
138
|
+
self.class == o.class &&
|
139
|
+
update_id == o.update_id &&
|
140
|
+
message == o.message &&
|
141
|
+
edited_message == o.edited_message &&
|
142
|
+
channel_post == o.channel_post &&
|
143
|
+
edited_channel_post == o.edited_channel_post &&
|
144
|
+
inline_query == o.inline_query &&
|
145
|
+
chosen_inline_result == o.chosen_inline_result &&
|
146
|
+
callback_query == o.callback_query &&
|
147
|
+
shipping_query == o.shipping_query &&
|
148
|
+
pre_checkout_query == o.pre_checkout_query
|
149
|
+
end
|
150
|
+
|
151
|
+
# @see the `==` method
|
152
|
+
# @param [Object] Object to be compared
|
153
|
+
def eql?(o)
|
154
|
+
self == o
|
155
|
+
end
|
156
|
+
|
157
|
+
# Calculates hash code according to all attributes.
|
158
|
+
# @return [Fixnum] Hash code
|
159
|
+
def hash
|
160
|
+
[update_id, message, edited_message, channel_post, edited_channel_post, inline_query, chosen_inline_result, callback_query, shipping_query, pre_checkout_query].hash
|
161
|
+
end
|
162
|
+
|
163
|
+
# Builds the object from hash
|
164
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
165
|
+
# @return [Object] Returns the model itself
|
166
|
+
def build_from_hash(attributes)
|
167
|
+
return nil unless attributes.is_a?(Hash)
|
168
|
+
self.class.swagger_types.each_pair do |key, type|
|
169
|
+
if type =~ /\AArray<(.*)>/i
|
170
|
+
# check to ensure the input is an array given that the the attribute
|
171
|
+
# is documented as an array but the input is not
|
172
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
173
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
174
|
+
end
|
175
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
176
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
177
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
178
|
+
end
|
179
|
+
|
180
|
+
self
|
181
|
+
end
|
182
|
+
|
183
|
+
# Deserializes the data based on type
|
184
|
+
# @param string type Data type
|
185
|
+
# @param string value Value to be deserialized
|
186
|
+
# @return [Object] Deserialized data
|
187
|
+
def _deserialize(type, value)
|
188
|
+
case type.to_sym
|
189
|
+
when :DateTime
|
190
|
+
DateTime.parse(value)
|
191
|
+
when :Date
|
192
|
+
Date.parse(value)
|
193
|
+
when :String
|
194
|
+
value.to_s
|
195
|
+
when :Integer
|
196
|
+
value.to_i
|
197
|
+
when :Float
|
198
|
+
value.to_f
|
199
|
+
when :BOOLEAN
|
200
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
201
|
+
true
|
202
|
+
else
|
203
|
+
false
|
204
|
+
end
|
205
|
+
when :Object
|
206
|
+
# generic object (usually a Hash), return directly
|
207
|
+
value
|
208
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
209
|
+
inner_type = Regexp.last_match[:inner_type]
|
210
|
+
value.map { |v| _deserialize(inner_type, v) }
|
211
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
212
|
+
k_type = Regexp.last_match[:k_type]
|
213
|
+
v_type = Regexp.last_match[:v_type]
|
214
|
+
{}.tap do |hash|
|
215
|
+
value.each do |k, v|
|
216
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
217
|
+
end
|
218
|
+
end
|
219
|
+
else # model
|
220
|
+
temp_model = Teleswagger.const_get(type).new
|
221
|
+
temp_model.build_from_hash(value)
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
# Returns the string representation of the object
|
226
|
+
# @return [String] String presentation of the object
|
227
|
+
def to_s
|
228
|
+
to_hash.to_s
|
229
|
+
end
|
230
|
+
|
231
|
+
# to_body is an alias to to_hash (backward compatibility)
|
232
|
+
# @return [Hash] Returns the object in the form of hash
|
233
|
+
def to_body
|
234
|
+
to_hash
|
235
|
+
end
|
236
|
+
|
237
|
+
# Returns the object in the form of hash
|
238
|
+
# @return [Hash] Returns the object in the form of hash
|
239
|
+
def to_hash
|
240
|
+
hash = {}
|
241
|
+
self.class.attribute_map.each_pair do |attr, param|
|
242
|
+
value = self.send(attr)
|
243
|
+
next if value.nil?
|
244
|
+
hash[param] = _to_hash(value)
|
245
|
+
end
|
246
|
+
hash
|
247
|
+
end
|
248
|
+
|
249
|
+
# Outputs non-array value in the form of hash
|
250
|
+
# For object, use to_hash. Otherwise, just return the value
|
251
|
+
# @param [Object] value Any valid value
|
252
|
+
# @return [Hash] Returns the value in the form of hash
|
253
|
+
def _to_hash(value)
|
254
|
+
if value.is_a?(Array)
|
255
|
+
value.compact.map{ |v| _to_hash(v) }
|
256
|
+
elsif value.is_a?(Hash)
|
257
|
+
{}.tap do |hash|
|
258
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
259
|
+
end
|
260
|
+
elsif value.respond_to? :to_hash
|
261
|
+
value.to_hash
|
262
|
+
else
|
263
|
+
value
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
end
|
268
|
+
|
269
|
+
end
|
@@ -0,0 +1,233 @@
|
|
1
|
+
=begin
|
2
|
+
#Telegram bot API
|
3
|
+
|
4
|
+
#This is a swagger defenition for [Telegram bot API](https://core.telegram.org/bots/api).
|
5
|
+
|
6
|
+
OpenAPI spec version: 3.3
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.2.3
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module Teleswagger
|
16
|
+
|
17
|
+
class User
|
18
|
+
attr_accessor :id
|
19
|
+
|
20
|
+
attr_accessor :username
|
21
|
+
|
22
|
+
attr_accessor :first_name
|
23
|
+
|
24
|
+
attr_accessor :last_name
|
25
|
+
|
26
|
+
attr_accessor :language_code
|
27
|
+
|
28
|
+
attr_accessor :is_bot
|
29
|
+
|
30
|
+
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
32
|
+
def self.attribute_map
|
33
|
+
{
|
34
|
+
:'id' => :'id',
|
35
|
+
:'username' => :'username',
|
36
|
+
:'first_name' => :'first_name',
|
37
|
+
:'last_name' => :'last_name',
|
38
|
+
:'language_code' => :'language_code',
|
39
|
+
:'is_bot' => :'is_bot'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# Attribute type mapping.
|
44
|
+
def self.swagger_types
|
45
|
+
{
|
46
|
+
:'id' => :'Integer',
|
47
|
+
:'username' => :'String',
|
48
|
+
:'first_name' => :'String',
|
49
|
+
:'last_name' => :'String',
|
50
|
+
:'language_code' => :'String',
|
51
|
+
:'is_bot' => :'BOOLEAN'
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
# Initializes the object
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
57
|
+
def initialize(attributes = {})
|
58
|
+
return unless attributes.is_a?(Hash)
|
59
|
+
|
60
|
+
# convert string to symbol for hash key
|
61
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
62
|
+
|
63
|
+
if attributes.has_key?(:'id')
|
64
|
+
self.id = attributes[:'id']
|
65
|
+
end
|
66
|
+
|
67
|
+
if attributes.has_key?(:'username')
|
68
|
+
self.username = attributes[:'username']
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes.has_key?(:'first_name')
|
72
|
+
self.first_name = attributes[:'first_name']
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes.has_key?(:'last_name')
|
76
|
+
self.last_name = attributes[:'last_name']
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.has_key?(:'language_code')
|
80
|
+
self.language_code = attributes[:'language_code']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.has_key?(:'is_bot')
|
84
|
+
self.is_bot = attributes[:'is_bot']
|
85
|
+
end
|
86
|
+
|
87
|
+
end
|
88
|
+
|
89
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
90
|
+
# @return Array for valid properies with the reasons
|
91
|
+
def list_invalid_properties
|
92
|
+
invalid_properties = Array.new
|
93
|
+
return invalid_properties
|
94
|
+
end
|
95
|
+
|
96
|
+
# Check to see if the all the properties in the model are valid
|
97
|
+
# @return true if the model is valid
|
98
|
+
def valid?
|
99
|
+
return true
|
100
|
+
end
|
101
|
+
|
102
|
+
# Checks equality by comparing each attribute.
|
103
|
+
# @param [Object] Object to be compared
|
104
|
+
def ==(o)
|
105
|
+
return true if self.equal?(o)
|
106
|
+
self.class == o.class &&
|
107
|
+
id == o.id &&
|
108
|
+
username == o.username &&
|
109
|
+
first_name == o.first_name &&
|
110
|
+
last_name == o.last_name &&
|
111
|
+
language_code == o.language_code &&
|
112
|
+
is_bot == o.is_bot
|
113
|
+
end
|
114
|
+
|
115
|
+
# @see the `==` method
|
116
|
+
# @param [Object] Object to be compared
|
117
|
+
def eql?(o)
|
118
|
+
self == o
|
119
|
+
end
|
120
|
+
|
121
|
+
# Calculates hash code according to all attributes.
|
122
|
+
# @return [Fixnum] Hash code
|
123
|
+
def hash
|
124
|
+
[id, username, first_name, last_name, language_code, is_bot].hash
|
125
|
+
end
|
126
|
+
|
127
|
+
# Builds the object from hash
|
128
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
129
|
+
# @return [Object] Returns the model itself
|
130
|
+
def build_from_hash(attributes)
|
131
|
+
return nil unless attributes.is_a?(Hash)
|
132
|
+
self.class.swagger_types.each_pair do |key, type|
|
133
|
+
if type =~ /\AArray<(.*)>/i
|
134
|
+
# check to ensure the input is an array given that the the attribute
|
135
|
+
# is documented as an array but the input is not
|
136
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
137
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
138
|
+
end
|
139
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
140
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
141
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
142
|
+
end
|
143
|
+
|
144
|
+
self
|
145
|
+
end
|
146
|
+
|
147
|
+
# Deserializes the data based on type
|
148
|
+
# @param string type Data type
|
149
|
+
# @param string value Value to be deserialized
|
150
|
+
# @return [Object] Deserialized data
|
151
|
+
def _deserialize(type, value)
|
152
|
+
case type.to_sym
|
153
|
+
when :DateTime
|
154
|
+
DateTime.parse(value)
|
155
|
+
when :Date
|
156
|
+
Date.parse(value)
|
157
|
+
when :String
|
158
|
+
value.to_s
|
159
|
+
when :Integer
|
160
|
+
value.to_i
|
161
|
+
when :Float
|
162
|
+
value.to_f
|
163
|
+
when :BOOLEAN
|
164
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
165
|
+
true
|
166
|
+
else
|
167
|
+
false
|
168
|
+
end
|
169
|
+
when :Object
|
170
|
+
# generic object (usually a Hash), return directly
|
171
|
+
value
|
172
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
173
|
+
inner_type = Regexp.last_match[:inner_type]
|
174
|
+
value.map { |v| _deserialize(inner_type, v) }
|
175
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
176
|
+
k_type = Regexp.last_match[:k_type]
|
177
|
+
v_type = Regexp.last_match[:v_type]
|
178
|
+
{}.tap do |hash|
|
179
|
+
value.each do |k, v|
|
180
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
else # model
|
184
|
+
temp_model = Teleswagger.const_get(type).new
|
185
|
+
temp_model.build_from_hash(value)
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
# Returns the string representation of the object
|
190
|
+
# @return [String] String presentation of the object
|
191
|
+
def to_s
|
192
|
+
to_hash.to_s
|
193
|
+
end
|
194
|
+
|
195
|
+
# to_body is an alias to to_hash (backward compatibility)
|
196
|
+
# @return [Hash] Returns the object in the form of hash
|
197
|
+
def to_body
|
198
|
+
to_hash
|
199
|
+
end
|
200
|
+
|
201
|
+
# Returns the object in the form of hash
|
202
|
+
# @return [Hash] Returns the object in the form of hash
|
203
|
+
def to_hash
|
204
|
+
hash = {}
|
205
|
+
self.class.attribute_map.each_pair do |attr, param|
|
206
|
+
value = self.send(attr)
|
207
|
+
next if value.nil?
|
208
|
+
hash[param] = _to_hash(value)
|
209
|
+
end
|
210
|
+
hash
|
211
|
+
end
|
212
|
+
|
213
|
+
# Outputs non-array value in the form of hash
|
214
|
+
# For object, use to_hash. Otherwise, just return the value
|
215
|
+
# @param [Object] value Any valid value
|
216
|
+
# @return [Hash] Returns the value in the form of hash
|
217
|
+
def _to_hash(value)
|
218
|
+
if value.is_a?(Array)
|
219
|
+
value.compact.map{ |v| _to_hash(v) }
|
220
|
+
elsif value.is_a?(Hash)
|
221
|
+
{}.tap do |hash|
|
222
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
223
|
+
end
|
224
|
+
elsif value.respond_to? :to_hash
|
225
|
+
value.to_hash
|
226
|
+
else
|
227
|
+
value
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
end
|
232
|
+
|
233
|
+
end
|