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,89 @@
|
|
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 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for Teleswagger::UpdatesApi
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'UpdatesApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@instance = Teleswagger::UpdatesApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of UpdatesApi' do
|
30
|
+
it 'should create an instance of UpdatesApi' do
|
31
|
+
expect(@instance).to be_instance_of(Teleswagger::UpdatesApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for delete_webhook
|
36
|
+
#
|
37
|
+
#
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @return [ResponseBool]
|
40
|
+
describe 'delete_webhook test' do
|
41
|
+
it "should work" do
|
42
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# unit tests for get_updates
|
47
|
+
#
|
48
|
+
#
|
49
|
+
# @param token bot's token to authorize the request
|
50
|
+
# @param [Hash] opts the optional parameters
|
51
|
+
# @option opts [Integer] :offset
|
52
|
+
# @option opts [Integer] :limit
|
53
|
+
# @option opts [Integer] :timeout
|
54
|
+
# @option opts [Array<String>] :allowed_updates
|
55
|
+
# @return [ResponseUpdate]
|
56
|
+
describe 'get_updates test' do
|
57
|
+
it "should work" do
|
58
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# unit tests for get_webhook_info
|
63
|
+
#
|
64
|
+
#
|
65
|
+
# @param [Hash] opts the optional parameters
|
66
|
+
# @return [WebhookInfo]
|
67
|
+
describe 'get_webhook_info test' do
|
68
|
+
it "should work" do
|
69
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# unit tests for set_webhook
|
74
|
+
#
|
75
|
+
#
|
76
|
+
# @param token bot's token to authorize the request
|
77
|
+
# @param url
|
78
|
+
# @param [Hash] opts the optional parameters
|
79
|
+
# @option opts [File] :certificate
|
80
|
+
# @option opts [Integer] :max_connections
|
81
|
+
# @option opts [Array<String>] :allowed_updates
|
82
|
+
# @return [ResponseBool]
|
83
|
+
describe 'set_webhook test' do
|
84
|
+
it "should work" do
|
85
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
end
|
@@ -0,0 +1,62 @@
|
|
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 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for Teleswagger::UsersApi
|
17
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'UsersApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@instance = Teleswagger::UsersApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of UsersApi' do
|
30
|
+
it 'should create an instance of UsersApi' do
|
31
|
+
expect(@instance).to be_instance_of(Teleswagger::UsersApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for get_me
|
36
|
+
#
|
37
|
+
#
|
38
|
+
# @param token bot's token to authorize the request
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @return [InlineResponse200]
|
41
|
+
describe 'get_me test' do
|
42
|
+
it "should work" do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# unit tests for get_user_profile_photos
|
48
|
+
#
|
49
|
+
#
|
50
|
+
# @param token bot's token to authorize the request
|
51
|
+
# @param user_id
|
52
|
+
# @param [Hash] opts the optional parameters
|
53
|
+
# @option opts [Integer] :offset
|
54
|
+
# @option opts [Integer] :limit
|
55
|
+
# @return [InlineResponse2001]
|
56
|
+
describe 'get_user_profile_photos test' do
|
57
|
+
it "should work" do
|
58
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
end
|
@@ -0,0 +1,226 @@
|
|
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 'spec_helper'
|
14
|
+
|
15
|
+
describe Teleswagger::ApiClient do
|
16
|
+
context 'initialization' do
|
17
|
+
context 'URL stuff' do
|
18
|
+
context 'host' do
|
19
|
+
it 'removes http from host' do
|
20
|
+
Teleswagger.configure { |c| c.host = 'http://example.com' }
|
21
|
+
expect(Teleswagger::Configuration.default.host).to eq('example.com')
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'removes https from host' do
|
25
|
+
Teleswagger.configure { |c| c.host = 'https://wookiee.com' }
|
26
|
+
expect(Teleswagger::ApiClient.default.config.host).to eq('wookiee.com')
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'removes trailing path from host' do
|
30
|
+
Teleswagger.configure { |c| c.host = 'hobo.com/v4' }
|
31
|
+
expect(Teleswagger::Configuration.default.host).to eq('hobo.com')
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'base_path' do
|
36
|
+
it "prepends a slash to base_path" do
|
37
|
+
Teleswagger.configure { |c| c.base_path = 'v4/dog' }
|
38
|
+
expect(Teleswagger::Configuration.default.base_path).to eq('/v4/dog')
|
39
|
+
end
|
40
|
+
|
41
|
+
it "doesn't prepend a slash if one is already there" do
|
42
|
+
Teleswagger.configure { |c| c.base_path = '/v4/dog' }
|
43
|
+
expect(Teleswagger::Configuration.default.base_path).to eq('/v4/dog')
|
44
|
+
end
|
45
|
+
|
46
|
+
it "ends up as a blank string if nil" do
|
47
|
+
Teleswagger.configure { |c| c.base_path = nil }
|
48
|
+
expect(Teleswagger::Configuration.default.base_path).to eq('')
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe "params_encoding in #build_request" do
|
55
|
+
let(:config) { Teleswagger::Configuration.new }
|
56
|
+
let(:api_client) { Teleswagger::ApiClient.new(config) }
|
57
|
+
|
58
|
+
it "defaults to nil" do
|
59
|
+
expect(Teleswagger::Configuration.default.params_encoding).to eq(nil)
|
60
|
+
expect(config.params_encoding).to eq(nil)
|
61
|
+
|
62
|
+
request = api_client.build_request(:get, '/test')
|
63
|
+
expect(request.options[:params_encoding]).to eq(nil)
|
64
|
+
end
|
65
|
+
|
66
|
+
it "can be customized" do
|
67
|
+
config.params_encoding = :multi
|
68
|
+
request = api_client.build_request(:get, '/test')
|
69
|
+
expect(request.options[:params_encoding]).to eq(:multi)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
describe "timeout in #build_request" do
|
74
|
+
let(:config) { Teleswagger::Configuration.new }
|
75
|
+
let(:api_client) { Teleswagger::ApiClient.new(config) }
|
76
|
+
|
77
|
+
it "defaults to 0" do
|
78
|
+
expect(Teleswagger::Configuration.default.timeout).to eq(0)
|
79
|
+
expect(config.timeout).to eq(0)
|
80
|
+
|
81
|
+
request = api_client.build_request(:get, '/test')
|
82
|
+
expect(request.options[:timeout]).to eq(0)
|
83
|
+
end
|
84
|
+
|
85
|
+
it "can be customized" do
|
86
|
+
config.timeout = 100
|
87
|
+
request = api_client.build_request(:get, '/test')
|
88
|
+
expect(request.options[:timeout]).to eq(100)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
describe "#deserialize" do
|
93
|
+
it "handles Array<Integer>" do
|
94
|
+
api_client = Teleswagger::ApiClient.new
|
95
|
+
headers = {'Content-Type' => 'application/json'}
|
96
|
+
response = double('response', headers: headers, body: '[12, 34]')
|
97
|
+
data = api_client.deserialize(response, 'Array<Integer>')
|
98
|
+
expect(data).to be_instance_of(Array)
|
99
|
+
expect(data).to eq([12, 34])
|
100
|
+
end
|
101
|
+
|
102
|
+
it "handles Array<Array<Integer>>" do
|
103
|
+
api_client = Teleswagger::ApiClient.new
|
104
|
+
headers = {'Content-Type' => 'application/json'}
|
105
|
+
response = double('response', headers: headers, body: '[[12, 34], [56]]')
|
106
|
+
data = api_client.deserialize(response, 'Array<Array<Integer>>')
|
107
|
+
expect(data).to be_instance_of(Array)
|
108
|
+
expect(data).to eq([[12, 34], [56]])
|
109
|
+
end
|
110
|
+
|
111
|
+
it "handles Hash<String, String>" do
|
112
|
+
api_client = Teleswagger::ApiClient.new
|
113
|
+
headers = {'Content-Type' => 'application/json'}
|
114
|
+
response = double('response', headers: headers, body: '{"message": "Hello"}')
|
115
|
+
data = api_client.deserialize(response, 'Hash<String, String>')
|
116
|
+
expect(data).to be_instance_of(Hash)
|
117
|
+
expect(data).to eq({:message => 'Hello'})
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
describe "#object_to_hash" do
|
122
|
+
it "ignores nils and includes empty arrays" do
|
123
|
+
# uncomment below to test object_to_hash for model
|
124
|
+
#api_client = Teleswagger::ApiClient.new
|
125
|
+
#_model = Teleswagger::ModelName.new
|
126
|
+
# update the model attribute below
|
127
|
+
#_model.id = 1
|
128
|
+
# update the expected value (hash) below
|
129
|
+
#expected = {id: 1, name: '', tags: []}
|
130
|
+
#expect(api_client.object_to_hash(_model)).to eq(expected)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
describe "#build_collection_param" do
|
135
|
+
let(:param) { ['aa', 'bb', 'cc'] }
|
136
|
+
let(:api_client) { Teleswagger::ApiClient.new }
|
137
|
+
|
138
|
+
it "works for csv" do
|
139
|
+
expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
|
140
|
+
end
|
141
|
+
|
142
|
+
it "works for ssv" do
|
143
|
+
expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
|
144
|
+
end
|
145
|
+
|
146
|
+
it "works for tsv" do
|
147
|
+
expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
|
148
|
+
end
|
149
|
+
|
150
|
+
it "works for pipes" do
|
151
|
+
expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
|
152
|
+
end
|
153
|
+
|
154
|
+
it "works for multi" do
|
155
|
+
expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
|
156
|
+
end
|
157
|
+
|
158
|
+
it "fails for invalid collection format" do
|
159
|
+
expect(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
describe "#json_mime?" do
|
164
|
+
let(:api_client) { Teleswagger::ApiClient.new }
|
165
|
+
|
166
|
+
it "works" do
|
167
|
+
expect(api_client.json_mime?(nil)).to eq false
|
168
|
+
expect(api_client.json_mime?('')).to eq false
|
169
|
+
|
170
|
+
expect(api_client.json_mime?('application/json')).to eq true
|
171
|
+
expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
|
172
|
+
expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
|
173
|
+
|
174
|
+
expect(api_client.json_mime?('application/xml')).to eq false
|
175
|
+
expect(api_client.json_mime?('text/plain')).to eq false
|
176
|
+
expect(api_client.json_mime?('application/jsonp')).to eq false
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
describe "#select_header_accept" do
|
181
|
+
let(:api_client) { Teleswagger::ApiClient.new }
|
182
|
+
|
183
|
+
it "works" do
|
184
|
+
expect(api_client.select_header_accept(nil)).to be_nil
|
185
|
+
expect(api_client.select_header_accept([])).to be_nil
|
186
|
+
|
187
|
+
expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
|
188
|
+
expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
189
|
+
expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
190
|
+
|
191
|
+
expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
|
192
|
+
expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
|
193
|
+
end
|
194
|
+
end
|
195
|
+
|
196
|
+
describe "#select_header_content_type" do
|
197
|
+
let(:api_client) { Teleswagger::ApiClient.new }
|
198
|
+
|
199
|
+
it "works" do
|
200
|
+
expect(api_client.select_header_content_type(nil)).to eq('application/json')
|
201
|
+
expect(api_client.select_header_content_type([])).to eq('application/json')
|
202
|
+
|
203
|
+
expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
|
204
|
+
expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
205
|
+
expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
206
|
+
expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
|
207
|
+
expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
211
|
+
describe "#sanitize_filename" do
|
212
|
+
let(:api_client) { Teleswagger::ApiClient.new }
|
213
|
+
|
214
|
+
it "works" do
|
215
|
+
expect(api_client.sanitize_filename('sun')).to eq('sun')
|
216
|
+
expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
|
217
|
+
expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
|
218
|
+
expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
|
219
|
+
expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
|
220
|
+
expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
|
221
|
+
expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
|
222
|
+
expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
|
223
|
+
expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
|
224
|
+
end
|
225
|
+
end
|
226
|
+
end
|
@@ -0,0 +1,42 @@
|
|
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 'spec_helper'
|
14
|
+
|
15
|
+
describe Teleswagger::Configuration do
|
16
|
+
let(:config) { Teleswagger::Configuration.default }
|
17
|
+
|
18
|
+
before(:each) do
|
19
|
+
# uncomment below to setup host and base_path
|
20
|
+
#require 'URI'
|
21
|
+
#uri = URI.parse("https://api.telegram.org")
|
22
|
+
#Teleswagger.configure do |c|
|
23
|
+
# c.host = uri.host
|
24
|
+
# c.base_path = uri.path
|
25
|
+
#end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe '#base_url' do
|
29
|
+
it 'should have the default value' do
|
30
|
+
# uncomment below to test default value of the base path
|
31
|
+
#expect(config.base_url).to eq("https://api.telegram.org")
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'should remove trailing slashes' do
|
35
|
+
[nil, '', '/', '//'].each do |base_path|
|
36
|
+
config.base_path = base_path
|
37
|
+
# uncomment below to test trailing slashes
|
38
|
+
#expect(config.base_url).to eq("https://api.telegram.org")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,66 @@
|
|
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 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for Teleswagger::AddStickerToSetLinkBody
|
18
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe 'AddStickerToSetLinkBody' do
|
21
|
+
before do
|
22
|
+
# run before each test
|
23
|
+
@instance = Teleswagger::AddStickerToSetLinkBody.new
|
24
|
+
end
|
25
|
+
|
26
|
+
after do
|
27
|
+
# run after each test
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test an instance of AddStickerToSetLinkBody' do
|
31
|
+
it 'should create an instance of AddStickerToSetLinkBody' do
|
32
|
+
expect(@instance).to be_instance_of(Teleswagger::AddStickerToSetLinkBody)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe 'test attribute "user_id"' do
|
36
|
+
it 'should work' do
|
37
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe 'test attribute "name"' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe 'test attribute "png_sticker"' do
|
48
|
+
it 'should work' do
|
49
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
describe 'test attribute "emojis"' do
|
54
|
+
it 'should work' do
|
55
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
describe 'test attribute "mask_position"' do
|
60
|
+
it 'should work' do
|
61
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|