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.
Files changed (193) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +5 -5
  3. data/LICENSE +201 -0
  4. data/README.md +88 -74
  5. data/docs/AnswerCallbackQueryBody.md +12 -0
  6. data/docs/AttachmentsApi.md +166 -3
  7. data/docs/CallbacksApi.md +6 -18
  8. data/docs/Chat.md +2 -0
  9. data/docs/ChatsApi.md +112 -9
  10. data/docs/EditMessageCaptionBody.md +1 -0
  11. data/docs/EditMessageLiveLocationBody.md +13 -0
  12. data/docs/GamesApi.md +5 -5
  13. data/docs/GetUpdatesBody.md +11 -0
  14. data/docs/InlineApi.md +1 -1
  15. data/docs/InlineQueryResultAudio.md +1 -0
  16. data/docs/InlineQueryResultCachedAudio.md +1 -0
  17. data/docs/InlineQueryResultCachedDocument.md +1 -0
  18. data/docs/InlineQueryResultCachedGif.md +1 -0
  19. data/docs/InlineQueryResultCachedMpeg4Gif.md +1 -0
  20. data/docs/InlineQueryResultCachedPhoto.md +1 -0
  21. data/docs/InlineQueryResultCachedVideo.md +1 -0
  22. data/docs/InlineQueryResultCachedVoice.md +1 -0
  23. data/docs/InlineQueryResultDocument.md +1 -0
  24. data/docs/InlineQueryResultGif.md +1 -0
  25. data/docs/InlineQueryResultLocation.md +1 -0
  26. data/docs/InlineQueryResultMpeg4Gif.md +1 -0
  27. data/docs/InlineQueryResultPhoto.md +1 -0
  28. data/docs/InlineQueryResultVideo.md +1 -0
  29. data/docs/InlineQueryResultVoice.md +1 -0
  30. data/docs/InlineResponse200.md +1 -1
  31. data/docs/InlineResponse2001.md +1 -1
  32. data/docs/InlineResponse2002.md +1 -1
  33. data/docs/InlineResponse2003.md +1 -1
  34. data/docs/InlineResponse2004.md +1 -1
  35. data/docs/InlineResponse2005.md +1 -1
  36. data/docs/InlineResponse2006.md +1 -1
  37. data/docs/InlineResponse2007.md +1 -1
  38. data/docs/InlineResponse2008.md +1 -1
  39. data/docs/InlineResponse2009.md +1 -1
  40. data/docs/InputLocationMessageContent.md +1 -0
  41. data/docs/InputMediaPhoto.md +11 -0
  42. data/docs/InputMediaVideo.md +15 -0
  43. data/docs/Message.md +3 -0
  44. data/docs/MessagesApi.md +7 -7
  45. data/docs/PaymentsApi.md +1 -1
  46. data/docs/ReplyKeyboardMarkup.md +1 -1
  47. data/docs/SendInvoiceBody.md +1 -0
  48. data/docs/SendLocationBody.md +1 -0
  49. data/docs/SendMediaGroupLinkBody.md +11 -0
  50. data/docs/StickersApi.md +3 -3
  51. data/docs/StopMessageLiveLocationBody.md +11 -0
  52. data/docs/UpdatesApi.md +4 -8
  53. data/docs/UsersApi.md +5 -5
  54. data/git_push.sh +67 -0
  55. data/lib/teleswagger.rb +20 -2
  56. data/lib/teleswagger/api/attachments_api.rb +367 -158
  57. data/lib/teleswagger/api/callbacks_api.rb +29 -47
  58. data/lib/teleswagger/api/chats_api.rb +316 -192
  59. data/lib/teleswagger/api/games_api.rb +46 -35
  60. data/lib/teleswagger/api/inline_api.rb +21 -8
  61. data/lib/teleswagger/api/messages_api.rb +84 -71
  62. data/lib/teleswagger/api/payments_api.rb +39 -26
  63. data/lib/teleswagger/api/stickers_api.rb +107 -116
  64. data/lib/teleswagger/api/updates_api.rb +50 -39
  65. data/lib/teleswagger/api/users_api.rb +36 -23
  66. data/lib/teleswagger/api_client.rb +45 -55
  67. data/lib/teleswagger/api_error.rb +18 -9
  68. data/lib/teleswagger/configuration.rb +13 -8
  69. data/lib/teleswagger/models/add_sticker_to_set_link_body.rb +16 -21
  70. data/lib/teleswagger/models/allowed_update.rb +15 -2
  71. data/lib/teleswagger/models/animation.rb +16 -9
  72. data/lib/teleswagger/models/answer_callback_query_body.rb +235 -0
  73. data/lib/teleswagger/models/answer_inline_query_body.rb +16 -13
  74. data/lib/teleswagger/models/answer_shipping_query_body.rb +16 -13
  75. data/lib/teleswagger/models/audio.rb +16 -5
  76. data/lib/teleswagger/models/callback_game.rb +16 -5
  77. data/lib/teleswagger/models/callback_query.rb +16 -5
  78. data/lib/teleswagger/models/chat.rb +38 -17
  79. data/lib/teleswagger/models/chat_member.rb +16 -13
  80. data/lib/teleswagger/models/chat_photo.rb +16 -5
  81. data/lib/teleswagger/models/chosen_inline_result.rb +16 -17
  82. data/lib/teleswagger/models/contact.rb +16 -5
  83. data/lib/teleswagger/models/create_new_sticker_set_link_body.rb +16 -25
  84. data/lib/teleswagger/models/document.rb +16 -5
  85. data/lib/teleswagger/models/edit_message_caption_body.rb +26 -6
  86. data/lib/teleswagger/models/edit_message_live_location_body.rb +246 -0
  87. data/lib/teleswagger/models/edit_message_reply_markup_body.rb +16 -5
  88. data/lib/teleswagger/models/edit_message_text_body.rb +16 -9
  89. data/lib/teleswagger/models/error.rb +16 -5
  90. data/lib/teleswagger/models/file.rb +16 -5
  91. data/lib/teleswagger/models/force_reply.rb +16 -5
  92. data/lib/teleswagger/models/game.rb +16 -17
  93. data/lib/teleswagger/models/game_high_score.rb +16 -5
  94. data/lib/teleswagger/models/get_updates_body.rb +228 -0
  95. data/lib/teleswagger/models/inline_keyboard_button.rb +16 -5
  96. data/lib/teleswagger/models/inline_keyboard_markup.rb +16 -5
  97. data/lib/teleswagger/models/inline_query.rb +16 -5
  98. data/lib/teleswagger/models/inline_query_result_article.rb +16 -21
  99. data/lib/teleswagger/models/inline_query_result_audio.rb +26 -22
  100. data/lib/teleswagger/models/inline_query_result_cached_audio.rb +26 -18
  101. data/lib/teleswagger/models/inline_query_result_cached_document.rb +26 -18
  102. data/lib/teleswagger/models/inline_query_result_cached_gif.rb +26 -18
  103. data/lib/teleswagger/models/inline_query_result_cached_mpeg4_gif.rb +26 -18
  104. data/lib/teleswagger/models/inline_query_result_cached_photo.rb +26 -18
  105. data/lib/teleswagger/models/inline_query_result_cached_sticker.rb +16 -17
  106. data/lib/teleswagger/models/inline_query_result_cached_video.rb +26 -18
  107. data/lib/teleswagger/models/inline_query_result_cached_voice.rb +26 -18
  108. data/lib/teleswagger/models/inline_query_result_contact.rb +16 -21
  109. data/lib/teleswagger/models/inline_query_result_document.rb +26 -26
  110. data/lib/teleswagger/models/inline_query_result_game.rb +16 -17
  111. data/lib/teleswagger/models/inline_query_result_gif.rb +26 -22
  112. data/lib/teleswagger/models/inline_query_result_location.rb +50 -24
  113. data/lib/teleswagger/models/inline_query_result_mpeg4_gif.rb +26 -22
  114. data/lib/teleswagger/models/inline_query_result_photo.rb +26 -22
  115. data/lib/teleswagger/models/inline_query_result_venue.rb +16 -29
  116. data/lib/teleswagger/models/inline_query_result_video.rb +26 -30
  117. data/lib/teleswagger/models/inline_query_result_voice.rb +26 -22
  118. data/lib/teleswagger/models/inline_response_200.rb +17 -6
  119. data/lib/teleswagger/models/inline_response_200_1.rb +17 -6
  120. data/lib/teleswagger/models/inline_response_200_2.rb +20 -7
  121. data/lib/teleswagger/models/inline_response_200_3.rb +17 -6
  122. data/lib/teleswagger/models/inline_response_200_4.rb +18 -9
  123. data/lib/teleswagger/models/inline_response_200_5.rb +17 -6
  124. data/lib/teleswagger/models/inline_response_200_6.rb +17 -6
  125. data/lib/teleswagger/models/inline_response_200_7.rb +17 -6
  126. data/lib/teleswagger/models/inline_response_200_8.rb +17 -6
  127. data/lib/teleswagger/models/inline_response_200_9.rb +17 -6
  128. data/lib/teleswagger/models/inline_type.rb +13 -2
  129. data/lib/teleswagger/models/input_contact_message_content.rb +16 -13
  130. data/lib/teleswagger/models/input_location_message_content.rb +51 -13
  131. data/lib/teleswagger/models/input_media_photo.rb +228 -0
  132. data/lib/teleswagger/models/input_media_video.rb +264 -0
  133. data/lib/teleswagger/models/input_text_message_content.rb +16 -9
  134. data/lib/teleswagger/models/input_venue_message_content.rb +16 -21
  135. data/lib/teleswagger/models/invoice.rb +16 -5
  136. data/lib/teleswagger/models/keyboard_button.rb +16 -5
  137. data/lib/teleswagger/models/labeled_price.rb +16 -5
  138. data/lib/teleswagger/models/location.rb +16 -5
  139. data/lib/teleswagger/models/mask_position.rb +16 -5
  140. data/lib/teleswagger/models/message.rb +49 -9
  141. data/lib/teleswagger/models/message_entity.rb +16 -5
  142. data/lib/teleswagger/models/order_info.rb +16 -5
  143. data/lib/teleswagger/models/parse_mode.rb +13 -2
  144. data/lib/teleswagger/models/photo_size.rb +16 -5
  145. data/lib/teleswagger/models/pre_checkout_query.rb +16 -5
  146. data/lib/teleswagger/models/promote_chat_member_body.rb +16 -13
  147. data/lib/teleswagger/models/reply_keyboard_markup.rb +17 -6
  148. data/lib/teleswagger/models/reply_keyboard_remove.rb +16 -5
  149. data/lib/teleswagger/models/response_bool.rb +16 -5
  150. data/lib/teleswagger/models/response_message.rb +16 -5
  151. data/lib/teleswagger/models/response_parameters.rb +16 -5
  152. data/lib/teleswagger/models/response_update.rb +16 -5
  153. data/lib/teleswagger/models/restrict_chat_member_body.rb +16 -13
  154. data/lib/teleswagger/models/send_audio_link_body.rb +16 -13
  155. data/lib/teleswagger/models/send_contact_body.rb +16 -17
  156. data/lib/teleswagger/models/send_document_link_body.rb +16 -13
  157. data/lib/teleswagger/models/send_game_body.rb +16 -13
  158. data/lib/teleswagger/models/send_invoice_body.rb +26 -38
  159. data/lib/teleswagger/models/send_location_body.rb +50 -16
  160. data/lib/teleswagger/models/send_media_group_link_body.rb +230 -0
  161. data/lib/teleswagger/models/send_message_body.rb +16 -13
  162. data/lib/teleswagger/models/send_photo_link_body.rb +16 -13
  163. data/lib/teleswagger/models/send_sticker_link_body.rb +16 -13
  164. data/lib/teleswagger/models/send_venue_body.rb +16 -25
  165. data/lib/teleswagger/models/send_video_link_body.rb +16 -13
  166. data/lib/teleswagger/models/send_video_note_link_body.rb +16 -13
  167. data/lib/teleswagger/models/send_voice_link_body.rb +16 -13
  168. data/lib/teleswagger/models/shipping_address.rb +16 -5
  169. data/lib/teleswagger/models/shipping_option.rb +16 -5
  170. data/lib/teleswagger/models/shipping_query.rb +16 -5
  171. data/lib/teleswagger/models/sticker.rb +16 -5
  172. data/lib/teleswagger/models/sticker_set.rb +16 -5
  173. data/lib/teleswagger/models/stop_message_live_location_body.rb +226 -0
  174. data/lib/teleswagger/models/successful_payment.rb +16 -5
  175. data/lib/teleswagger/models/update.rb +16 -5
  176. data/lib/teleswagger/models/user.rb +16 -5
  177. data/lib/teleswagger/models/user_profile_photos.rb +16 -5
  178. data/lib/teleswagger/models/venue.rb +16 -5
  179. data/lib/teleswagger/models/video.rb +16 -5
  180. data/lib/teleswagger/models/video_note.rb +16 -5
  181. data/lib/teleswagger/models/voice.rb +16 -5
  182. data/lib/teleswagger/models/webhook_info.rb +16 -17
  183. data/lib/teleswagger/version.rb +15 -4
  184. data/spec/models/answer_callback_query_body_spec.rb +77 -0
  185. data/spec/models/edit_message_live_location_body_spec.rb +83 -0
  186. data/spec/models/get_updates_body_spec.rb +71 -0
  187. data/spec/models/input_media_photo_spec.rb +71 -0
  188. data/spec/models/input_media_video_spec.rb +95 -0
  189. data/spec/models/send_media_group_link_body_spec.rb +71 -0
  190. data/spec/models/stop_message_live_location_body_spec.rb +71 -0
  191. data/swagger.yaml +428 -52
  192. data/teleswagger.gemspec +17 -8
  193. 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.3
