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
|
|
@@ -98,14 +109,6 @@ module Teleswagger
|
|
98
109
|
# @return Array for valid properies with the reasons
|
99
110
|
def list_invalid_properties
|
100
111
|
invalid_properties = Array.new
|
101
|
-
if @chat_id.nil?
|
102
|
-
invalid_properties.push("invalid value for 'chat_id', chat_id cannot be nil.")
|
103
|
-
end
|
104
|
-
|
105
|
-
if @user_id.nil?
|
106
|
-
invalid_properties.push("invalid value for 'user_id', user_id cannot be nil.")
|
107
|
-
end
|
108
|
-
|
109
112
|
return invalid_properties
|
110
113
|
end
|
111
114
|
|
@@ -149,7 +152,7 @@ module Teleswagger
|
|
149
152
|
def build_from_hash(attributes)
|
150
153
|
return nil unless attributes.is_a?(Hash)
|
151
154
|
self.class.swagger_types.each_pair do |key, type|
|
152
|
-
if type =~
|
155
|
+
if type =~ /^Array<(.*)>/i
|
153
156
|
# check to ensure the input is an array given that the the attribute
|
154
157
|
# is documented as an array but the input is not
|
155
158
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -180,7 +183,7 @@ module Teleswagger
|
|
180
183
|
when :Float
|
181
184
|
value.to_f
|
182
185
|
when :BOOLEAN
|
183
|
-
if value.to_s =~
|
186
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
184
187
|
true
|
185
188
|
else
|
186
189
|
false
|
@@ -191,7 +194,7 @@ module Teleswagger
|
|
191
194
|
when /\AArray<(?<inner_type>.+)>\z/
|
192
195
|
inner_type = Regexp.last_match[:inner_type]
|
193
196
|
value.map { |v| _deserialize(inner_type, v) }
|
194
|
-
when /\AHash<(?<k_type
|
197
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
195
198
|
k_type = Regexp.last_match[:k_type]
|
196
199
|
v_type = Regexp.last_match[:v_type]
|
197
200
|
{}.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
|
|
@@ -114,14 +125,6 @@ module Teleswagger
|
|
114
125
|
# @return Array for valid properies with the reasons
|
115
126
|
def list_invalid_properties
|
116
127
|
invalid_properties = Array.new
|
117
|
-
if @chat_id.nil?
|
118
|
-
invalid_properties.push("invalid value for 'chat_id', chat_id cannot be nil.")
|
119
|
-
end
|
120
|
-
|
121
|
-
if @audio.nil?
|
122
|
-
invalid_properties.push("invalid value for 'audio', audio cannot be nil.")
|
123
|
-
end
|
124
|
-
|
125
128
|
return invalid_properties
|
126
129
|
end
|
127
130
|
|
@@ -167,7 +170,7 @@ module Teleswagger
|
|
167
170
|
def build_from_hash(attributes)
|
168
171
|
return nil unless attributes.is_a?(Hash)
|
169
172
|
self.class.swagger_types.each_pair do |key, type|
|
170
|
-
if type =~
|
173
|
+
if type =~ /^Array<(.*)>/i
|
171
174
|
# check to ensure the input is an array given that the the attribute
|
172
175
|
# is documented as an array but the input is not
|
173
176
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -198,7 +201,7 @@ module Teleswagger
|
|
198
201
|
when :Float
|
199
202
|
value.to_f
|
200
203
|
when :BOOLEAN
|
201
|
-
if value.to_s =~
|
204
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
202
205
|
true
|
203
206
|
else
|
204
207
|
false
|
@@ -209,7 +212,7 @@ module Teleswagger
|
|
209
212
|
when /\AArray<(?<inner_type>.+)>\z/
|
210
213
|
inner_type = Regexp.last_match[:inner_type]
|
211
214
|
value.map { |v| _deserialize(inner_type, v) }
|
212
|
-
when /\AHash<(?<k_type
|
215
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
213
216
|
k_type = Regexp.last_match[:k_type]
|
214
217
|
v_type = Regexp.last_match[:v_type]
|
215
218
|
{}.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
|
|
@@ -98,18 +109,6 @@ module Teleswagger
|
|
98
109
|
# @return Array for valid properies with the reasons
|
99
110
|
def list_invalid_properties
|
100
111
|
invalid_properties = Array.new
|
101
|
-
if @chat_id.nil?
|
102
|
-
invalid_properties.push("invalid value for 'chat_id', chat_id cannot be nil.")
|
103
|
-
end
|
104
|
-
|
105
|
-
if @phone_number.nil?
|
106
|
-
invalid_properties.push("invalid value for 'phone_number', phone_number cannot be nil.")
|
107
|
-
end
|
108
|
-
|
109
|
-
if @first_name.nil?
|
110
|
-
invalid_properties.push("invalid value for 'first_name', first_name cannot be nil.")
|
111
|
-
end
|
112
|
-
|
113
112
|
return invalid_properties
|
114
113
|
end
|
115
114
|
|
@@ -154,7 +153,7 @@ module Teleswagger
|
|
154
153
|
def build_from_hash(attributes)
|
155
154
|
return nil unless attributes.is_a?(Hash)
|
156
155
|
self.class.swagger_types.each_pair do |key, type|
|
157
|
-
if type =~
|
156
|
+
if type =~ /^Array<(.*)>/i
|
158
157
|
# check to ensure the input is an array given that the the attribute
|
159
158
|
# is documented as an array but the input is not
|
160
159
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -185,7 +184,7 @@ module Teleswagger
|
|
185
184
|
when :Float
|
186
185
|
value.to_f
|
187
186
|
when :BOOLEAN
|
188
|
-
if value.to_s =~
|
187
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
189
188
|
true
|
190
189
|
else
|
191
190
|
false
|
@@ -196,7 +195,7 @@ module Teleswagger
|
|
196
195
|
when /\AArray<(?<inner_type>.+)>\z/
|
197
196
|
inner_type = Regexp.last_match[:inner_type]
|
198
197
|
value.map { |v| _deserialize(inner_type, v) }
|
199
|
-
when /\AHash<(?<k_type
|
198
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
200
199
|
k_type = Regexp.last_match[:k_type]
|
201
200
|
v_type = Regexp.last_match[:v_type]
|
202
201
|
{}.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
|
|
@@ -90,14 +101,6 @@ module Teleswagger
|
|
90
101
|
# @return Array for valid properies with the reasons
|
91
102
|
def list_invalid_properties
|
92
103
|
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 @document.nil?
|
98
|
-
invalid_properties.push("invalid value for 'document', document cannot be nil.")
|
99
|
-
end
|
100
|
-
|
101
104
|
return invalid_properties
|
102
105
|
end
|
103
106
|
|
@@ -140,7 +143,7 @@ module Teleswagger
|
|
140
143
|
def build_from_hash(attributes)
|
141
144
|
return nil unless attributes.is_a?(Hash)
|
142
145
|
self.class.swagger_types.each_pair do |key, type|
|
143
|
-
if type =~
|
146
|
+
if type =~ /^Array<(.*)>/i
|
144
147
|
# check to ensure the input is an array given that the the attribute
|
145
148
|
# is documented as an array but the input is not
|
146
149
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -171,7 +174,7 @@ module Teleswagger
|
|
171
174
|
when :Float
|
172
175
|
value.to_f
|
173
176
|
when :BOOLEAN
|
174
|
-
if value.to_s =~
|
177
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
175
178
|
true
|
176
179
|
else
|
177
180
|
false
|
@@ -182,7 +185,7 @@ module Teleswagger
|
|
182
185
|
when /\AArray<(?<inner_type>.+)>\z/
|
183
186
|
inner_type = Regexp.last_match[:inner_type]
|
184
187
|
value.map { |v| _deserialize(inner_type, v) }
|
185
|
-
when /\AHash<(?<k_type
|
188
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
186
189
|
k_type = Regexp.last_match[:k_type]
|
187
190
|
v_type = Regexp.last_match[:v_type]
|
188
191
|
{}.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
|
|
@@ -82,14 +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 @chat_id.nil?
|
86
|
-
invalid_properties.push("invalid value for 'chat_id', chat_id cannot be nil.")
|
87
|
-
end
|
88
|
-
|
89
|
-
if @game_short_name.nil?
|
90
|
-
invalid_properties.push("invalid value for 'game_short_name', game_short_name cannot be nil.")
|
91
|
-
end
|
92
|
-
|
93
96
|
return invalid_properties
|
94
97
|
end
|
95
98
|
|
@@ -131,7 +134,7 @@ module Teleswagger
|
|
131
134
|
def build_from_hash(attributes)
|
132
135
|
return nil unless attributes.is_a?(Hash)
|
133
136
|
self.class.swagger_types.each_pair do |key, type|
|
134
|
-
if type =~
|
137
|
+
if type =~ /^Array<(.*)>/i
|
135
138
|
# check to ensure the input is an array given that the the attribute
|
136
139
|
# is documented as an array but the input is not
|
137
140
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -162,7 +165,7 @@ module Teleswagger
|
|
162
165
|
when :Float
|
163
166
|
value.to_f
|
164
167
|
when :BOOLEAN
|
165
|
-
if value.to_s =~
|
168
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
166
169
|
true
|
167
170
|
else
|
168
171
|
false
|
@@ -173,7 +176,7 @@ module Teleswagger
|
|
173
176
|
when /\AArray<(?<inner_type>.+)>\z/
|
174
177
|
inner_type = Regexp.last_match[:inner_type]
|
175
178
|
value.map { |v| _deserialize(inner_type, v) }
|
176
|
-
when /\AHash<(?<k_type
|
179
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
177
180
|
k_type = Regexp.last_match[:k_type]
|
178
181
|
v_type = Regexp.last_match[:v_type]
|
179
182
|
{}.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
|
|
@@ -31,6 +42,8 @@ module Teleswagger
|
|
31
42
|
|
32
43
|
attr_accessor :prices
|
33
44
|
|
45
|
+
attr_accessor :provider_data
|
46
|
+
|
34
47
|
attr_accessor :photo_url
|
35
48
|
|
36
49
|
attr_accessor :photo_size
|
@@ -67,6 +80,7 @@ module Teleswagger
|
|
67
80
|
:'start_parameter' => :'start_parameter',
|
68
81
|
:'currency' => :'currency',
|
69
82
|
:'prices' => :'prices',
|
83
|
+
:'provider_data' => :'provider_data',
|
70
84
|
:'photo_url' => :'photo_url',
|
71
85
|
:'photo_size' => :'photo_size',
|
72
86
|
:'photo_width' => :'photo_width',
|
@@ -93,6 +107,7 @@ module Teleswagger
|
|
93
107
|
:'start_parameter' => :'String',
|
94
108
|
:'currency' => :'String',
|
95
109
|
:'prices' => :'Array<LabeledPrice>',
|
110
|
+
:'provider_data' => :'String',
|
96
111
|
:'photo_url' => :'String',
|
97
112
|
:'photo_size' => :'Integer',
|
98
113
|
:'photo_width' => :'Integer',
|
@@ -150,6 +165,10 @@ module Teleswagger
|
|
150
165
|
end
|
151
166
|
end
|
152
167
|
|
168
|
+
if attributes.has_key?(:'provider_data')
|
169
|
+
self.provider_data = attributes[:'provider_data']
|
170
|
+
end
|
171
|
+
|
153
172
|
if attributes.has_key?(:'photo_url')
|
154
173
|
self.photo_url = attributes[:'photo_url']
|
155
174
|
end
|
@@ -204,38 +223,6 @@ module Teleswagger
|
|
204
223
|
# @return Array for valid properies with the reasons
|
205
224
|
def list_invalid_properties
|
206
225
|
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
226
|
return invalid_properties
|
240
227
|
end
|
241
228
|
|
@@ -266,6 +253,7 @@ module Teleswagger
|
|
266
253
|
start_parameter == o.start_parameter &&
|
267
254
|
currency == o.currency &&
|
268
255
|
prices == o.prices &&
|
256
|
+
provider_data == o.provider_data &&
|
269
257
|
photo_url == o.photo_url &&
|
270
258
|
photo_size == o.photo_size &&
|
271
259
|
photo_width == o.photo_width &&
|
@@ -289,7 +277,7 @@ module Teleswagger
|
|
289
277
|
# Calculates hash code according to all attributes.
|
290
278
|
# @return [Fixnum] Hash code
|
291
279
|
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
|
280
|
+
[chat_id, title, description, payload, provider_token, start_parameter, currency, prices, provider_data, 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
281
|
end
|
294
282
|
|
295
283
|
# Builds the object from hash
|
@@ -298,7 +286,7 @@ module Teleswagger
|
|
298
286
|
def build_from_hash(attributes)
|
299
287
|
return nil unless attributes.is_a?(Hash)
|
300
288
|
self.class.swagger_types.each_pair do |key, type|
|
301
|
-
if type =~
|
289
|
+
if type =~ /^Array<(.*)>/i
|
302
290
|
# check to ensure the input is an array given that the the attribute
|
303
291
|
# is documented as an array but the input is not
|
304
292
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -329,7 +317,7 @@ module Teleswagger
|
|
329
317
|
when :Float
|
330
318
|
value.to_f
|
331
319
|
when :BOOLEAN
|
332
|
-
if value.to_s =~
|
320
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
333
321
|
true
|
334
322
|
else
|
335
323
|
false
|
@@ -340,7 +328,7 @@ module Teleswagger
|
|
340
328
|
when /\AArray<(?<inner_type>.+)>\z/
|
341
329
|
inner_type = Regexp.last_match[:inner_type]
|
342
330
|
value.map { |v| _deserialize(inner_type, v) }
|
343
|
-
when /\AHash<(?<k_type
|
331
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
344
332
|
k_type = Regexp.last_match[:k_type]
|
345
333
|
v_type = Regexp.last_match[:v_type]
|
346
334
|
{}.tap do |hash|
|