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,38 @@
|
|
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
|
+
module Teleswagger
|
14
|
+
class ApiError < StandardError
|
15
|
+
attr_reader :code, :response_headers, :response_body
|
16
|
+
|
17
|
+
# Usage examples:
|
18
|
+
# ApiError.new
|
19
|
+
# ApiError.new("message")
|
20
|
+
# ApiError.new(:code => 500, :response_headers => {}, :response_body => "")
|
21
|
+
# ApiError.new(:code => 404, :message => "Not Found")
|
22
|
+
def initialize(arg = nil)
|
23
|
+
if arg.is_a? Hash
|
24
|
+
if arg.key?(:message) || arg.key?('message')
|
25
|
+
super(arg[:message] || arg['message'])
|
26
|
+
else
|
27
|
+
super arg
|
28
|
+
end
|
29
|
+
|
30
|
+
arg.each do |k, v|
|
31
|
+
instance_variable_set "@#{k}", v
|
32
|
+
end
|
33
|
+
else
|
34
|
+
super arg
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,202 @@
|
|
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 'uri'
|
14
|
+
|
15
|
+
module Teleswagger
|
16
|
+
class Configuration
|
17
|
+
# Defines url scheme
|
18
|
+
attr_accessor :scheme
|
19
|
+
|
20
|
+
# Defines url host
|
21
|
+
attr_accessor :host
|
22
|
+
|
23
|
+
# Defines url base path
|
24
|
+
attr_accessor :base_path
|
25
|
+
|
26
|
+
# Defines API keys used with API Key authentications.
|
27
|
+
#
|
28
|
+
# @return [Hash] key: parameter name, value: parameter value (API key)
|
29
|
+
#
|
30
|
+
# @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string)
|
31
|
+
# config.api_key['api_key'] = 'xxx'
|
32
|
+
attr_accessor :api_key
|
33
|
+
|
34
|
+
# Defines API key prefixes used with API Key authentications.
|
35
|
+
#
|
36
|
+
# @return [Hash] key: parameter name, value: API key prefix
|
37
|
+
#
|
38
|
+
# @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers)
|
39
|
+
# config.api_key_prefix['api_key'] = 'Token'
|
40
|
+
attr_accessor :api_key_prefix
|
41
|
+
|
42
|
+
# Defines the username used with HTTP basic authentication.
|
43
|
+
#
|
44
|
+
# @return [String]
|
45
|
+
attr_accessor :username
|
46
|
+
|
47
|
+
# Defines the password used with HTTP basic authentication.
|
48
|
+
#
|
49
|
+
# @return [String]
|
50
|
+
attr_accessor :password
|
51
|
+
|
52
|
+
# Defines the access token (Bearer) used with OAuth2.
|
53
|
+
attr_accessor :access_token
|
54
|
+
|
55
|
+
# Set this to enable/disable debugging. When enabled (set to true), HTTP request/response
|
56
|
+
# details will be logged with `logger.debug` (see the `logger` attribute).
|
57
|
+
# Default to false.
|
58
|
+
#
|
59
|
+
# @return [true, false]
|
60
|
+
attr_accessor :debugging
|
61
|
+
|
62
|
+
# Defines the logger used for debugging.
|
63
|
+
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
64
|
+
#
|
65
|
+
# @return [#debug]
|
66
|
+
attr_accessor :logger
|
67
|
+
|
68
|
+
# Defines the temporary folder to store downloaded files
|
69
|
+
# (for API endpoints that have file response).
|
70
|
+
# Default to use `Tempfile`.
|
71
|
+
#
|
72
|
+
# @return [String]
|
73
|
+
attr_accessor :temp_folder_path
|
74
|
+
|
75
|
+
# The time limit for HTTP request in seconds.
|
76
|
+
# Default to 0 (never times out).
|
77
|
+
attr_accessor :timeout
|
78
|
+
|
79
|
+
# Set this to false to skip client side validation in the operation.
|
80
|
+
# Default to true.
|
81
|
+
# @return [true, false]
|
82
|
+
attr_accessor :client_side_validation
|
83
|
+
|
84
|
+
### TLS/SSL setting
|
85
|
+
# Set this to false to skip verifying SSL certificate when calling API from https server.
|
86
|
+
# Default to true.
|
87
|
+
#
|
88
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
89
|
+
#
|
90
|
+
# @return [true, false]
|
91
|
+
attr_accessor :verify_ssl
|
92
|
+
|
93
|
+
### TLS/SSL setting
|
94
|
+
# Set this to false to skip verifying SSL host name
|
95
|
+
# Default to true.
|
96
|
+
#
|
97
|
+
# @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks.
|
98
|
+
#
|
99
|
+
# @return [true, false]
|
100
|
+
attr_accessor :verify_ssl_host
|
101
|
+
|
102
|
+
### TLS/SSL setting
|
103
|
+
# Set this to customize the certificate file to verify the peer.
|
104
|
+
#
|
105
|
+
# @return [String] the path to the certificate file
|
106
|
+
#
|
107
|
+
# @see The `cainfo` option of Typhoeus, `--cert` option of libcurl. Related source code:
|
108
|
+
# https://github.com/typhoeus/typhoeus/blob/master/lib/typhoeus/easy_factory.rb#L145
|
109
|
+
attr_accessor :ssl_ca_cert
|
110
|
+
|
111
|
+
### TLS/SSL setting
|
112
|
+
# Client certificate file (for client certificate)
|
113
|
+
attr_accessor :cert_file
|
114
|
+
|
115
|
+
### TLS/SSL setting
|
116
|
+
# Client private key file (for client certificate)
|
117
|
+
attr_accessor :key_file
|
118
|
+
|
119
|
+
# Set this to customize parameters encoding of array parameter with multi collectionFormat.
|
120
|
+
# Default to nil.
|
121
|
+
#
|
122
|
+
# @see The params_encoding option of Ethon. Related source code:
|
123
|
+
# https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
|
124
|
+
attr_accessor :params_encoding
|
125
|
+
|
126
|
+
attr_accessor :inject_format
|
127
|
+
|
128
|
+
attr_accessor :force_ending_format
|
129
|
+
|
130
|
+
def initialize
|
131
|
+
@scheme = 'https'
|
132
|
+
@host = 'api.telegram.org'
|
133
|
+
@base_path = '/'
|
134
|
+
@api_key = {}
|
135
|
+
@api_key_prefix = {}
|
136
|
+
@timeout = 0
|
137
|
+
@client_side_validation = true
|
138
|
+
@verify_ssl = true
|
139
|
+
@verify_ssl_host = true
|
140
|
+
@params_encoding = nil
|
141
|
+
@cert_file = nil
|
142
|
+
@key_file = nil
|
143
|
+
@debugging = false
|
144
|
+
@inject_format = false
|
145
|
+
@force_ending_format = false
|
146
|
+
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
147
|
+
|
148
|
+
yield(self) if block_given?
|
149
|
+
end
|
150
|
+
|
151
|
+
# The default Configuration object.
|
152
|
+
def self.default
|
153
|
+
@@default ||= Configuration.new
|
154
|
+
end
|
155
|
+
|
156
|
+
def configure
|
157
|
+
yield(self) if block_given?
|
158
|
+
end
|
159
|
+
|
160
|
+
def scheme=(scheme)
|
161
|
+
# remove :// from scheme
|
162
|
+
@scheme = scheme.sub(/:\/\//, '')
|
163
|
+
end
|
164
|
+
|
165
|
+
def host=(host)
|
166
|
+
# remove http(s):// and anything after a slash
|
167
|
+
@host = host.sub(/https?:\/\//, '').split('/').first
|
168
|
+
end
|
169
|
+
|
170
|
+
def base_path=(base_path)
|
171
|
+
# Add leading and trailing slashes to base_path
|
172
|
+
@base_path = "/#{base_path}".gsub(/\/+/, '/')
|
173
|
+
@base_path = "" if @base_path == "/"
|
174
|
+
end
|
175
|
+
|
176
|
+
def base_url
|
177
|
+
url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
|
178
|
+
URI.encode(url)
|
179
|
+
end
|
180
|
+
|
181
|
+
# Gets API key (with prefix if set).
|
182
|
+
# @param [String] param_name the parameter name of API key auth
|
183
|
+
def api_key_with_prefix(param_name)
|
184
|
+
if @api_key_prefix[param_name]
|
185
|
+
"#{@api_key_prefix[param_name]} #{@api_key[param_name]}"
|
186
|
+
else
|
187
|
+
@api_key[param_name]
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
# Gets Basic Auth token string
|
192
|
+
def basic_auth_token
|
193
|
+
'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n")
|
194
|
+
end
|
195
|
+
|
196
|
+
# Returns Auth Settings hash for api client.
|
197
|
+
def auth_settings
|
198
|
+
{
|
199
|
+
}
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
@@ -0,0 +1,244 @@
|
|
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 AddStickerToSetLinkBody
|
18
|
+
attr_accessor :user_id
|
19
|
+
|
20
|
+
attr_accessor :name
|
21
|
+
|
22
|
+
attr_accessor :png_sticker
|
23
|
+
|
24
|
+
attr_accessor :emojis
|
25
|
+
|
26
|
+
attr_accessor :mask_position
|
27
|
+
|
28
|
+
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
30
|
+
def self.attribute_map
|
31
|
+
{
|
32
|
+
:'user_id' => :'user_id',
|
33
|
+
:'name' => :'name',
|
34
|
+
:'png_sticker' => :'png_sticker',
|
35
|
+
:'emojis' => :'emojis',
|
36
|
+
:'mask_position' => :'mask_position'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Attribute type mapping.
|
41
|
+
def self.swagger_types
|
42
|
+
{
|
43
|
+
:'user_id' => :'Integer',
|
44
|
+
:'name' => :'String',
|
45
|
+
:'png_sticker' => :'String',
|
46
|
+
:'emojis' => :'String',
|
47
|
+
:'mask_position' => :'MaskPosition'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# Initializes the object
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
53
|
+
def initialize(attributes = {})
|
54
|
+
return unless attributes.is_a?(Hash)
|
55
|
+
|
56
|
+
# convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
58
|
+
|
59
|
+
if attributes.has_key?(:'user_id')
|
60
|
+
self.user_id = attributes[:'user_id']
|
61
|
+
end
|
62
|
+
|
63
|
+
if attributes.has_key?(:'name')
|
64
|
+
self.name = attributes[:'name']
|
65
|
+
end
|
66
|
+
|
67
|
+
if attributes.has_key?(:'png_sticker')
|
68
|
+
self.png_sticker = attributes[:'png_sticker']
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes.has_key?(:'emojis')
|
72
|
+
self.emojis = attributes[:'emojis']
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes.has_key?(:'mask_position')
|
76
|
+
self.mask_position = attributes[:'mask_position']
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
80
|
+
|
81
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
82
|
+
# @return Array for valid properies with the reasons
|
83
|
+
def list_invalid_properties
|
84
|
+
invalid_properties = Array.new
|
85
|
+
if @user_id.nil?
|
86
|
+
invalid_properties.push("invalid value for 'user_id', user_id cannot be nil.")
|
87
|
+
end
|
88
|
+
|
89
|
+
if @name.nil?
|
90
|
+
invalid_properties.push("invalid value for 'name', name cannot be nil.")
|
91
|
+
end
|
92
|
+
|
93
|
+
if @png_sticker.nil?
|
94
|
+
invalid_properties.push("invalid value for 'png_sticker', png_sticker cannot be nil.")
|
95
|
+
end
|
96
|
+
|
97
|
+
if @emojis.nil?
|
98
|
+
invalid_properties.push("invalid value for 'emojis', emojis cannot be nil.")
|
99
|
+
end
|
100
|
+
|
101
|
+
return invalid_properties
|
102
|
+
end
|
103
|
+
|
104
|
+
# Check to see if the all the properties in the model are valid
|
105
|
+
# @return true if the model is valid
|
106
|
+
def valid?
|
107
|
+
return false if @user_id.nil?
|
108
|
+
return false if @name.nil?
|
109
|
+
return false if @png_sticker.nil?
|
110
|
+
return false if @emojis.nil?
|
111
|
+
return true
|
112
|
+
end
|
113
|
+
|
114
|
+
# Checks equality by comparing each attribute.
|
115
|
+
# @param [Object] Object to be compared
|
116
|
+
def ==(o)
|
117
|
+
return true if self.equal?(o)
|
118
|
+
self.class == o.class &&
|
119
|
+
user_id == o.user_id &&
|
120
|
+
name == o.name &&
|
121
|
+
png_sticker == o.png_sticker &&
|
122
|
+
emojis == o.emojis &&
|
123
|
+
mask_position == o.mask_position
|
124
|
+
end
|
125
|
+
|
126
|
+
# @see the `==` method
|
127
|
+
# @param [Object] Object to be compared
|
128
|
+
def eql?(o)
|
129
|
+
self == o
|
130
|
+
end
|
131
|
+
|
132
|
+
# Calculates hash code according to all attributes.
|
133
|
+
# @return [Fixnum] Hash code
|
134
|
+
def hash
|
135
|
+
[user_id, name, png_sticker, emojis, mask_position].hash
|
136
|
+
end
|
137
|
+
|
138
|
+
# Builds the object from hash
|
139
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
140
|
+
# @return [Object] Returns the model itself
|
141
|
+
def build_from_hash(attributes)
|
142
|
+
return nil unless attributes.is_a?(Hash)
|
143
|
+
self.class.swagger_types.each_pair do |key, type|
|
144
|
+
if type =~ /\AArray<(.*)>/i
|
145
|
+
# check to ensure the input is an array given that the the attribute
|
146
|
+
# is documented as an array but the input is not
|
147
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
148
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
149
|
+
end
|
150
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
151
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
152
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
153
|
+
end
|
154
|
+
|
155
|
+
self
|
156
|
+
end
|
157
|
+
|
158
|
+
# Deserializes the data based on type
|
159
|
+
# @param string type Data type
|
160
|
+
# @param string value Value to be deserialized
|
161
|
+
# @return [Object] Deserialized data
|
162
|
+
def _deserialize(type, value)
|
163
|
+
case type.to_sym
|
164
|
+
when :DateTime
|
165
|
+
DateTime.parse(value)
|
166
|
+
when :Date
|
167
|
+
Date.parse(value)
|
168
|
+
when :String
|
169
|
+
value.to_s
|
170
|
+
when :Integer
|
171
|
+
value.to_i
|
172
|
+
when :Float
|
173
|
+
value.to_f
|
174
|
+
when :BOOLEAN
|
175
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
176
|
+
true
|
177
|
+
else
|
178
|
+
false
|
179
|
+
end
|
180
|
+
when :Object
|
181
|
+
# generic object (usually a Hash), return directly
|
182
|
+
value
|
183
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
184
|
+
inner_type = Regexp.last_match[:inner_type]
|
185
|
+
value.map { |v| _deserialize(inner_type, v) }
|
186
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
187
|
+
k_type = Regexp.last_match[:k_type]
|
188
|
+
v_type = Regexp.last_match[:v_type]
|
189
|
+
{}.tap do |hash|
|
190
|
+
value.each do |k, v|
|
191
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
192
|
+
end
|
193
|
+
end
|
194
|
+
else # model
|
195
|
+
temp_model = Teleswagger.const_get(type).new
|
196
|
+
temp_model.build_from_hash(value)
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
# Returns the string representation of the object
|
201
|
+
# @return [String] String presentation of the object
|
202
|
+
def to_s
|
203
|
+
to_hash.to_s
|
204
|
+
end
|
205
|
+
|
206
|
+
# to_body is an alias to to_hash (backward compatibility)
|
207
|
+
# @return [Hash] Returns the object in the form of hash
|
208
|
+
def to_body
|
209
|
+
to_hash
|
210
|
+
end
|
211
|
+
|
212
|
+
# Returns the object in the form of hash
|
213
|
+
# @return [Hash] Returns the object in the form of hash
|
214
|
+
def to_hash
|
215
|
+
hash = {}
|
216
|
+
self.class.attribute_map.each_pair do |attr, param|
|
217
|
+
value = self.send(attr)
|
218
|
+
next if value.nil?
|
219
|
+
hash[param] = _to_hash(value)
|
220
|
+
end
|
221
|
+
hash
|
222
|
+
end
|
223
|
+
|
224
|
+
# Outputs non-array value in the form of hash
|
225
|
+
# For object, use to_hash. Otherwise, just return the value
|
226
|
+
# @param [Object] value Any valid value
|
227
|
+
# @return [Hash] Returns the value in the form of hash
|
228
|
+
def _to_hash(value)
|
229
|
+
if value.is_a?(Array)
|
230
|
+
value.compact.map{ |v| _to_hash(v) }
|
231
|
+
elsif value.is_a?(Hash)
|
232
|
+
{}.tap do |hash|
|
233
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
234
|
+
end
|
235
|
+
elsif value.respond_to? :to_hash
|
236
|
+
value.to_hash
|
237
|
+
else
|
238
|
+
value
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
end
|
243
|
+
|
244
|
+
end
|