6
+ OpenAPI spec version: 3.6
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.2.3
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 :caption
33
44
 
45
+ attr_accessor :parse_mode
46
+
34
47
  attr_accessor :reply_markup
35
48
 
36
49
  attr_accessor :input_message_content
@@ -47,6 +60,7 @@ module Teleswagger
47
60
  :'photo_height' => :'photo_height',
48
61
  :'title' => :'title',
49
62
  :'caption' => :'caption',
63
+ :'parse_mode' => :'parse_mode',
50
64
  :'reply_markup' => :'reply_markup',
51
65
  :'input_message_content' => :'input_message_content'
52
66
  }
@@ -63,6 +77,7 @@ module Teleswagger
63
77
  :'photo_height' => :'Integer',
64
78
  :'title' => :'String',
65
79
  :'caption' => :'String',
80
+ :'parse_mode' => :'ParseMode',
66
81
  :'reply_markup' => :'InlineKeyboardMarkup',
67
82
  :'input_message_content' => :'Object'
68
83
  }
@@ -108,6 +123,10 @@ module Teleswagger
108
123
  self.caption = attributes[:'caption']
109
124
  end
110
125
 
126
+ if attributes.has_key?(:'parse_mode')
127
+ self.parse_mode = attributes[:'parse_mode']
128
+ end
129
+
111
130
  if attributes.has_key?(:'reply_markup')
