teleswagger 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- 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
|
|
@@ -28,7 +39,7 @@ module Teleswagger
|
|
28
39
|
# @option opts [Integer] :chat_id
|
29
40
|
# @option opts [Integer] :message_id
|
30
41
|
# @option opts [String] :inline_message_id
|
31
|
-
# @return [
|
42
|
+
# @return [InlineResponse2006]
|
32
43
|
def get_game_high_scores(token, user_id, opts = {})
|
33
44
|
data, _status_code, _headers = get_game_high_scores_with_http_info(token, user_id, opts)
|
34
45
|
return data
|
@@ -42,21 +53,17 @@ module Teleswagger
|
|
42
53
|
# @option opts [Integer] :chat_id
|
43
54
|
# @option opts [Integer] :message_id
|
44
55
|
# @option opts [String] :inline_message_id
|
45
|
-
# @return [Array<(
|
56
|
+
# @return [Array<(InlineResponse2006, Fixnum, Hash)>] InlineResponse2006 data, response status code and response headers
|
46
57
|
def get_game_high_scores_with_http_info(token, user_id, opts = {})
|
47
58
|
if @api_client.config.debugging
|
48
59
|
@api_client.config.logger.debug "Calling API: GamesApi.get_game_high_scores ..."
|
49
60
|
end
|
50
61
|
# verify the required parameter 'token' is set
|
51
|
-
|
52
|
-
fail ArgumentError, "Missing the required parameter 'token' when calling GamesApi.get_game_high_scores"
|
53
|
-
end
|
62
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling GamesApi.get_game_high_scores" if token.nil?
|
54
63
|
# verify the required parameter 'user_id' is set
|
55
|
-
|
56
|
-
fail ArgumentError, "Missing the required parameter 'user_id' when calling GamesApi.get_game_high_scores"
|
57
|
-
end
|
64
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling GamesApi.get_game_high_scores" if user_id.nil?
|
58
65
|
# resource path
|
59
|
-
local_var_path = "/bot{token}/getGameHighScores".sub('{' + 'token' + '}', token.to_s)
|
66
|
+
local_var_path = "/bot{token}/getGameHighScores".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)
|
60
67
|
|
61
68
|
# query parameters
|
62
69
|
query_params = {}
|
@@ -67,10 +74,14 @@ module Teleswagger
|
|
67
74
|
|
68
75
|
# header parameters
|
69
76
|
header_params = {}
|
77
|
+
|
70
78
|
# HTTP header 'Accept' (if needed)
|
71
|
-
|
79
|
+
local_header_accept = ['application/json']
|
80
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
81
|
+
|
72
82
|
# HTTP header 'Content-Type'
|
73
|
-
|
83
|
+
local_header_content_type = ['application/json']
|
84
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
74
85
|
|
75
86
|
# form parameters
|
76
87
|
form_params = {}
|
@@ -84,7 +95,7 @@ module Teleswagger
|
|
84
95
|
:form_params => form_params,
|
85
96
|
:body => post_body,
|
86
97
|
:auth_names => auth_names,
|
87
|
-
:return_type => '
|
98
|
+
:return_type => 'InlineResponse2006')
|
88
99
|
if @api_client.config.debugging
|
89
100
|
@api_client.config.logger.debug "API called: GamesApi#get_game_high_scores\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
90
101
|
end
|
@@ -113,21 +124,23 @@ module Teleswagger
|
|
113
124
|
@api_client.config.logger.debug "Calling API: GamesApi.send_game ..."
|
114
125
|
end
|
115
126
|
# verify the required parameter 'token' is set
|
116
|
-
|
117
|
-
fail ArgumentError, "Missing the required parameter 'token' when calling GamesApi.send_game"
|
118
|
-
end
|
127
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling GamesApi.send_game" if token.nil?
|
119
128
|
# resource path
|
120
|
-
local_var_path = "/bot{token}/sendGame".sub('{' + 'token' + '}', token.to_s)
|
129
|
+
local_var_path = "/bot{token}/sendGame".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)
|
121
130
|
|
122
131
|
# query parameters
|
123
132
|
query_params = {}
|
124
133
|
|
125
134
|
# header parameters
|
126
135
|
header_params = {}
|
136
|
+
|
127
137
|
# HTTP header 'Accept' (if needed)
|
128
|
-
|
138
|
+
local_header_accept = ['application/json']
|
139
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
140
|
+
|
129
141
|
# HTTP header 'Content-Type'
|
130
|
-
|
142
|
+
local_header_content_type = ['application/json']
|
143
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
131
144
|
|
132
145
|
# form parameters
|
133
146
|
form_params = {}
|
@@ -159,7 +172,7 @@ module Teleswagger
|
|
159
172
|
# @option opts [Integer] :chat_id
|
160
173
|
# @option opts [Integer] :message_id
|
161
174
|
# @option opts [String] :inline_message_id
|
162
|
-
# @return [
|
175
|
+
# @return [InlineResponse200]
|
163
176
|
def set_game_score(token, user_id, score, opts = {})
|
164
177
|
data, _status_code, _headers = set_game_score_with_http_info(token, user_id, score, opts)
|
165
178
|
return data
|
@@ -176,25 +189,19 @@ module Teleswagger
|
|
176
189
|
# @option opts [Integer] :chat_id
|
177
190
|
# @option opts [Integer] :message_id
|
178
191
|
# @option opts [String] :inline_message_id
|
179
|
-
# @return [Array<(
|
192
|
+
# @return [Array<(InlineResponse200, Fixnum, Hash)>] InlineResponse200 data, response status code and response headers
|
180
193
|
def set_game_score_with_http_info(token, user_id, score, opts = {})
|
181
194
|
if @api_client.config.debugging
|
182
195
|
@api_client.config.logger.debug "Calling API: GamesApi.set_game_score ..."
|
183
196
|
end
|
184
197
|
# verify the required parameter 'token' is set
|
185
|
-
|
186
|
-
fail ArgumentError, "Missing the required parameter 'token' when calling GamesApi.set_game_score"
|
187
|
-
end
|
198
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling GamesApi.set_game_score" if token.nil?
|
188
199
|
# verify the required parameter 'user_id' is set
|
189
|
-
|
190
|
-
fail ArgumentError, "Missing the required parameter 'user_id' when calling GamesApi.set_game_score"
|
191
|
-
end
|
200
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling GamesApi.set_game_score" if user_id.nil?
|
192
201
|
# verify the required parameter 'score' is set
|
193
|
-
|
194
|
-
fail ArgumentError, "Missing the required parameter 'score' when calling GamesApi.set_game_score"
|
195
|
-
end
|
202
|
+
fail ArgumentError, "Missing the required parameter 'score' when calling GamesApi.set_game_score" if score.nil?
|
196
203
|
# resource path
|
197
|
-
local_var_path = "/bot{token}/setGameScore".sub('{' + 'token' + '}', token.to_s)
|
204
|
+
local_var_path = "/bot{token}/setGameScore".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)
|
198
205
|
|
199
206
|
# query parameters
|
200
207
|
query_params = {}
|
@@ -208,10 +215,14 @@ module Teleswagger
|
|
208
215
|
|
209
216
|
# header parameters
|
210
217
|
header_params = {}
|
218
|
+
|
211
219
|
# HTTP header 'Accept' (if needed)
|
212
|
-
|
220
|
+
local_header_accept = ['application/json']
|
221
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
222
|
+
|
213
223
|
# HTTP header 'Content-Type'
|
214
|
-
|
224
|
+
local_header_content_type = ['application/json']
|
225
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
215
226
|
|
216
227
|
# form parameters
|
217
228
|
form_params = {}
|
@@ -225,7 +236,7 @@ module Teleswagger
|
|
225
236
|
:form_params => form_params,
|
226
237
|
:body => post_body,
|
227
238
|
:auth_names => auth_names,
|
228
|
-
:return_type => '
|
239
|
+
:return_type => 'InlineResponse200')
|
229
240
|
if @api_client.config.debugging
|
230
241
|
@api_client.config.logger.debug "API called: GamesApi#set_game_score\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
231
242
|
end
|
@@ -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
|
|
@@ -42,21 +53,23 @@ module Teleswagger
|
|
42
53
|
@api_client.config.logger.debug "Calling API: InlineApi.answer_inline_query ..."
|
43
54
|
end
|
44
55
|
# verify the required parameter 'token' is set
|
45
|
-
|
46
|
-
fail ArgumentError, "Missing the required parameter 'token' when calling InlineApi.answer_inline_query"
|
47
|
-
end
|
56
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling InlineApi.answer_inline_query" if token.nil?
|
48
57
|
# resource path
|
49
|
-
local_var_path = "/bot{token}/answerInlineQuery".sub('{' + 'token' + '}', token.to_s)
|
58
|
+
local_var_path = "/bot{token}/answerInlineQuery".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)
|
50
59
|
|
51
60
|
# query parameters
|
52
61
|
query_params = {}
|
53
62
|
|
54
63
|
# header parameters
|
55
64
|
header_params = {}
|
65
|
+
|
56
66
|
# HTTP header 'Accept' (if needed)
|
57
|
-
|
67
|
+
local_header_accept = ['application/json']
|
68
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
69
|
+
|
58
70
|
# HTTP header 'Content-Type'
|
59
|
-
|
71
|
+
local_header_content_type = ['application/json']
|
72
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
60
73
|
|
61
74
|
# form parameters
|
62
75
|
form_params = {}
|
@@ -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
|
|
@@ -44,19 +55,13 @@ module Teleswagger
|
|
44
55
|
@api_client.config.logger.debug "Calling API: MessagesApi.delete_message ..."
|
45
56
|
end
|
46
57
|
# verify the required parameter 'token' is set
|
47
|
-
|
48
|
-
fail ArgumentError, "Missing the required parameter 'token' when calling MessagesApi.delete_message"
|
49
|
-
end
|
58
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling MessagesApi.delete_message" if token.nil?
|
50
59
|
# verify the required parameter 'chat_id' is set
|
51
|
-
|
52
|
-
fail ArgumentError, "Missing the required parameter 'chat_id' when calling MessagesApi.delete_message"
|
53
|
-
end
|
60
|
+
fail ArgumentError, "Missing the required parameter 'chat_id' when calling MessagesApi.delete_message" if chat_id.nil?
|
54
61
|
# verify the required parameter 'message_id' is set
|
55
|
-
|
56
|
-
fail ArgumentError, "Missing the required parameter 'message_id' when calling MessagesApi.delete_message"
|
57
|
-
end
|
62
|
+
fail ArgumentError, "Missing the required parameter 'message_id' when calling MessagesApi.delete_message" if message_id.nil?
|
58
63
|
# resource path
|
59
|
-
local_var_path = "/bot{token}/deleteMessage".sub('{' + 'token' + '}', token.to_s)
|
64
|
+
local_var_path = "/bot{token}/deleteMessage".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)
|
60
65
|
|
61
66
|
# query parameters
|
62
67
|
query_params = {}
|
@@ -65,10 +70,14 @@ module Teleswagger
|
|
65
70
|
|
66
71
|
# header parameters
|
67
72
|
header_params = {}
|
73
|
+
|
68
74
|
# HTTP header 'Accept' (if needed)
|
69
|
-
|
75
|
+
local_header_accept = ['application/json']
|
76
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
77
|
+
|
70
78
|
# HTTP header 'Content-Type'
|
71
|
-
|
79
|
+
local_header_content_type = ['application/json']
|
80
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
72
81
|
|
73
82
|
# form parameters
|
74
83
|
form_params = {}
|
@@ -94,7 +103,7 @@ module Teleswagger
|
|
94
103
|
# @param token bot's token to authorize the request
|
95
104
|
# @param [Hash] opts the optional parameters
|
96
105
|
# @option opts [EditMessageCaptionBody] :body
|
97
|
-
# @return [
|
106
|
+
# @return [InlineResponse200]
|
98
107
|
def edit_message_caption(token, opts = {})
|
99
108
|
data, _status_code, _headers = edit_message_caption_with_http_info(token, opts)
|
100
109
|
return data
|
@@ -105,27 +114,29 @@ module Teleswagger
|
|
105
114
|
# @param token bot's token to authorize the request
|
106
115
|
# @param [Hash] opts the optional parameters
|
107
116
|
# @option opts [EditMessageCaptionBody] :body
|
108
|
-
# @return [Array<(
|
117
|
+
# @return [Array<(InlineResponse200, Fixnum, Hash)>] InlineResponse200 data, response status code and response headers
|
109
118
|
def edit_message_caption_with_http_info(token, opts = {})
|
110
119
|
if @api_client.config.debugging
|
111
120
|
@api_client.config.logger.debug "Calling API: MessagesApi.edit_message_caption ..."
|
112
121
|
end
|
113
122
|
# verify the required parameter 'token' is set
|
114
|
-
|
115
|
-
fail ArgumentError, "Missing the required parameter 'token' when calling MessagesApi.edit_message_caption"
|
116
|
-
end
|
123
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling MessagesApi.edit_message_caption" if token.nil?
|
117
124
|
# resource path
|
118
|
-
local_var_path = "/bot{token}/editMessageCaption".sub('{' + 'token' + '}', token.to_s)
|
125
|
+
local_var_path = "/bot{token}/editMessageCaption".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)
|
119
126
|
|
120
127
|
# query parameters
|
121
128
|
query_params = {}
|
122
129
|
|
123
130
|
# header parameters
|
124
131
|
header_params = {}
|
132
|
+
|
125
133
|
# HTTP header 'Accept' (if needed)
|
126
|
-
|
134
|
+
local_header_accept = ['application/json']
|
135
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
136
|
+
|
127
137
|
# HTTP header 'Content-Type'
|
128
|
-
|
138
|
+
local_header_content_type = ['application/json']
|
139
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
129
140
|
|
130
141
|
# form parameters
|
131
142
|
form_params = {}
|
@@ -139,7 +150,7 @@ module Teleswagger
|
|
139
150
|
:form_params => form_params,
|
140
151
|
:body => post_body,
|
141
152
|
:auth_names => auth_names,
|
142
|
-
:return_type => '
|
153
|
+
:return_type => 'InlineResponse200')
|
143
154
|
if @api_client.config.debugging
|
144
155
|
@api_client.config.logger.debug "API called: MessagesApi#edit_message_caption\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
145
156
|
end
|
@@ -151,7 +162,7 @@ module Teleswagger
|
|
151
162
|
# @param token bot's token to authorize the request
|
152
163
|
# @param [Hash] opts the optional parameters
|
153
164
|
# @option opts [EditMessageReplyMarkupBody] :body
|
154
|
-
# @return [
|
165
|
+
# @return [InlineResponse200]
|
155
166
|
def edit_message_reply_markup(token, opts = {})
|
156
167
|
data, _status_code, _headers = edit_message_reply_markup_with_http_info(token, opts)
|
157
168
|
return data
|
@@ -162,27 +173,29 @@ module Teleswagger
|
|
162
173
|
# @param token bot's token to authorize the request
|
163
174
|
# @param [Hash] opts the optional parameters
|
164
175
|
# @option opts [EditMessageReplyMarkupBody] :body
|
165
|
-
# @return [Array<(
|
176
|
+
# @return [Array<(InlineResponse200, Fixnum, Hash)>] InlineResponse200 data, response status code and response headers
|
166
177
|
def edit_message_reply_markup_with_http_info(token, opts = {})
|
167
178
|
if @api_client.config.debugging
|
168
179
|
@api_client.config.logger.debug "Calling API: MessagesApi.edit_message_reply_markup ..."
|
169
180
|
end
|
170
181
|
# verify the required parameter 'token' is set
|
171
|
-
|
172
|
-
fail ArgumentError, "Missing the required parameter 'token' when calling MessagesApi.edit_message_reply_markup"
|
173
|
-
end
|
182
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling MessagesApi.edit_message_reply_markup" if token.nil?
|
174
183
|
# resource path
|
175
|
-
local_var_path = "/bot{token}/editMessageReplyMarkup".sub('{' + 'token' + '}', token.to_s)
|
184
|
+
local_var_path = "/bot{token}/editMessageReplyMarkup".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)
|
176
185
|
|
177
186
|
# query parameters
|
178
187
|
query_params = {}
|
179
188
|
|
180
189
|
# header parameters
|
181
190
|
header_params = {}
|
191
|
+
|
182
192
|
# HTTP header 'Accept' (if needed)
|
183
|
-
|
193
|
+
local_header_accept = ['application/json']
|
194
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
195
|
+
|
184
196
|
# HTTP header 'Content-Type'
|
185
|
-
|
197
|
+
local_header_content_type = ['application/json']
|
198
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
186
199
|
|
187
200
|
# form parameters
|
188
201
|
form_params = {}
|
@@ -196,7 +209,7 @@ module Teleswagger
|
|
196
209
|
:form_params => form_params,
|
197
210
|
:body => post_body,
|
198
211
|
:auth_names => auth_names,
|
199
|
-
:return_type => '
|
212
|
+
:return_type => 'InlineResponse200')
|
200
213
|
if @api_client.config.debugging
|
201
214
|
@api_client.config.logger.debug "API called: MessagesApi#edit_message_reply_markup\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
202
215
|
end
|
@@ -208,7 +221,7 @@ module Teleswagger
|
|
208
221
|
# @param token bot's token to authorize the request
|
209
222
|
# @param [Hash] opts the optional parameters
|
210
223
|
# @option opts [EditMessageTextBody] :body
|
211
|
-
# @return [
|
224
|
+
# @return [InlineResponse200]
|
212
225
|
def edit_message_text(token, opts = {})
|
213
226
|
data, _status_code, _headers = edit_message_text_with_http_info(token, opts)
|
214
227
|
return data
|
@@ -219,27 +232,29 @@ module Teleswagger
|
|
219
232
|
# @param token bot's token to authorize the request
|
220
233
|
# @param [Hash] opts the optional parameters
|
221
234
|
# @option opts [EditMessageTextBody] :body
|
222
|
-
# @return [Array<(
|
235
|
+
# @return [Array<(InlineResponse200, Fixnum, Hash)>] InlineResponse200 data, response status code and response headers
|
223
236
|
def edit_message_text_with_http_info(token, opts = {})
|
224
237
|
if @api_client.config.debugging
|
225
238
|
@api_client.config.logger.debug "Calling API: MessagesApi.edit_message_text ..."
|
226
239
|
end
|
227
240
|
# verify the required parameter 'token' is set
|
228
|
-
|
229
|
-
fail ArgumentError, "Missing the required parameter 'token' when calling MessagesApi.edit_message_text"
|
230
|
-
end
|
241
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling MessagesApi.edit_message_text" if token.nil?
|
231
242
|
# resource path
|
232
|
-
local_var_path = "/bot{token}/editMessageText".sub('{' + 'token' + '}', token.to_s)
|
243
|
+
local_var_path = "/bot{token}/editMessageText".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)
|
233
244
|
|
234
245
|
# query parameters
|
235
246
|
query_params = {}
|
236
247
|
|
237
248
|
# header parameters
|
238
249
|
header_params = {}
|
250
|
+
|
239
251
|
# HTTP header 'Accept' (if needed)
|
240
|
-
|
252
|
+
local_header_accept = ['application/json']
|
253
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
254
|
+
|
241
255
|
# HTTP header 'Content-Type'
|
242
|
-
|
256
|
+
local_header_content_type = ['application/json']
|
257
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
243
258
|
|
244
259
|
# form parameters
|
245
260
|
form_params = {}
|
@@ -253,7 +268,7 @@ module Teleswagger
|
|
253
268
|
:form_params => form_params,
|
254
269
|
:body => post_body,
|
255
270
|
:auth_names => auth_names,
|
256
|
-
:return_type => '
|
271
|
+
:return_type => 'InlineResponse200')
|
257
272
|
if @api_client.config.debugging
|
258
273
|
@api_client.config.logger.debug "API called: MessagesApi#edit_message_text\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
259
274
|
end
|
@@ -288,33 +303,29 @@ module Teleswagger
|
|
288
303
|
@api_client.config.logger.debug "Calling API: MessagesApi.forward_message ..."
|
289
304
|
end
|
290
305
|
# verify the required parameter 'token' is set
|
291
|
-
|
292
|
-
fail ArgumentError, "Missing the required parameter 'token' when calling MessagesApi.forward_message"
|
293
|
-
end
|
306
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling MessagesApi.forward_message" if token.nil?
|
294
307
|
# verify the required parameter 'chat_id' is set
|
295
|
-
|
296
|
-
fail ArgumentError, "Missing the required parameter 'chat_id' when calling MessagesApi.forward_message"
|
297
|
-
end
|
308
|
+
fail ArgumentError, "Missing the required parameter 'chat_id' when calling MessagesApi.forward_message" if chat_id.nil?
|
298
309
|
# verify the required parameter 'from_chat_id' is set
|
299
|
-
|
300
|
-
fail ArgumentError, "Missing the required parameter 'from_chat_id' when calling MessagesApi.forward_message"
|
301
|
-
end
|
310
|
+
fail ArgumentError, "Missing the required parameter 'from_chat_id' when calling MessagesApi.forward_message" if from_chat_id.nil?
|
302
311
|
# verify the required parameter 'message_id' is set
|
303
|
-
|
304
|
-
fail ArgumentError, "Missing the required parameter 'message_id' when calling MessagesApi.forward_message"
|
305
|
-
end
|
312
|
+
fail ArgumentError, "Missing the required parameter 'message_id' when calling MessagesApi.forward_message" if message_id.nil?
|
306
313
|
# resource path
|
307
|
-
local_var_path = "/bot{token}/forwardMessage".sub('{' + 'token' + '}', token.to_s)
|
314
|
+
local_var_path = "/bot{token}/forwardMessage".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)
|
308
315
|
|
309
316
|
# query parameters
|
310
317
|
query_params = {}
|
311
318
|
|
312
319
|
# header parameters
|
313
320
|
header_params = {}
|
321
|
+
|
314
322
|
# HTTP header 'Accept' (if needed)
|
315
|
-
|
323
|
+
local_header_accept = ['application/json']
|
324
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
325
|
+
|
316
326
|
# HTTP header 'Content-Type'
|
317
|
-
|
327
|
+
local_header_content_type = ['application/x-www-form-urlencoded']
|
328
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
318
329
|
|
319
330
|
# form parameters
|
320
331
|
form_params = {}
|
@@ -361,21 +372,23 @@ module Teleswagger
|
|
361
372
|
@api_client.config.logger.debug "Calling API: MessagesApi.send_message ..."
|
362
373
|
end
|
363
374
|
# verify the required parameter 'token' is set
|
364
|
-
|
365
|
-
fail ArgumentError, "Missing the required parameter 'token' when calling MessagesApi.send_message"
|
366
|
-
end
|
375
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling MessagesApi.send_message" if token.nil?
|
367
376
|
# resource path
|
368
|
-
local_var_path = "/bot{token}/sendMessage".sub('{' + 'token' + '}', token.to_s)
|
377
|
+
local_var_path = "/bot{token}/sendMessage".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)
|
369
378
|
|
370
379
|
# query parameters
|
371
380
|
query_params = {}
|
372
381
|
|
373
382
|
# header parameters
|
374
383
|
header_params = {}
|
384
|
+
|
375
385
|
# HTTP header 'Accept' (if needed)
|
376
|
-
|
386
|
+
local_header_accept = ['application/json']
|
387
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
388
|
+
|
377
389
|
# HTTP header 'Content-Type'
|
378
|
-
|
390
|
+
local_header_content_type = ['application/json']
|
391
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
379
392
|
|
380
393
|
# form parameters
|
381
394
|
form_params = {}
|
@@ -418,25 +431,25 @@ module Teleswagger
|
|
418
431
|
@api_client.config.logger.debug "Calling API: MessagesApi.send_message_bytes ..."
|
419
432
|
end
|
420
433
|
# verify the required parameter 'token' is set
|
421
|
-
|
422
|
-
fail ArgumentError, "Missing the required parameter 'token' when calling MessagesApi.send_message_bytes"
|
423
|
-
end
|
434
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling MessagesApi.send_message_bytes" if token.nil?
|
424
435
|
# verify the required parameter 'body' is set
|
425
|
-
|
426
|
-
fail ArgumentError, "Missing the required parameter 'body' when calling MessagesApi.send_message_bytes"
|
427
|
-
end
|
436
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling MessagesApi.send_message_bytes" if body.nil?
|
428
437
|
# resource path
|
429
|
-
local_var_path = "/bot{token}/sendMessage#bytes".sub('{' + 'token' + '}', token.to_s)
|
438
|
+
local_var_path = "/bot{token}/sendMessage#bytes".sub('{format}','json').sub('{' + 'token' + '}', token.to_s)
|
430
439
|
|
431
440
|
# query parameters
|
432
441
|
query_params = {}
|
433
442
|
|
434
443
|
# header parameters
|
435
444
|
header_params = {}
|
445
|
+
|
436
446
|
# HTTP header 'Accept' (if needed)
|
437
|
-
|
447
|
+
local_header_accept = ['application/json']
|
448
|
+
local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
|
449
|
+
|
438
450
|
# HTTP header 'Content-Type'
|
439
|
-
|
451
|
+
local_header_content_type = ['application/json']
|
452
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
|
440
453
|
|
441
454
|
# form parameters
|
442
455
|
form_params = {}
|