teleswagger 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -5
- data/LICENSE +201 -0
- data/README.md +88 -74
- data/docs/AnswerCallbackQueryBody.md +12 -0
- data/docs/AttachmentsApi.md +166 -3
- data/docs/CallbacksApi.md +6 -18
- data/docs/Chat.md +2 -0
- data/docs/ChatsApi.md +112 -9
- data/docs/EditMessageCaptionBody.md +1 -0
- data/docs/EditMessageLiveLocationBody.md +13 -0
- data/docs/GamesApi.md +5 -5
- data/docs/GetUpdatesBody.md +11 -0
- data/docs/InlineApi.md +1 -1
- data/docs/InlineQueryResultAudio.md +1 -0
- data/docs/InlineQueryResultCachedAudio.md +1 -0
- data/docs/InlineQueryResultCachedDocument.md +1 -0
- data/docs/InlineQueryResultCachedGif.md +1 -0
- data/docs/InlineQueryResultCachedMpeg4Gif.md +1 -0
- data/docs/InlineQueryResultCachedPhoto.md +1 -0
- data/docs/InlineQueryResultCachedVideo.md +1 -0
- data/docs/InlineQueryResultCachedVoice.md +1 -0
- data/docs/InlineQueryResultDocument.md +1 -0
- data/docs/InlineQueryResultGif.md +1 -0
- data/docs/InlineQueryResultLocation.md +1 -0
- data/docs/InlineQueryResultMpeg4Gif.md +1 -0
- data/docs/InlineQueryResultPhoto.md +1 -0
- data/docs/InlineQueryResultVideo.md +1 -0
- data/docs/InlineQueryResultVoice.md +1 -0
- data/docs/InlineResponse200.md +1 -1
- data/docs/InlineResponse2001.md +1 -1
- data/docs/InlineResponse2002.md +1 -1
- data/docs/InlineResponse2003.md +1 -1
- data/docs/InlineResponse2004.md +1 -1
- data/docs/InlineResponse2005.md +1 -1
- data/docs/InlineResponse2006.md +1 -1
- data/docs/InlineResponse2007.md +1 -1
- data/docs/InlineResponse2008.md +1 -1
- data/docs/InlineResponse2009.md +1 -1
- data/docs/InputLocationMessageContent.md +1 -0
- data/docs/InputMediaPhoto.md +11 -0
- data/docs/InputMediaVideo.md +15 -0
- data/docs/Message.md +3 -0
- data/docs/MessagesApi.md +7 -7
- data/docs/PaymentsApi.md +1 -1
- data/docs/ReplyKeyboardMarkup.md +1 -1
- data/docs/SendInvoiceBody.md +1 -0
- data/docs/SendLocationBody.md +1 -0
- data/docs/SendMediaGroupLinkBody.md +11 -0
- data/docs/StickersApi.md +3 -3
- data/docs/StopMessageLiveLocationBody.md +11 -0
- data/docs/UpdatesApi.md +4 -8
- data/docs/UsersApi.md +5 -5
- data/git_push.sh +67 -0
- data/lib/teleswagger.rb +20 -2
- data/lib/teleswagger/api/attachments_api.rb +367 -158
- data/lib/teleswagger/api/callbacks_api.rb +29 -47
- data/lib/teleswagger/api/chats_api.rb +316 -192
- data/lib/teleswagger/api/games_api.rb +46 -35
- data/lib/teleswagger/api/inline_api.rb +21 -8
- data/lib/teleswagger/api/messages_api.rb +84 -71
- data/lib/teleswagger/api/payments_api.rb +39 -26
- data/lib/teleswagger/api/stickers_api.rb +107 -116
- data/lib/teleswagger/api/updates_api.rb +50 -39
- data/lib/teleswagger/api/users_api.rb +36 -23
- data/lib/teleswagger/api_client.rb +45 -55
- data/lib/teleswagger/api_error.rb +18 -9
- data/lib/teleswagger/configuration.rb +13 -8
- data/lib/teleswagger/models/add_sticker_to_set_link_body.rb +16 -21
- data/lib/teleswagger/models/allowed_update.rb +15 -2
- data/lib/teleswagger/models/animation.rb +16 -9
- data/lib/teleswagger/models/answer_callback_query_body.rb +235 -0
- data/lib/teleswagger/models/answer_inline_query_body.rb +16 -13
- data/lib/teleswagger/models/answer_shipping_query_body.rb +16 -13
- data/lib/teleswagger/models/audio.rb +16 -5
- data/lib/teleswagger/models/callback_game.rb +16 -5
- data/lib/teleswagger/models/callback_query.rb +16 -5
- data/lib/teleswagger/models/chat.rb +38 -17
- data/lib/teleswagger/models/chat_member.rb +16 -13
- data/lib/teleswagger/models/chat_photo.rb +16 -5
- data/lib/teleswagger/models/chosen_inline_result.rb +16 -17
- data/lib/teleswagger/models/contact.rb +16 -5
- data/lib/teleswagger/models/create_new_sticker_set_link_body.rb +16 -25
- data/lib/teleswagger/models/document.rb +16 -5
- data/lib/teleswagger/models/edit_message_caption_body.rb +26 -6
- data/lib/teleswagger/models/edit_message_live_location_body.rb +246 -0
- data/lib/teleswagger/models/edit_message_reply_markup_body.rb +16 -5
- data/lib/teleswagger/models/edit_message_text_body.rb +16 -9
- data/lib/teleswagger/models/error.rb +16 -5
- data/lib/teleswagger/models/file.rb +16 -5
- data/lib/teleswagger/models/force_reply.rb +16 -5
- data/lib/teleswagger/models/game.rb +16 -17
- data/lib/teleswagger/models/game_high_score.rb +16 -5
- data/lib/teleswagger/models/get_updates_body.rb +228 -0
- data/lib/teleswagger/models/inline_keyboard_button.rb +16 -5
- data/lib/teleswagger/models/inline_keyboard_markup.rb +16 -5
- data/lib/teleswagger/models/inline_query.rb +16 -5
- data/lib/teleswagger/models/inline_query_result_article.rb +16 -21
- data/lib/teleswagger/models/inline_query_result_audio.rb +26 -22
- data/lib/teleswagger/models/inline_query_result_cached_audio.rb +26 -18
- data/lib/teleswagger/models/inline_query_result_cached_document.rb +26 -18
- data/lib/teleswagger/models/inline_query_result_cached_gif.rb +26 -18
- data/lib/teleswagger/models/inline_query_result_cached_mpeg4_gif.rb +26 -18
- data/lib/teleswagger/models/inline_query_result_cached_photo.rb +26 -18
- data/lib/teleswagger/models/inline_query_result_cached_sticker.rb +16 -17
- data/lib/teleswagger/models/inline_query_result_cached_video.rb +26 -18
- data/lib/teleswagger/models/inline_query_result_cached_voice.rb +26 -18
- data/lib/teleswagger/models/inline_query_result_contact.rb +16 -21
- data/lib/teleswagger/models/inline_query_result_document.rb +26 -26
- data/lib/teleswagger/models/inline_query_result_game.rb +16 -17
- data/lib/teleswagger/models/inline_query_result_gif.rb +26 -22
- data/lib/teleswagger/models/inline_query_result_location.rb +50 -24
- data/lib/teleswagger/models/inline_query_result_mpeg4_gif.rb +26 -22
- data/lib/teleswagger/models/inline_query_result_photo.rb +26 -22
- data/lib/teleswagger/models/inline_query_result_venue.rb +16 -29
- data/lib/teleswagger/models/inline_query_result_video.rb +26 -30
- data/lib/teleswagger/models/inline_query_result_voice.rb +26 -22
- data/lib/teleswagger/models/inline_response_200.rb +17 -6
- data/lib/teleswagger/models/inline_response_200_1.rb +17 -6
- data/lib/teleswagger/models/inline_response_200_2.rb +20 -7
- data/lib/teleswagger/models/inline_response_200_3.rb +17 -6
- data/lib/teleswagger/models/inline_response_200_4.rb +18 -9
- data/lib/teleswagger/models/inline_response_200_5.rb +17 -6
- data/lib/teleswagger/models/inline_response_200_6.rb +17 -6
- data/lib/teleswagger/models/inline_response_200_7.rb +17 -6
- data/lib/teleswagger/models/inline_response_200_8.rb +17 -6
- data/lib/teleswagger/models/inline_response_200_9.rb +17 -6
- data/lib/teleswagger/models/inline_type.rb +13 -2
- data/lib/teleswagger/models/input_contact_message_content.rb +16 -13
- data/lib/teleswagger/models/input_location_message_content.rb +51 -13
- data/lib/teleswagger/models/input_media_photo.rb +228 -0
- data/lib/teleswagger/models/input_media_video.rb +264 -0
- data/lib/teleswagger/models/input_text_message_content.rb +16 -9
- data/lib/teleswagger/models/input_venue_message_content.rb +16 -21
- data/lib/teleswagger/models/invoice.rb +16 -5
- data/lib/teleswagger/models/keyboard_button.rb +16 -5
- data/lib/teleswagger/models/labeled_price.rb +16 -5
- data/lib/teleswagger/models/location.rb +16 -5
- data/lib/teleswagger/models/mask_position.rb +16 -5
- data/lib/teleswagger/models/message.rb +49 -9
- data/lib/teleswagger/models/message_entity.rb +16 -5
- data/lib/teleswagger/models/order_info.rb +16 -5
- data/lib/teleswagger/models/parse_mode.rb +13 -2
- data/lib/teleswagger/models/photo_size.rb +16 -5
- data/lib/teleswagger/models/pre_checkout_query.rb +16 -5
- data/lib/teleswagger/models/promote_chat_member_body.rb +16 -13
- data/lib/teleswagger/models/reply_keyboard_markup.rb +17 -6
- data/lib/teleswagger/models/reply_keyboard_remove.rb +16 -5
- data/lib/teleswagger/models/response_bool.rb +16 -5
- data/lib/teleswagger/models/response_message.rb +16 -5
- data/lib/teleswagger/models/response_parameters.rb +16 -5
- data/lib/teleswagger/models/response_update.rb +16 -5
- data/lib/teleswagger/models/restrict_chat_member_body.rb +16 -13
- data/lib/teleswagger/models/send_audio_link_body.rb +16 -13
- data/lib/teleswagger/models/send_contact_body.rb +16 -17
- data/lib/teleswagger/models/send_document_link_body.rb +16 -13
- data/lib/teleswagger/models/send_game_body.rb +16 -13
- data/lib/teleswagger/models/send_invoice_body.rb +26 -38
- data/lib/teleswagger/models/send_location_body.rb +50 -16
- data/lib/teleswagger/models/send_media_group_link_body.rb +230 -0
- data/lib/teleswagger/models/send_message_body.rb +16 -13
- data/lib/teleswagger/models/send_photo_link_body.rb +16 -13
- data/lib/teleswagger/models/send_sticker_link_body.rb +16 -13
- data/lib/teleswagger/models/send_venue_body.rb +16 -25
- data/lib/teleswagger/models/send_video_link_body.rb +16 -13
- data/lib/teleswagger/models/send_video_note_link_body.rb +16 -13
- data/lib/teleswagger/models/send_voice_link_body.rb +16 -13
- data/lib/teleswagger/models/shipping_address.rb +16 -5
- data/lib/teleswagger/models/shipping_option.rb +16 -5
- data/lib/teleswagger/models/shipping_query.rb +16 -5
- data/lib/teleswagger/models/sticker.rb +16 -5
- data/lib/teleswagger/models/sticker_set.rb +16 -5
- data/lib/teleswagger/models/stop_message_live_location_body.rb +226 -0
- data/lib/teleswagger/models/successful_payment.rb +16 -5
- data/lib/teleswagger/models/update.rb +16 -5
- data/lib/teleswagger/models/user.rb +16 -5
- data/lib/teleswagger/models/user_profile_photos.rb +16 -5
- data/lib/teleswagger/models/venue.rb +16 -5
- data/lib/teleswagger/models/video.rb +16 -5
- data/lib/teleswagger/models/video_note.rb +16 -5
- data/lib/teleswagger/models/voice.rb +16 -5
- data/lib/teleswagger/models/webhook_info.rb +16 -17
- data/lib/teleswagger/version.rb +15 -4
- data/spec/models/answer_callback_query_body_spec.rb +77 -0
- data/spec/models/edit_message_live_location_body_spec.rb +83 -0
- data/spec/models/get_updates_body_spec.rb +71 -0
- data/spec/models/input_media_photo_spec.rb +71 -0
- data/spec/models/input_media_video_spec.rb +95 -0
- data/spec/models/send_media_group_link_body_spec.rb +71 -0
- data/spec/models/stop_message_live_location_body_spec.rb +71 -0
- data/swagger.yaml +428 -52
- data/teleswagger.gemspec +17 -8
- metadata +45 -14
|
@@ -3,10 +3,21 @@
|
|
|
3
3
|
|
|
4
4
|
#This is a swagger defenition for [Telegram bot API](https://core.telegram.org/bots/api).
|
|
5
5
|
|
|
6
|
-
OpenAPI spec version: 3.
|
|
6
|
+
OpenAPI spec version: 3.6
|
|
7
7
|
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
+
you may not use this file except in compliance with the License.
|
|
12
|
+
You may obtain a copy of the License at
|
|
13
|
+
|
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
|
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
See the License for the specific language governing permissions and
|
|
20
|
+
limitations under the License.
|
|
10
21
|
|
|
11
22
|
=end
|
|
12
23
|
|
|
@@ -82,18 +93,6 @@ module Teleswagger
|
|
|
82
93
|
# @return Array for valid properies with the reasons
|
|
83
94
|
def list_invalid_properties
|
|
84
95
|
invalid_properties = Array.new
|
|
85
|
-
if @type.nil?
|
|
86
|
-
invalid_properties.push("invalid value for 'type', type cannot be nil.")
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
if @id.nil?
|
|
90
|
-
invalid_properties.push("invalid value for 'id', id cannot be nil.")
|
|
91
|
-
end
|
|
92
|
-
|
|
93
|
-
if @sticker_file_id.nil?
|
|
94
|
-
invalid_properties.push("invalid value for 'sticker_file_id', sticker_file_id cannot be nil.")
|
|
95
|
-
end
|
|
96
|
-
|
|
97
96
|
return invalid_properties
|
|
98
97
|
end
|
|
99
98
|
|
|
@@ -136,7 +135,7 @@ module Teleswagger
|
|
|
136
135
|
def build_from_hash(attributes)
|
|
137
136
|
return nil unless attributes.is_a?(Hash)
|
|
138
137
|
self.class.swagger_types.each_pair do |key, type|
|
|
139
|
-
if type =~
|
|
138
|
+
if type =~ /^Array<(.*)>/i
|
|
140
139
|
# check to ensure the input is an array given that the the attribute
|
|
141
140
|
# is documented as an array but the input is not
|
|
142
141
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
@@ -167,7 +166,7 @@ module Teleswagger
|
|
|
167
166
|
when :Float
|
|
168
167
|
value.to_f
|
|
169
168
|
when :BOOLEAN
|
|
170
|
-
if value.to_s =~
|
|
169
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
|
171
170
|
true
|
|
172
171
|
else
|
|
173
172
|
false
|
|
@@ -178,7 +177,7 @@ module Teleswagger
|
|
|
178
177
|
when /\AArray<(?<inner_type>.+)>\z/
|
|
179
178
|
inner_type = Regexp.last_match[:inner_type]
|
|
180
179
|
value.map { |v| _deserialize(inner_type, v) }
|
|
181
|
-
when /\AHash<(?<k_type
|
|
180
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
|
182
181
|
k_type = Regexp.last_match[:k_type]
|
|
183
182
|
v_type = Regexp.last_match[:v_type]
|
|
184
183
|
{}.tap do |hash|
|
|
@@ -3,10 +3,21 @@
|
|
|
3
3
|
|
|
4
4
|
#This is a swagger defenition for [Telegram bot API](https://core.telegram.org/bots/api).
|
|
5
5
|
|
|
6
|
-
OpenAPI spec version: 3.
|
|
6
|
+
OpenAPI spec version: 3.6
|
|
7
7
|
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
+
you may not use this file except in compliance with the License.
|
|
12
|
+
You may obtain a copy of the License at
|
|
13
|
+
|
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
|
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
See the License for the specific language governing permissions and
|
|
20
|
+
limitations under the License.
|
|
10
21
|
|
|
11
22
|
=end
|
|
12
23
|
|
|
@@ -27,6 +38,8 @@ module Teleswagger
|
|
|
27
38
|
|
|
28
39
|
attr_accessor :caption
|
|
29
40
|
|
|
41
|
+
attr_accessor :parse_mode
|
|
42
|
+
|
|
30
43
|
attr_accessor :input_message_content
|
|
31
44
|
|
|
32
45
|
attr_accessor :reply_markup
|
|
@@ -41,6 +54,7 @@ module Teleswagger
|
|
|
41
54
|
:'title' => :'title',
|
|
42
55
|
:'description' => :'description',
|
|
43
56
|
:'caption' => :'caption',
|
|
57
|
+
:'parse_mode' => :'parse_mode',
|
|
44
58
|
:'input_message_content' => :'input_message_content',
|
|
45
59
|
:'reply_markup' => :'reply_markup'
|
|
46
60
|
}
|
|
@@ -55,6 +69,7 @@ module Teleswagger
|
|
|
55
69
|
:'title' => :'String',
|
|
56
70
|
:'description' => :'String',
|
|
57
71
|
:'caption' => :'String',
|
|
72
|
+
:'parse_mode' => :'ParseMode',
|
|
58
73
|
:'input_message_content' => :'Object',
|
|
59
74
|
:'reply_markup' => :'InlineKeyboardMarkup'
|
|
60
75
|
}
|
|
@@ -92,6 +107,10 @@ module Teleswagger
|
|
|
92
107
|
self.caption = attributes[:'caption']
|
|
93
108
|
end
|
|
94
109
|
|
|
110
|
+
if attributes.has_key?(:'parse_mode')
|
|
111
|
+
self.parse_mode = attributes[:'parse_mode']
|
|
112
|
+
end
|
|
113
|
+
|
|
95
114
|
if attributes.has_key?(:'input_message_content')
|
|
96
115
|
self.input_message_content = attributes[:'input_message_content']
|
|
97
116
|
end
|
|
@@ -106,18 +125,6 @@ module Teleswagger
|
|
|
106
125
|
# @return Array for valid properies with the reasons
|
|
107
126
|
def list_invalid_properties
|
|
108
127
|
invalid_properties = Array.new
|
|
109
|
-
if @type.nil?
|
|
110
|
-
invalid_properties.push("invalid value for 'type', type cannot be nil.")
|
|
111
|
-
end
|
|
112
|
-
|
|
113
|
-
if @id.nil?
|
|
114
|
-
invalid_properties.push("invalid value for 'id', id cannot be nil.")
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
if @video_file_id.nil?
|
|
118
|
-
invalid_properties.push("invalid value for 'video_file_id', video_file_id cannot be nil.")
|
|
119
|
-
end
|
|
120
|
-
|
|
121
128
|
return invalid_properties
|
|
122
129
|
end
|
|
123
130
|
|
|
@@ -141,6 +148,7 @@ module Teleswagger
|
|
|
141
148
|
title == o.title &&
|
|
142
149
|
description == o.description &&
|
|
143
150
|
caption == o.caption &&
|
|
151
|
+
parse_mode == o.parse_mode &&
|
|
144
152
|
input_message_content == o.input_message_content &&
|
|
145
153
|
reply_markup == o.reply_markup
|
|
146
154
|
end
|
|
@@ -154,7 +162,7 @@ module Teleswagger
|
|
|
154
162
|
# Calculates hash code according to all attributes.
|
|
155
163
|
# @return [Fixnum] Hash code
|
|
156
164
|
def hash
|
|
157
|
-
[type, id, video_file_id, title, description, caption, input_message_content, reply_markup].hash
|
|
165
|
+
[type, id, video_file_id, title, description, caption, parse_mode, input_message_content, reply_markup].hash
|
|
158
166
|
end
|
|
159
167
|
|
|
160
168
|
# Builds the object from hash
|
|
@@ -163,7 +171,7 @@ module Teleswagger
|
|
|
163
171
|
def build_from_hash(attributes)
|
|
164
172
|
return nil unless attributes.is_a?(Hash)
|
|
165
173
|
self.class.swagger_types.each_pair do |key, type|
|
|
166
|
-
if type =~
|
|
174
|
+
if type =~ /^Array<(.*)>/i
|
|
167
175
|
# check to ensure the input is an array given that the the attribute
|
|
168
176
|
# is documented as an array but the input is not
|
|
169
177
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
@@ -194,7 +202,7 @@ module Teleswagger
|
|
|
194
202
|
when :Float
|
|
195
203
|
value.to_f
|
|
196
204
|
when :BOOLEAN
|
|
197
|
-
if value.to_s =~
|
|
205
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
|
198
206
|
true
|
|
199
207
|
else
|
|
200
208
|
false
|
|
@@ -205,7 +213,7 @@ module Teleswagger
|
|
|
205
213
|
when /\AArray<(?<inner_type>.+)>\z/
|
|
206
214
|
inner_type = Regexp.last_match[:inner_type]
|
|
207
215
|
value.map { |v| _deserialize(inner_type, v) }
|
|
208
|
-
when /\AHash<(?<k_type
|
|
216
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
|
209
217
|
k_type = Regexp.last_match[:k_type]
|
|
210
218
|
v_type = Regexp.last_match[:v_type]
|
|
211
219
|
{}.tap do |hash|
|
|
@@ -3,10 +3,21 @@
|
|
|
3
3
|
|
|
4
4
|
#This is a swagger defenition for [Telegram bot API](https://core.telegram.org/bots/api).
|
|
5
5
|
|
|
6
|
-
OpenAPI spec version: 3.
|
|
6
|
+
OpenAPI spec version: 3.6
|
|
7
7
|
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
+
you may not use this file except in compliance with the License.
|
|
12
|
+
You may obtain a copy of the License at
|
|
13
|
+
|
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
|
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
See the License for the specific language governing permissions and
|
|
20
|
+
limitations under the License.
|
|
10
21
|
|
|
11
22
|
=end
|
|
12
23
|
|
|
@@ -25,6 +36,8 @@ module Teleswagger
|
|
|
25
36
|
|
|
26
37
|
attr_accessor :caption
|
|
27
38
|
|
|
39
|
+
attr_accessor :parse_mode
|
|
40
|
+
|
|
28
41
|
attr_accessor :input_message_content
|
|
29
42
|
|
|
30
43
|
attr_accessor :reply_markup
|
|
@@ -38,6 +51,7 @@ module Teleswagger
|
|
|
38
51
|
:'voice_file_id' => :'voice_file_id',
|
|
39
52
|
:'title' => :'title',
|
|
40
53
|
:'caption' => :'caption',
|
|
54
|
+
:'parse_mode' => :'parse_mode',
|
|
41
55
|
:'input_message_content' => :'input_message_content',
|
|
42
56
|
:'reply_markup' => :'reply_markup'
|
|
43
57
|
}
|
|
@@ -51,6 +65,7 @@ module Teleswagger
|
|
|
51
65
|
:'voice_file_id' => :'String',
|
|
52
66
|
:'title' => :'String',
|
|
53
67
|
:'caption' => :'String',
|
|
68
|
+
:'parse_mode' => :'ParseMode',
|
|
54
69
|
:'input_message_content' => :'Object',
|
|
55
70
|
:'reply_markup' => :'InlineKeyboardMarkup'
|
|
56
71
|
}
|
|
@@ -84,6 +99,10 @@ module Teleswagger
|
|
|
84
99
|
self.caption = attributes[:'caption']
|
|
85
100
|
end
|
|
86
101
|
|
|
102
|
+
if attributes.has_key?(:'parse_mode')
|
|
103
|
+
self.parse_mode = attributes[:'parse_mode']
|
|
104
|
+
end
|
|
105
|
+
|
|
87
106
|
if attributes.has_key?(:'input_message_content')
|
|
88
107
|
self.input_message_content = attributes[:'input_message_content']
|
|
89
108
|
end
|
|
@@ -98,18 +117,6 @@ module Teleswagger
|
|
|
98
117
|
# @return Array for valid properies with the reasons
|
|
99
118
|
def list_invalid_properties
|
|
100
119
|
invalid_properties = Array.new
|
|
101
|
-
if @type.nil?
|
|
102
|
-
invalid_properties.push("invalid value for 'type', type cannot be nil.")
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
if @id.nil?
|
|
106
|
-
invalid_properties.push("invalid value for 'id', id cannot be nil.")
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
if @voice_file_id.nil?
|
|
110
|
-
invalid_properties.push("invalid value for 'voice_file_id', voice_file_id cannot be nil.")
|
|
111
|
-
end
|
|
112
|
-
|
|
113
120
|
return invalid_properties
|
|
114
121
|
end
|
|
115
122
|
|
|
@@ -132,6 +139,7 @@ module Teleswagger
|
|
|
132
139
|
voice_file_id == o.voice_file_id &&
|
|
133
140
|
title == o.title &&
|
|
134
141
|
caption == o.caption &&
|
|
142
|
+
parse_mode == o.parse_mode &&
|
|
135
143
|
input_message_content == o.input_message_content &&
|
|
136
144
|
reply_markup == o.reply_markup
|
|
137
145
|
end
|
|
@@ -145,7 +153,7 @@ module Teleswagger
|
|
|
145
153
|
# Calculates hash code according to all attributes.
|
|
146
154
|
# @return [Fixnum] Hash code
|
|
147
155
|
def hash
|
|
148
|
-
[type, id, voice_file_id, title, caption, input_message_content, reply_markup].hash
|
|
156
|
+
[type, id, voice_file_id, title, caption, parse_mode, input_message_content, reply_markup].hash
|
|
149
157
|
end
|
|
150
158
|
|
|
151
159
|
# Builds the object from hash
|
|
@@ -154,7 +162,7 @@ module Teleswagger
|
|
|
154
162
|
def build_from_hash(attributes)
|
|
155
163
|
return nil unless attributes.is_a?(Hash)
|
|
156
164
|
self.class.swagger_types.each_pair do |key, type|
|
|
157
|
-
if type =~
|
|
165
|
+
if type =~ /^Array<(.*)>/i
|
|
158
166
|
# check to ensure the input is an array given that the the attribute
|
|
159
167
|
# is documented as an array but the input is not
|
|
160
168
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
@@ -185,7 +193,7 @@ module Teleswagger
|
|
|
185
193
|
when :Float
|
|
186
194
|
value.to_f
|
|
187
195
|
when :BOOLEAN
|
|
188
|
-
if value.to_s =~
|
|
196
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
|
189
197
|
true
|
|
190
198
|
else
|
|
191
199
|
false
|
|
@@ -196,7 +204,7 @@ module Teleswagger
|
|
|
196
204
|
when /\AArray<(?<inner_type>.+)>\z/
|
|
197
205
|
inner_type = Regexp.last_match[:inner_type]
|
|
198
206
|
value.map { |v| _deserialize(inner_type, v) }
|
|
199
|
-
when /\AHash<(?<k_type
|
|
207
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
|
200
208
|
k_type = Regexp.last_match[:k_type]
|
|
201
209
|
v_type = Regexp.last_match[:v_type]
|
|
202
210
|
{}.tap do |hash|
|
|
@@ -3,10 +3,21 @@
|
|
|
3
3
|
|
|
4
4
|
#This is a swagger defenition for [Telegram bot API](https://core.telegram.org/bots/api).
|
|
5
5
|
|
|
6
|
-
OpenAPI spec version: 3.
|
|
6
|
+
OpenAPI spec version: 3.6
|
|
7
7
|
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
+
you may not use this file except in compliance with the License.
|
|
12
|
+
You may obtain a copy of the License at
|
|
13
|
+
|
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
|
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
See the License for the specific language governing permissions and
|
|
20
|
+
limitations under the License.
|
|
10
21
|
|
|
11
22
|
=end
|
|
12
23
|
|
|
@@ -122,22 +133,6 @@ module Teleswagger
|
|
|
122
133
|
# @return Array for valid properies with the reasons
|
|
123
134
|
def list_invalid_properties
|
|
124
135
|
invalid_properties = Array.new
|
|
125
|
-
if @type.nil?
|
|
126
|
-
invalid_properties.push("invalid value for 'type', type cannot be nil.")
|
|
127
|
-
end
|
|
128
|
-
|
|
129
|
-
if @id.nil?
|
|
130
|
-
invalid_properties.push("invalid value for 'id', id cannot be nil.")
|
|
131
|
-
end
|
|
132
|
-
|
|
133
|
-
if @phone_number.nil?
|
|
134
|
-
invalid_properties.push("invalid value for 'phone_number', phone_number cannot be nil.")
|
|
135
|
-
end
|
|
136
|
-
|
|
137
|
-
if @first_name.nil?
|
|
138
|
-
invalid_properties.push("invalid value for 'first_name', first_name cannot be nil.")
|
|
139
|
-
end
|
|
140
|
-
|
|
141
136
|
return invalid_properties
|
|
142
137
|
end
|
|
143
138
|
|
|
@@ -186,7 +181,7 @@ module Teleswagger
|
|
|
186
181
|
def build_from_hash(attributes)
|
|
187
182
|
return nil unless attributes.is_a?(Hash)
|
|
188
183
|
self.class.swagger_types.each_pair do |key, type|
|
|
189
|
-
if type =~
|
|
184
|
+
if type =~ /^Array<(.*)>/i
|
|
190
185
|
# check to ensure the input is an array given that the the attribute
|
|
191
186
|
# is documented as an array but the input is not
|
|
192
187
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
@@ -217,7 +212,7 @@ module Teleswagger
|
|
|
217
212
|
when :Float
|
|
218
213
|
value.to_f
|
|
219
214
|
when :BOOLEAN
|
|
220
|
-
if value.to_s =~
|
|
215
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
|
221
216
|
true
|
|
222
217
|
else
|
|
223
218
|
false
|
|
@@ -228,7 +223,7 @@ module Teleswagger
|
|
|
228
223
|
when /\AArray<(?<inner_type>.+)>\z/
|
|
229
224
|
inner_type = Regexp.last_match[:inner_type]
|
|
230
225
|
value.map { |v| _deserialize(inner_type, v) }
|
|
231
|
-
when /\AHash<(?<k_type
|
|
226
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
|
232
227
|
k_type = Regexp.last_match[:k_type]
|
|
233
228
|
v_type = Regexp.last_match[:v_type]
|
|
234
229
|
{}.tap do |hash|
|
|
@@ -3,10 +3,21 @@
|
|
|
3
3
|
|
|
4
4
|
#This is a swagger defenition for [Telegram bot API](https://core.telegram.org/bots/api).
|
|
5
5
|
|
|
6
|
-
OpenAPI spec version: 3.
|
|
6
|
+
OpenAPI spec version: 3.6
|
|
7
7
|
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
11
|
+
you may not use this file except in compliance with the License.
|
|
12
|
+
You may obtain a copy of the License at
|
|
13
|
+
|
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
+
|
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
19
|
+
See the License for the specific language governing permissions and
|
|
20
|
+
limitations under the License.
|
|
10
21
|
|
|
11
22
|
=end
|
|
12
23
|
|
|
@@ -23,6 +34,8 @@ module Teleswagger
|
|
|
23
34
|
|
|
24
35
|
attr_accessor :caption
|
|
25
36
|
|
|
37
|
+
attr_accessor :parse_mode
|
|
38
|
+
|
|
26
39
|
attr_accessor :document_url
|
|
27
40
|
|
|
28
41
|
attr_accessor :mime_type
|
|
@@ -47,6 +60,7 @@ module Teleswagger
|
|
|
47
60
|
:'id' => :'id',
|
|
48
61
|
:'title' => :'title',
|
|
49
62
|
:'caption' => :'caption',
|
|
63
|
+
:'parse_mode' => :'parse_mode',
|
|
50
64
|
:'document_url' => :'document_url',
|
|
51
65
|
:'mime_type' => :'mime_type',
|
|
52
66
|
:'description' => :'description',
|
|
@@ -65,6 +79,7 @@ module Teleswagger
|
|
|
65
79
|
:'id' => :'String',
|
|
66
80
|
:'title' => :'String',
|
|
67
81
|
:'caption' => :'String',
|
|
82
|
+
:'parse_mode' => :'ParseMode',
|
|
68
83
|
:'document_url' => :'String',
|
|
69
84
|
:'mime_type' => :'String',
|
|
70
85
|
:'description' => :'String',
|
|
@@ -100,6 +115,10 @@ module Teleswagger
|
|
|
100
115
|
self.caption = attributes[:'caption']
|
|
101
116
|
end
|
|
102
117
|
|
|
118
|
+
if attributes.has_key?(:'parse_mode')
|
|
119
|
+
self.parse_mode = attributes[:'parse_mode']
|
|
120
|
+
end
|
|
121
|
+
|
|
103
122
|
if attributes.has_key?(:'document_url')
|
|
104
123
|
self.document_url = attributes[:'document_url']
|
|
105
124
|
end
|
|
@@ -138,26 +157,6 @@ module Teleswagger
|
|
|
138
157
|
# @return Array for valid properies with the reasons
|
|
139
158
|
def list_invalid_properties
|
|
140
159
|
invalid_properties = Array.new
|
|
141
|
-
if @type.nil?
|
|
142
|
-
invalid_properties.push("invalid value for 'type', type cannot be nil.")
|
|
143
|
-
end
|
|
144
|
-
|
|
145
|
-
if @id.nil?
|
|
146
|
-
invalid_properties.push("invalid value for 'id', id cannot be nil.")
|
|
147
|
-
end
|
|
148
|
-
|
|
149
|
-
if @title.nil?
|
|
150
|
-
invalid_properties.push("invalid value for 'title', title cannot be nil.")
|
|
151
|
-
end
|
|
152
|
-
|
|
153
|
-
if @document_url.nil?
|
|
154
|
-
invalid_properties.push("invalid value for 'document_url', document_url cannot be nil.")
|
|
155
|
-
end
|
|
156
|
-
|
|
157
|
-
if @mime_type.nil?
|
|
158
|
-
invalid_properties.push("invalid value for 'mime_type', mime_type cannot be nil.")
|
|
159
|
-
end
|
|
160
|
-
|
|
161
160
|
return invalid_properties
|
|
162
161
|
end
|
|
163
162
|
|
|
@@ -181,6 +180,7 @@ module Teleswagger
|
|
|
181
180
|
id == o.id &&
|
|
182
181
|
title == o.title &&
|
|
183
182
|
caption == o.caption &&
|
|
183
|
+
parse_mode == o.parse_mode &&
|
|
184
184
|
document_url == o.document_url &&
|
|
185
185
|
mime_type == o.mime_type &&
|
|
186
186
|
description == o.description &&
|
|
@@ -200,7 +200,7 @@ module Teleswagger
|
|
|
200
200
|
# Calculates hash code according to all attributes.
|
|
201
201
|
# @return [Fixnum] Hash code
|
|
202
202
|
def hash
|
|
203
|
-
[type, id, title, caption, document_url, mime_type, description, reply_markup, input_message_content, thumb_url, thumb_width, thumb_height].hash
|
|
203
|
+
[type, id, title, caption, parse_mode, document_url, mime_type, description, reply_markup, input_message_content, thumb_url, thumb_width, thumb_height].hash
|
|
204
204
|
end
|
|
205
205
|
|
|
206
206
|
# Builds the object from hash
|
|
@@ -209,7 +209,7 @@ module Teleswagger
|
|
|
209
209
|
def build_from_hash(attributes)
|
|
210
210
|
return nil unless attributes.is_a?(Hash)
|
|
211
211
|
self.class.swagger_types.each_pair do |key, type|
|
|
212
|
-
if type =~
|
|
212
|
+
if type =~ /^Array<(.*)>/i
|
|
213
213
|
# check to ensure the input is an array given that the the attribute
|
|
214
214
|
# is documented as an array but the input is not
|
|
215
215
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
@@ -240,7 +240,7 @@ module Teleswagger
|
|
|
240
240
|
when :Float
|
|
241
241
|
value.to_f
|
|
242
242
|
when :BOOLEAN
|
|
243
|
-
if value.to_s =~
|
|
243
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
|
244
244
|
true
|
|
245
245
|
else
|
|
246
246
|
false
|
|
@@ -251,7 +251,7 @@ module Teleswagger
|
|
|
251
251
|
when /\AArray<(?<inner_type>.+)>\z/
|
|
252
252
|
inner_type = Regexp.last_match[:inner_type]
|
|
253
253
|
value.map { |v| _deserialize(inner_type, v) }
|
|
254
|
-
when /\AHash<(?<k_type
|
|
254
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
|
255
255
|
k_type = Regexp.last_match[:k_type]
|
|
256
256
|
v_type = Regexp.last_match[:v_type]
|
|
257
257
|
{}.tap do |hash|
|