112
131
  self.reply_markup = attributes[:'reply_markup']
113
132
  end
@@ -122,22 +141,6 @@ module Teleswagger
122
141
  # @return Array for valid properies with the reasons
123
142
  def list_invalid_properties
124
143
  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 @photo_url.nil?
134
- invalid_properties.push("invalid value for 'photo_url', photo_url cannot be nil.")
135
- end
136
-
137
- if @thumb_url.nil?
138
- invalid_properties.push("invalid value for 'thumb_url', thumb_url cannot be nil.")
139
- end
140
-
141
144
  return invalid_properties
142
145
  end
143
146
 
@@ -164,6 +167,7 @@ module Teleswagger
164
167
  photo_height == o.photo_height &&
165
168
  title == o.title &&
166
169
  caption == o.caption &&
170
+ parse_mode == o.parse_mode &&
167
171
  reply_markup == o.reply_markup &&
168
172
  input_message_content == o.input_message_content
169
173
  end
@@ -177,7 +181,7 @@ module Teleswagger
177
181
  # Calculates hash code according to all attributes.
178
182
  # @return [Fixnum] Hash code
179
183
  def hash
180
- [type, id, photo_url, thumb_url, photo_width, photo_height, title, caption, reply_markup, input_message_content].hash
184
+ [type, id, photo_url, thumb_url, photo_width, photo_height, title, caption, parse_mode, reply_markup, input_message_content].hash
181
185
  end
