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,401 @@
|
|
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 SendInvoiceBody
|
18
|
+
attr_accessor :chat_id
|
19
|
+
|
20
|
+
attr_accessor :title
|
21
|
+
|
22
|
+
attr_accessor :description
|
23
|
+
|
24
|
+
attr_accessor :payload
|
25
|
+
|
26
|
+
attr_accessor :provider_token
|
27
|
+
|
28
|
+
attr_accessor :start_parameter
|
29
|
+
|
30
|
+
attr_accessor :currency
|
31
|
+
|
32
|
+
attr_accessor :prices
|
33
|
+
|
34
|
+
attr_accessor :photo_url
|
35
|
+
|
36
|
+
attr_accessor :photo_size
|
37
|
+
|
38
|
+
attr_accessor :photo_width
|
39
|
+
|
40
|
+
attr_accessor :photo_height
|
41
|
+
|
42
|
+
attr_accessor :need_name
|
43
|
+
|
44
|
+
attr_accessor :need_phone_number
|
45
|
+
|
46
|
+
attr_accessor :need_email
|
47
|
+
|
48
|
+
attr_accessor :need_shipping_address
|
49
|
+
|
50
|
+
attr_accessor :is_flexible
|
51
|
+
|
52
|
+
attr_accessor :disable_notification
|
53
|
+
|
54
|
+
attr_accessor :reply_to_message_id
|
55
|
+
|
56
|
+
attr_accessor :reply_markup
|
57
|
+
|
58
|
+
|
59
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
60
|
+
def self.attribute_map
|
61
|
+
{
|
62
|
+
:'chat_id' => :'chat_id',
|
63
|
+
:'title' => :'title',
|
64
|
+
:'description' => :'description',
|
65
|
+
:'payload' => :'payload',
|
66
|
+
:'provider_token' => :'provider_token',
|
67
|
+
:'start_parameter' => :'start_parameter',
|
68
|
+
:'currency' => :'currency',
|
69
|
+
:'prices' => :'prices',
|
70
|
+
:'photo_url' => :'photo_url',
|
71
|
+
:'photo_size' => :'photo_size',
|
72
|
+
:'photo_width' => :'photo_width',
|
73
|
+
:'photo_height' => :'photo_height',
|
74
|
+
:'need_name' => :'need_name',
|
75
|
+
:'need_phone_number' => :'need_phone_number',
|
76
|
+
:'need_email' => :'need_email',
|
77
|
+
:'need_shipping_address' => :'need_shipping_address',
|
78
|
+
:'is_flexible' => :'is_flexible',
|
79
|
+
:'disable_notification' => :'disable_notification',
|
80
|
+
:'reply_to_message_id' => :'reply_to_message_id',
|
81
|
+
:'reply_markup' => :'reply_markup'
|
82
|
+
}
|
83
|
+
end
|
84
|
+
|
85
|
+
# Attribute type mapping.
|
86
|
+
def self.swagger_types
|
87
|
+
{
|
88
|
+
:'chat_id' => :'Integer',
|
89
|
+
:'title' => :'String',
|
90
|
+
:'description' => :'String',
|
91
|
+
:'payload' => :'String',
|
92
|
+
:'provider_token' => :'String',
|
93
|
+
:'start_parameter' => :'String',
|
94
|
+
:'currency' => :'String',
|
95
|
+
:'prices' => :'Array<LabeledPrice>',
|
96
|
+
:'photo_url' => :'String',
|
97
|
+
:'photo_size' => :'Integer',
|
98
|
+
:'photo_width' => :'Integer',
|
99
|
+
:'photo_height' => :'Integer',
|
100
|
+
:'need_name' => :'BOOLEAN',
|
101
|
+
:'need_phone_number' => :'BOOLEAN',
|
102
|
+
:'need_email' => :'BOOLEAN',
|
103
|
+
:'need_shipping_address' => :'BOOLEAN',
|
104
|
+
:'is_flexible' => :'BOOLEAN',
|
105
|
+
:'disable_notification' => :'BOOLEAN',
|
106
|
+
:'reply_to_message_id' => :'Integer',
|
107
|
+
:'reply_markup' => :'Object'
|
108
|
+
}
|
109
|
+
end
|
110
|
+
|
111
|
+
# Initializes the object
|
112
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
113
|
+
def initialize(attributes = {})
|
114
|
+
return unless attributes.is_a?(Hash)
|
115
|
+
|
116
|
+
# convert string to symbol for hash key
|
117
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
118
|
+
|
119
|
+
if attributes.has_key?(:'chat_id')
|
120
|
+
self.chat_id = attributes[:'chat_id']
|
121
|
+
end
|
122
|
+
|
123
|
+
if attributes.has_key?(:'title')
|
124
|
+
self.title = attributes[:'title']
|
125
|
+
end
|
126
|
+
|
127
|
+
if attributes.has_key?(:'description')
|
128
|
+
self.description = attributes[:'description']
|
129
|
+
end
|
130
|
+
|
131
|
+
if attributes.has_key?(:'payload')
|
132
|
+
self.payload = attributes[:'payload']
|
133
|
+
end
|
134
|
+
|
135
|
+
if attributes.has_key?(:'provider_token')
|
136
|
+
self.provider_token = attributes[:'provider_token']
|
137
|
+
end
|
138
|
+
|
139
|
+
if attributes.has_key?(:'start_parameter')
|
140
|
+
self.start_parameter = attributes[:'start_parameter']
|
141
|
+
end
|
142
|
+
|
143
|
+
if attributes.has_key?(:'currency')
|
144
|
+
self.currency = attributes[:'currency']
|
145
|
+
end
|
146
|
+
|
147
|
+
if attributes.has_key?(:'prices')
|
148
|
+
if (value = attributes[:'prices']).is_a?(Array)
|
149
|
+
self.prices = value
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
if attributes.has_key?(:'photo_url')
|
154
|
+
self.photo_url = attributes[:'photo_url']
|
155
|
+
end
|
156
|
+
|
157
|
+
if attributes.has_key?(:'photo_size')
|
158
|
+
self.photo_size = attributes[:'photo_size']
|
159
|
+
end
|
160
|
+
|
161
|
+
if attributes.has_key?(:'photo_width')
|
162
|
+
self.photo_width = attributes[:'photo_width']
|
163
|
+
end
|
164
|
+
|
165
|
+
if attributes.has_key?(:'photo_height')
|
166
|
+
self.photo_height = attributes[:'photo_height']
|
167
|
+
end
|
168
|
+
|
169
|
+
if attributes.has_key?(:'need_name')
|
170
|
+
self.need_name = attributes[:'need_name']
|
171
|
+
end
|
172
|
+
|
173
|
+
if attributes.has_key?(:'need_phone_number')
|
174
|
+
self.need_phone_number = attributes[:'need_phone_number']
|
175
|
+
end
|
176
|
+
|
177
|
+
if attributes.has_key?(:'need_email')
|
178
|
+
self.need_email = attributes[:'need_email']
|
179
|
+
end
|
180
|
+
|
181
|
+
if attributes.has_key?(:'need_shipping_address')
|
182
|
+
self.need_shipping_address = attributes[:'need_shipping_address']
|
183
|
+
end
|
184
|
+
|
185
|
+
if attributes.has_key?(:'is_flexible')
|
186
|
+
self.is_flexible = attributes[:'is_flexible']
|
187
|
+
end
|
188
|
+
|
189
|
+
if attributes.has_key?(:'disable_notification')
|
190
|
+
self.disable_notification = attributes[:'disable_notification']
|
191
|
+
end
|
192
|
+
|
193
|
+
if attributes.has_key?(:'reply_to_message_id')
|
194
|
+
self.reply_to_message_id = attributes[:'reply_to_message_id']
|
195
|
+
end
|
196
|
+
|
197
|
+
if attributes.has_key?(:'reply_markup')
|
198
|
+
self.reply_markup = attributes[:'reply_markup']
|
199
|
+
end
|
200
|
+
|
201
|
+
end
|
202
|
+
|
203
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
204
|
+
# @return Array for valid properies with the reasons
|
205
|
+
def list_invalid_properties
|
206
|
+
invalid_properties = Array.new
|
207
|
+
if @chat_id.nil?
|
208
|
+
invalid_properties.push("invalid value for 'chat_id', chat_id cannot be nil.")
|
209
|
+
end
|
210
|
+
|
211
|
+
if @title.nil?
|
212
|
+
invalid_properties.push("invalid value for 'title', title cannot be nil.")
|
213
|
+
end
|
214
|
+
|
215
|
+
if @description.nil?
|
216
|
+
invalid_properties.push("invalid value for 'description', description cannot be nil.")
|
217
|
+
end
|
218
|
+
|
219
|
+
if @payload.nil?
|
220
|
+
invalid_properties.push("invalid value for 'payload', payload cannot be nil.")
|
221
|
+
end
|
222
|
+
|
223
|
+
if @provider_token.nil?
|
224
|
+
invalid_properties.push("invalid value for 'provider_token', provider_token cannot be nil.")
|
225
|
+
end
|
226
|
+
|
227
|
+
if @start_parameter.nil?
|
228
|
+
invalid_properties.push("invalid value for 'start_parameter', start_parameter cannot be nil.")
|
229
|
+
end
|
230
|
+
|
231
|
+
if @currency.nil?
|
232
|
+
invalid_properties.push("invalid value for 'currency', currency cannot be nil.")
|
233
|
+
end
|
234
|
+
|
235
|
+
if @prices.nil?
|
236
|
+
invalid_properties.push("invalid value for 'prices', prices cannot be nil.")
|
237
|
+
end
|
238
|
+
|
239
|
+
return invalid_properties
|
240
|
+
end
|
241
|
+
|
242
|
+
# Check to see if the all the properties in the model are valid
|
243
|
+
# @return true if the model is valid
|
244
|
+
def valid?
|
245
|
+
return false if @chat_id.nil?
|
246
|
+
return false if @title.nil?
|
247
|
+
return false if @description.nil?
|
248
|
+
return false if @payload.nil?
|
249
|
+
return false if @provider_token.nil?
|
250
|
+
return false if @start_parameter.nil?
|
251
|
+
return false if @currency.nil?
|
252
|
+
return false if @prices.nil?
|
253
|
+
return true
|
254
|
+
end
|
255
|
+
|
256
|
+
# Checks equality by comparing each attribute.
|
257
|
+
# @param [Object] Object to be compared
|
258
|
+
def ==(o)
|
259
|
+
return true if self.equal?(o)
|
260
|
+
self.class == o.class &&
|
261
|
+
chat_id == o.chat_id &&
|
262
|
+
title == o.title &&
|
263
|
+
description == o.description &&
|
264
|
+
payload == o.payload &&
|
265
|
+
provider_token == o.provider_token &&
|
266
|
+
start_parameter == o.start_parameter &&
|
267
|
+
currency == o.currency &&
|
268
|
+
prices == o.prices &&
|
269
|
+
photo_url == o.photo_url &&
|
270
|
+
photo_size == o.photo_size &&
|
271
|
+
photo_width == o.photo_width &&
|
272
|
+
photo_height == o.photo_height &&
|
273
|
+
need_name == o.need_name &&
|
274
|
+
need_phone_number == o.need_phone_number &&
|
275
|
+
need_email == o.need_email &&
|
276
|
+
need_shipping_address == o.need_shipping_address &&
|
277
|
+
is_flexible == o.is_flexible &&
|
278
|
+
disable_notification == o.disable_notification &&
|
279
|
+
reply_to_message_id == o.reply_to_message_id &&
|
280
|
+
reply_markup == o.reply_markup
|
281
|
+
end
|
282
|
+
|
283
|
+
# @see the `==` method
|
284
|
+
# @param [Object] Object to be compared
|
285
|
+
def eql?(o)
|
286
|
+
self == o
|
287
|
+
end
|
288
|
+
|
289
|
+
# Calculates hash code according to all attributes.
|
290
|
+
# @return [Fixnum] Hash code
|
291
|
+
def hash
|
292
|
+
[chat_id, title, description, payload, provider_token, start_parameter, currency, prices, photo_url, photo_size, photo_width, photo_height, need_name, need_phone_number, need_email, need_shipping_address, is_flexible, disable_notification, reply_to_message_id, reply_markup].hash
|
293
|
+
end
|
294
|
+
|
295
|
+
# Builds the object from hash
|
296
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
297
|
+
# @return [Object] Returns the model itself
|
298
|
+
def build_from_hash(attributes)
|
299
|
+
return nil unless attributes.is_a?(Hash)
|
300
|
+
self.class.swagger_types.each_pair do |key, type|
|
301
|
+
if type =~ /\AArray<(.*)>/i
|
302
|
+
# check to ensure the input is an array given that the the attribute
|
303
|
+
# is documented as an array but the input is not
|
304
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
305
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
306
|
+
end
|
307
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
308
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
309
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
310
|
+
end
|
311
|
+
|
312
|
+
self
|
313
|
+
end
|
314
|
+
|
315
|
+
# Deserializes the data based on type
|
316
|
+
# @param string type Data type
|
317
|
+
# @param string value Value to be deserialized
|
318
|
+
# @return [Object] Deserialized data
|
319
|
+
def _deserialize(type, value)
|
320
|
+
case type.to_sym
|
321
|
+
when :DateTime
|
322
|
+
DateTime.parse(value)
|
323
|
+
when :Date
|
324
|
+
Date.parse(value)
|
325
|
+
when :String
|
326
|
+
value.to_s
|
327
|
+
when :Integer
|
328
|
+
value.to_i
|
329
|
+
when :Float
|
330
|
+
value.to_f
|
331
|
+
when :BOOLEAN
|
332
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
333
|
+
true
|
334
|
+
else
|
335
|
+
false
|
336
|
+
end
|
337
|
+
when :Object
|
338
|
+
# generic object (usually a Hash), return directly
|
339
|
+
value
|
340
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
341
|
+
inner_type = Regexp.last_match[:inner_type]
|
342
|
+
value.map { |v| _deserialize(inner_type, v) }
|
343
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
344
|
+
k_type = Regexp.last_match[:k_type]
|
345
|
+
v_type = Regexp.last_match[:v_type]
|
346
|
+
{}.tap do |hash|
|
347
|
+
value.each do |k, v|
|
348
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
349
|
+
end
|
350
|
+
end
|
351
|
+
else # model
|
352
|
+
temp_model = Teleswagger.const_get(type).new
|
353
|
+
temp_model.build_from_hash(value)
|
354
|
+
end
|
355
|
+
end
|
356
|
+
|
357
|
+
# Returns the string representation of the object
|
358
|
+
# @return [String] String presentation of the object
|
359
|
+
def to_s
|
360
|
+
to_hash.to_s
|
361
|
+
end
|
362
|
+
|
363
|
+
# to_body is an alias to to_hash (backward compatibility)
|
364
|
+
# @return [Hash] Returns the object in the form of hash
|
365
|
+
def to_body
|
366
|
+
to_hash
|
367
|
+
end
|
368
|
+
|
369
|
+
# Returns the object in the form of hash
|
370
|
+
# @return [Hash] Returns the object in the form of hash
|
371
|
+
def to_hash
|
372
|
+
hash = {}
|
373
|
+
self.class.attribute_map.each_pair do |attr, param|
|
374
|
+
value = self.send(attr)
|
375
|
+
next if value.nil?
|
376
|
+
hash[param] = _to_hash(value)
|
377
|
+
end
|
378
|
+
hash
|
379
|
+
end
|
380
|
+
|
381
|
+
# Outputs non-array value in the form of hash
|
382
|
+
# For object, use to_hash. Otherwise, just return the value
|
383
|
+
# @param [Object] value Any valid value
|
384
|
+
# @return [Hash] Returns the value in the form of hash
|
385
|
+
def _to_hash(value)
|
386
|
+
if value.is_a?(Array)
|
387
|
+
value.compact.map{ |v| _to_hash(v) }
|
388
|
+
elsif value.is_a?(Hash)
|
389
|
+
{}.tap do |hash|
|
390
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
391
|
+
end
|
392
|
+
elsif value.respond_to? :to_hash
|
393
|
+
value.to_hash
|
394
|
+
else
|
395
|
+
value
|
396
|
+
end
|
397
|
+
end
|
398
|
+
|
399
|
+
end
|
400
|
+
|
401
|
+
end
|
@@ -0,0 +1,248 @@
|
|
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 SendLocationBody
|
18
|
+
attr_accessor :chat_id
|
19
|
+
|
20
|
+
attr_accessor :latitude
|
21
|
+
|
22
|
+
attr_accessor :longitude
|
23
|
+
|
24
|
+
attr_accessor :disable_notification
|
25
|
+
|
26
|
+
attr_accessor :reply_to_message_id
|
27
|
+
|
28
|
+
attr_accessor :reply_markup
|
29
|
+
|
30
|
+
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
32
|
+
def self.attribute_map
|
33
|
+
{
|
34
|
+
:'chat_id' => :'chat_id',
|
35
|
+
:'latitude' => :'latitude',
|
36
|
+
:'longitude' => :'longitude',
|
37
|
+
:'disable_notification' => :'disable_notification',
|
38
|
+
:'reply_to_message_id' => :'reply_to_message_id',
|
39
|
+
:'reply_markup' => :'reply_markup'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# Attribute type mapping.
|
44
|
+
def self.swagger_types
|
45
|
+
{
|
46
|
+
:'chat_id' => :'Object',
|
47
|
+
:'latitude' => :'Float',
|
48
|
+
:'longitude' => :'Float',
|
49
|
+
:'disable_notification' => :'BOOLEAN',
|
50
|
+
:'reply_to_message_id' => :'Integer',
|
51
|
+
:'reply_markup' => :'Object'
|
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?(:'chat_id')
|
64
|
+
self.chat_id = attributes[:'chat_id']
|
65
|
+
end
|
66
|
+
|
67
|
+
if attributes.has_key?(:'latitude')
|
68
|
+
self.latitude = attributes[:'latitude']
|
69
|
+
end
|
70
|
+
|
71
|
+
if attributes.has_key?(:'longitude')
|
72
|
+
self.longitude = attributes[:'longitude']
|
73
|
+
end
|
74
|
+
|
75
|
+
if attributes.has_key?(:'disable_notification')
|
76
|
+
self.disable_notification = attributes[:'disable_notification']
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.has_key?(:'reply_to_message_id')
|
80
|
+
self.reply_to_message_id = attributes[:'reply_to_message_id']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.has_key?(:'reply_markup')
|
84
|
+
self.reply_markup = attributes[:'reply_markup']
|
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
|
+
if @chat_id.nil?
|
94
|
+
invalid_properties.push("invalid value for 'chat_id', chat_id cannot be nil.")
|
95
|
+
end
|
96
|
+
|
97
|
+
if @latitude.nil?
|
98
|
+
invalid_properties.push("invalid value for 'latitude', latitude cannot be nil.")
|
99
|
+
end
|
100
|
+
|
101
|
+
if @longitude.nil?
|
102
|
+
invalid_properties.push("invalid value for 'longitude', longitude cannot be nil.")
|
103
|
+
end
|
104
|
+
|
105
|
+
return invalid_properties
|
106
|
+
end
|
107
|
+
|
108
|
+
# Check to see if the all the properties in the model are valid
|
109
|
+
# @return true if the model is valid
|
110
|
+
def valid?
|
111
|
+
return false if @chat_id.nil?
|
112
|
+
return false if @latitude.nil?
|
113
|
+
return false if @longitude.nil?
|
114
|
+
return true
|
115
|
+
end
|
116
|
+
|
117
|
+
# Checks equality by comparing each attribute.
|
118
|
+
# @param [Object] Object to be compared
|
119
|
+
def ==(o)
|
120
|
+
return true if self.equal?(o)
|
121
|
+
self.class == o.class &&
|
122
|
+
chat_id == o.chat_id &&
|
123
|
+
latitude == o.latitude &&
|
124
|
+
longitude == o.longitude &&
|
125
|
+
disable_notification == o.disable_notification &&
|
126
|
+
reply_to_message_id == o.reply_to_message_id &&
|
127
|
+
reply_markup == o.reply_markup
|
128
|
+
end
|
129
|
+
|
130
|
+
# @see the `==` method
|
131
|
+
# @param [Object] Object to be compared
|
132
|
+
def eql?(o)
|
133
|
+
self == o
|
134
|
+
end
|
135
|
+
|
136
|
+
# Calculates hash code according to all attributes.
|
137
|
+
# @return [Fixnum] Hash code
|
138
|
+
def hash
|
139
|
+
[chat_id, latitude, longitude, disable_notification, reply_to_message_id, reply_markup].hash
|
140
|
+
end
|
141
|
+
|
142
|
+
# Builds the object from hash
|
143
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
144
|
+
# @return [Object] Returns the model itself
|
145
|
+
def build_from_hash(attributes)
|
146
|
+
return nil unless attributes.is_a?(Hash)
|
147
|
+
self.class.swagger_types.each_pair do |key, type|
|
148
|
+
if type =~ /\AArray<(.*)>/i
|
149
|
+
# check to ensure the input is an array given that the the attribute
|
150
|
+
# is documented as an array but the input is not
|
151
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
152
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
153
|
+
end
|
154
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
155
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
156
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
157
|
+
end
|
158
|
+
|
159
|
+
self
|
160
|
+
end
|
161
|
+
|
162
|
+
# Deserializes the data based on type
|
163
|
+
# @param string type Data type
|
164
|
+
# @param string value Value to be deserialized
|
165
|
+
# @return [Object] Deserialized data
|
166
|
+
def _deserialize(type, value)
|
167
|
+
case type.to_sym
|
168
|
+
when :DateTime
|
169
|
+
DateTime.parse(value)
|
170
|
+
when :Date
|
171
|
+
Date.parse(value)
|
172
|
+
when :String
|
173
|
+
value.to_s
|
174
|
+
when :Integer
|
175
|
+
value.to_i
|
176
|
+
when :Float
|
177
|
+
value.to_f
|
178
|
+
when :BOOLEAN
|
179
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
180
|
+
true
|
181
|
+
else
|
182
|
+
false
|
183
|
+
end
|
184
|
+
when :Object
|
185
|
+
# generic object (usually a Hash), return directly
|
186
|
+
value
|
187
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
188
|
+
inner_type = Regexp.last_match[:inner_type]
|
189
|
+
value.map { |v| _deserialize(inner_type, v) }
|
190
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
191
|
+
k_type = Regexp.last_match[:k_type]
|
192
|
+
v_type = Regexp.last_match[:v_type]
|
193
|
+
{}.tap do |hash|
|
194
|
+
value.each do |k, v|
|
195
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
196
|
+
end
|
197
|
+
end
|
198
|
+
else # model
|
199
|
+
temp_model = Teleswagger.const_get(type).new
|
200
|
+
temp_model.build_from_hash(value)
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
# Returns the string representation of the object
|
205
|
+
# @return [String] String presentation of the object
|
206
|
+
def to_s
|
207
|
+
to_hash.to_s
|
208
|
+
end
|
209
|
+
|
210
|
+
# to_body is an alias to to_hash (backward compatibility)
|
211
|
+
# @return [Hash] Returns the object in the form of hash
|
212
|
+
def to_body
|
213
|
+
to_hash
|
214
|
+
end
|
215
|
+
|
216
|
+
# Returns the object in the form of hash
|
217
|
+
# @return [Hash] Returns the object in the form of hash
|
218
|
+
def to_hash
|
219
|
+
hash = {}
|
220
|
+
self.class.attribute_map.each_pair do |attr, param|
|
221
|
+
value = self.send(attr)
|
222
|
+
next if value.nil?
|
223
|
+
hash[param] = _to_hash(value)
|
224
|
+
end
|
225
|
+
hash
|
226
|
+
end
|
227
|
+
|
228
|
+
# Outputs non-array value in the form of hash
|
229
|
+
# For object, use to_hash. Otherwise, just return the value
|
230
|
+
# @param [Object] value Any valid value
|
231
|
+
# @return [Hash] Returns the value in the form of hash
|
232
|
+
def _to_hash(value)
|
233
|
+
if value.is_a?(Array)
|
234
|
+
value.compact.map{ |v| _to_hash(v) }
|
235
|
+
elsif value.is_a?(Hash)
|
236
|
+
{}.tap do |hash|
|
237
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
238
|
+
end
|
239
|
+
elsif value.respond_to? :to_hash
|
240
|
+
value.to_hash
|
241
|
+
else
|
242
|
+
value
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
246
|
+
end
|
247
|
+
|
248
|
+
end
|