182
186
 
183
187
  # Builds the object from hash
@@ -186,7 +190,7 @@ module Teleswagger
186
190
  def build_from_hash(attributes)
187
191
  return nil unless attributes.is_a?(Hash)
188
192
  self.class.swagger_types.each_pair do |key, type|
189
- if type =~ /\AArray<(.*)>/i
193
+ if type =~ /^Array<(.*)>/i
190
194
  # check to ensure the input is an array given that the the attribute
191
195
  # is documented as an array but the input is not
192
196
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -217,7 +221,7 @@ module Teleswagger
217
221
  when :Float
218
222
  value.to_f
219
223
  when :BOOLEAN
220
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
224
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
221
225
  true
222
226
  else
223
227
  false
@@ -228,7 +232,7 @@ module Teleswagger
228
232
  when /\AArray<(?<inner_type>.+)>\z/
229
233
  inner_type = Regexp.last_match[:inner_type]
230
234
  value.map { |v| _deserialize(inner_type, v) }
231
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
235
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
232
236
  k_type = Regexp.last_match[:k_type]
233
237
  v_type = Regexp.last_match[:v_type]
234
238
  {}.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.3
6
+ OpenAPI spec version: 3.6
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.2.3
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
 
@@ -138,30 +149,6 @@ module Teleswagger
138
149
  # @return Array for valid properies with the reasons
139
150
  def list_invalid_properties
140
151
  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 @latitude.nil?
150
- invalid_properties.push("invalid value for 'latitude', latitude cannot be nil.")
151
- end
152
-
153
- if @longitude.nil?
154
- invalid_properties.push("invalid value for 'longitude', longitude cannot be nil.")
155
- end
156
-
157
- if @title.nil?
158
- invalid_properties.push("invalid value for 'title', title cannot be nil.")
159
- end
160
-
161
- if @address.nil?
162
- invalid_properties.push("invalid value for 'address', address cannot be nil.")
163
- end
164
-
165
152
  return invalid_properties
166
153
  end
167
154
 
@@ -214,7 +201,7 @@ module Teleswagger
214
201
  def build_from_hash(attributes)
215
202
  return nil unless attributes.is_a?(Hash)
216
203
  self.class.swagger_types.each_pair do |key, type|
217
- if type =~ /\AArray<(.*)>/i
204
+ if type =~ /^Array<(.*)>/i
218
205
  # check to ensure the input is an array given that the the attribute
219
206
  # is documented as an array but the input is not
220
207
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -245,7 +232,7 @@ module Teleswagger
245
232
  when :Float
246
233
  value.to_f
247
234
  when :BOOLEAN
248
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
235
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
249
236
  true
250
237
  else
251
238
  false
@@ -256,7 +243,7 @@ module Teleswagger
256
243
  when /\AArray<(?<inner_type>.+)>\z/
257
244
  inner_type = Regexp.last_match[:inner_type]
258
245
  value.map { |v| _deserialize(inner_type, v) }
259
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
246
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
260
247
  k_type = Regexp.last_match[:k_type]
261
248
  v_type = Regexp.last_match[:v_type]
262
249
  {}.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.3
6
+ OpenAPI spec version: 3.6
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.2.3
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
 
@@ -29,6 +40,8 @@ module Teleswagger
29
40
 
30
41
  attr_accessor :caption
31
42
 
43
+ attr_accessor :parse_mode
44
+
32
45
  attr_accessor :video_width
33
46
 
34
47
  attr_accessor :video_height
@@ -52,6 +65,7 @@ module Teleswagger
52
65
  :'thumb_url' => :'thumb_url',
53
66
  :'title' => :'title',
54
67
  :'caption' => :'caption',
68
+ :'parse_mode' => :'parse_mode',
55
69
  :'video_width' => :'video_width',
56
70
  :'video_height' => :'video_height',
57
71
  :'video_duration' => :'video_duration',
@@ -71,6 +85,7 @@ module Teleswagger
71
85
  :'thumb_url' => :'String',
72
86
  :'title' => :'String',
73
87
  :'caption' => :'String',
88
+ :'parse_mode' => :'ParseMode',
74
89
  :'video_width' => :'Integer',
75
90
  :'video_height' => :'Integer',
76
91
  :'video_duration' => :'Integer',
@@ -116,6 +131,10 @@ module Teleswagger
116
131
  self.caption = attributes[:'caption']
117
132
  end
118
133
 
134
+ if attributes.has_key?(:'parse_mode')
135
+ self.parse_mode = attributes[:'parse_mode']
136
+ end
137
+
119
138
  if attributes.has_key?(:'video_width')
120
139
  self.video_width = attributes[:'video_width']
121
140
  end
@@ -146,30 +165,6 @@ module Teleswagger
146
165
  # @return Array for valid properies with the reasons
147
166
  def list_invalid_properties
148
167
  invalid_properties = Array.new
149
- if @type.nil?
150
- invalid_properties.push("invalid value for 'type', type cannot be nil.")
151
- end
152
-
153
- if @id.nil?
154
- invalid_properties.push("invalid value for 'id', id cannot be nil.")
155
- end
156
-
157
- if @video_url.nil?
158
- invalid_properties.push("invalid value for 'video_url', video_url cannot be nil.")
159
- end
160
-
161
- if @mime_type.nil?
162
- invalid_properties.push("invalid value for 'mime_type', mime_type cannot be nil.")
163
- end
164
-
165
- if @thumb_url.nil?
166
- invalid_properties.push("invalid value for 'thumb_url', thumb_url cannot be nil.")
167
- end
168
-
169
- if @title.nil?
170
- invalid_properties.push("invalid value for 'title', title cannot be nil.")
171
- end
172
-
173
168
  return invalid_properties
174
169
  end
175
170
 
@@ -197,6 +192,7 @@ module Teleswagger
197
192
  thumb_url == o.thumb_url &&
198
193
  title == o.title &&
199
194
  caption == o.caption &&
195
+ parse_mode == o.parse_mode &&
200
196
  video_width == o.video_width &&
201
197
  video_height == o.video_height &&
202
198
  video_duration == o.video_duration &&
@@ -214,7 +210,7 @@ module Teleswagger
214
210
  # Calculates hash code according to all attributes.
215
211
  # @return [Fixnum] Hash code
216
212
  def hash
217
- [type, id, video_url, mime_type, thumb_url, title, caption, video_width, video_height, video_duration, description, reply_markup, input_message_content].hash
213
+ [type, id, video_url, mime_type, thumb_url, title, caption, parse_mode, video_width, video_height, video_duration, description, reply_markup, input_message_content].hash
218
214
  end
219
215
 
220
216
  # Builds the object from hash
@@ -223,7 +219,7 @@ module Teleswagger
223
219
  def build_from_hash(attributes)
224
220
  return nil unless attributes.is_a?(Hash)
225
221
  self.class.swagger_types.each_pair do |key, type|
226
- if type =~ /\AArray<(.*)>/i
222
+ if type =~ /^Array<(.*)>/i
227
223
  # check to ensure the input is an array given that the the attribute
228
224
  # is documented as an array but the input is not
229
225
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -254,7 +250,7 @@ module Teleswagger
254
250
  when :Float
255
251
  value.to_f
256
252
  when :BOOLEAN
257
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
253
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
258
254
  true
259
255
  else
260
256
  false
@@ -265,7 +261,7 @@ module Teleswagger
265
261
  when /\AArray<(?<inner_type>.+)>\z/
266
262
  inner_type = Regexp.last_match[:inner_type]
267
263
  value.map { |v| _deserialize(inner_type, v) }
268
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
264
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
269
265
  k_type = Regexp.last_match[:k_type]
270
266
  v_type = Regexp.last_match[:v_type]
271
267
  {}.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.3
6
+ OpenAPI spec version: 3.6
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.2.3
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 :voice_duration
29
42
 
30
43
  attr_accessor :input_message_content
@@ -40,6 +53,7 @@ module Teleswagger
40
53
  :'voice_url' => :'voice_url',
41
54
  :'title' => :'title',
42
55
  :'caption' => :'caption',
56
+ :'parse_mode' => :'parse_mode',
43
57
  :'voice_duration' => :'voice_duration',
44
58
  :'input_message_content' => :'input_message_content',
45
59
  :'reply_markup' => :'reply_markup'
@@ -54,6 +68,7 @@ module Teleswagger
54
68
  :'voice_url' => :'String',
55
69
  :'title' => :'String',
56
70
  :'caption' => :'String',
71
+ :'parse_mode' => :'ParseMode',
57
72
  :'voice_duration' => :'Integer',
58
73
  :'input_message_content' => :'Object',
59
74
  :'reply_markup' => :'InlineKeyboardMarkup'
@@ -88,6 +103,10 @@ module Teleswagger
88
103
  self.caption = attributes[:'caption']
89
104
  end
90
105
 
106
+ if attributes.has_key?(:'parse_mode')
107
+ self.parse_mode = attributes[:'parse_mode']
108
+ end
109
+
91
110
  if attributes.has_key?(:'voice_duration')
92
111
  self.voice_duration = attributes[:'voice_duration']
93
112
  end
@@ -106,22 +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 @voice_url.nil?
118
- invalid_properties.push("invalid value for 'voice_url', voice_url cannot be nil.")
119
- end
120
-
121
- if @title.nil?
122
- invalid_properties.push("invalid value for 'title', title cannot be nil.")
123
- end
124
-
125
128
  return invalid_properties
126
129
  end
127
130
 
@@ -145,6 +148,7 @@ module Teleswagger
145
148
  voice_url == o.voice_url &&
146
149
  title == o.title &&
147
150
  caption == o.caption &&
151
+ parse_mode == o.parse_mode &&
148
152
  voice_duration == o.voice_duration &&
149
153
  input_message_content == o.input_message_content &&
150
154
  reply_markup == o.reply_markup
@@ -159,7 +163,7 @@ module Teleswagger
159
163
  # Calculates hash code according to all attributes.
160
164
  # @return [Fixnum] Hash code
161
165
  def hash
162
- [type, id, voice_url, title, caption, voice_duration, input_message_content, reply_markup].hash
166
+ [type, id, voice_url, title, caption, parse_mode, voice_duration, input_message_content, reply_markup].hash
163
167
  end
164
168
 
165
169
  # Builds the object from hash
@@ -168,7 +172,7 @@ module Teleswagger
168
172
  def build_from_hash(attributes)
169
173
  return nil unless attributes.is_a?(Hash)
170
174
  self.class.swagger_types.each_pair do |key, type|
171
- if type =~ /\AArray<(.*)>/i
175
+ if type =~ /^Array<(.*)>/i
172
176
  # check to ensure the input is an array given that the the attribute
173
177
  # is documented as an array but the input is not
174
178
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -199,7 +203,7 @@ module Teleswagger
199
203
  when :Float
200
204
  value.to_f
201
205
  when :BOOLEAN
202
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
206
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
203
207
  true
204
208
  else
205
209
  false
@@ -210,7 +214,7 @@ module Teleswagger
210
214
  when /\AArray<(?<inner_type>.+)>\z/
211
215
  inner_type = Regexp.last_match[:inner_type]
212
216
  value.map { |v| _deserialize(inner_type, v) }
213
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
217
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
214
218
  k_type = Regexp.last_match[:k_type]
215
219
  v_type = Regexp.last_match[:v_type]
216
220
  {}.tap do |hash|