teleswagger 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
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
 
@@ -100,14 +111,6 @@ module Teleswagger
100
111
  # @return Array for valid properies with the reasons
101
112
  def list_invalid_properties
102
113
  invalid_properties = Array.new
103
- if @inline_query_id.nil?
104
- invalid_properties.push("invalid value for 'inline_query_id', inline_query_id cannot be nil.")
105
- end
106
-
107
- if @results.nil?
108
- invalid_properties.push("invalid value for 'results', results cannot be nil.")
109
- end
110
-
111
114
  return invalid_properties
112
115
  end
113
116
 
@@ -151,7 +154,7 @@ module Teleswagger
151
154
  def build_from_hash(attributes)
152
155
  return nil unless attributes.is_a?(Hash)
153
156
  self.class.swagger_types.each_pair do |key, type|
154
- if type =~ /\AArray<(.*)>/i
157
+ if type =~ /^Array<(.*)>/i
155
158
  # check to ensure the input is an array given that the the attribute
156
159
  # is documented as an array but the input is not
157
160
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -182,7 +185,7 @@ module Teleswagger
182
185
  when :Float
183
186
  value.to_f
184
187
  when :BOOLEAN
185
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
188
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
186
189
  true
187
190
  else
188
191
  false
@@ -193,7 +196,7 @@ module Teleswagger
193
196
  when /\AArray<(?<inner_type>.+)>\z/
194
197
  inner_type = Regexp.last_match[:inner_type]
195
198
  value.map { |v| _deserialize(inner_type, v) }
196
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
199
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
197
200
  k_type = Regexp.last_match[:k_type]
198
201
  v_type = Regexp.last_match[:v_type]
199
202
  {}.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
 
@@ -76,14 +87,6 @@ module Teleswagger
76
87
  # @return Array for valid properies with the reasons
77
88
  def list_invalid_properties
78
89
  invalid_properties = Array.new
79
- if @shipping_query_id.nil?
80
- invalid_properties.push("invalid value for 'shipping_query_id', shipping_query_id cannot be nil.")
81
- end
82
-
83
- if @ok.nil?
84
- invalid_properties.push("invalid value for 'ok', ok cannot be nil.")
85
- end
86
-
87
90
  return invalid_properties
88
91
  end
89
92
 
@@ -124,7 +127,7 @@ module Teleswagger
124
127
  def build_from_hash(attributes)
125
128
  return nil unless attributes.is_a?(Hash)
126
129
  self.class.swagger_types.each_pair do |key, type|
127
- if type =~ /\AArray<(.*)>/i
130
+ if type =~ /^Array<(.*)>/i
128
131
  # check to ensure the input is an array given that the the attribute
129
132
  # is documented as an array but the input is not
130
133
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -155,7 +158,7 @@ module Teleswagger
155
158
  when :Float
156
159
  value.to_f
157
160
  when :BOOLEAN
158
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
159
162
  true
160
163
  else
161
164
  false
@@ -166,7 +169,7 @@ module Teleswagger
166
169
  when /\AArray<(?<inner_type>.+)>\z/
167
170
  inner_type = Regexp.last_match[:inner_type]
168
171
  value.map { |v| _deserialize(inner_type, v) }
169
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
170
173
  k_type = Regexp.last_match[:k_type]
171
174
  v_type = Regexp.last_match[:v_type]
172
175
  {}.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
 
@@ -130,7 +141,7 @@ module Teleswagger
130
141
  def build_from_hash(attributes)
131
142
  return nil unless attributes.is_a?(Hash)
132
143
  self.class.swagger_types.each_pair do |key, type|
133
- if type =~ /\AArray<(.*)>/i
144
+ if type =~ /^Array<(.*)>/i
134
145
  # check to ensure the input is an array given that the the attribute
135
146
  # is documented as an array but the input is not
136
147
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -161,7 +172,7 @@ module Teleswagger
161
172
  when :Float
162
173
  value.to_f
163
174
  when :BOOLEAN
164
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
175
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
165
176
  true
166
177
  else
167
178
  false
@@ -172,7 +183,7 @@ module Teleswagger
172
183
  when /\AArray<(?<inner_type>.+)>\z/
173
184
  inner_type = Regexp.last_match[:inner_type]
174
185
  value.map { |v| _deserialize(inner_type, v) }
175
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
186
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
176
187
  k_type = Regexp.last_match[:k_type]
177
188
  v_type = Regexp.last_match[:v_type]
178
189
  {}.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
 
@@ -76,7 +87,7 @@ module Teleswagger
76
87
  def build_from_hash(attributes)
77
88
  return nil unless attributes.is_a?(Hash)
78
89
  self.class.swagger_types.each_pair do |key, type|
79
- if type =~ /\AArray<(.*)>/i
90
+ if type =~ /^Array<(.*)>/i
80
91
  # check to ensure the input is an array given that the the attribute
81
92
  # is documented as an array but the input is not
82
93
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -107,7 +118,7 @@ module Teleswagger
107
118
  when :Float
108
119
  value.to_f
109
120
  when :BOOLEAN
110
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
121
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
111
122
  true
112
123
  else
113
124
  false
@@ -118,7 +129,7 @@ module Teleswagger
118
129
  when /\AArray<(?<inner_type>.+)>\z/
119
130
  inner_type = Regexp.last_match[:inner_type]
120
131
  value.map { |v| _deserialize(inner_type, v) }
121
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
132
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
122
133
  k_type = Regexp.last_match[:k_type]
123
134
  v_type = Regexp.last_match[:v_type]
124
135
  {}.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
 
@@ -139,7 +150,7 @@ module Teleswagger
139
150
  def build_from_hash(attributes)
140
151
  return nil unless attributes.is_a?(Hash)
141
152
  self.class.swagger_types.each_pair do |key, type|
142
- if type =~ /\AArray<(.*)>/i
153
+ if type =~ /^Array<(.*)>/i
143
154
  # check to ensure the input is an array given that the the attribute
144
155
  # is documented as an array but the input is not
145
156
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -170,7 +181,7 @@ module Teleswagger
170
181
  when :Float
171
182
  value.to_f
172
183
  when :BOOLEAN
173
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
184
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
174
185
  true
175
186
  else
176
187
  false
@@ -181,7 +192,7 @@ module Teleswagger
181
192
  when /\AArray<(?<inner_type>.+)>\z/
182
193
  inner_type = Regexp.last_match[:inner_type]
183
194
  value.map { |v| _deserialize(inner_type, v) }
184
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
195
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
185
196
  k_type = Regexp.last_match[:k_type]
186
197
  v_type = Regexp.last_match[:v_type]
187
198
  {}.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
 
@@ -37,6 +48,10 @@ module Teleswagger
37
48
 
38
49
  attr_accessor :pinned_message
39
50
 
51
+ attr_accessor :sticker_set_name
52
+
53
+ attr_accessor :can_set_sticker_set
54
+
40
55
  class EnumAttributeValidator
41
56
  attr_reader :datatype
42
57
  attr_reader :allowable_values
@@ -72,7 +87,9 @@ module Teleswagger
72
87
  :'photo' => :'photo',
73
88
  :'description' => :'description',
74
89
  :'invite_link' => :'invite_link',
75
- :'pinned_message' => :'pinned_message'
90
+ :'pinned_message' => :'pinned_message',
91
+ :'sticker_set_name' => :'sticker_set_name',
92
+ :'can_set_sticker_set' => :'can_set_sticker_set'
76
93
  }
77
94
  end
78
95
 
@@ -89,7 +106,9 @@ module Teleswagger
89
106
  :'photo' => :'ChatPhoto',
90
107
  :'description' => :'String',
91
108
  :'invite_link' => :'String',
92
- :'pinned_message' => :'Message'
109
+ :'pinned_message' => :'Message',
110
+ :'sticker_set_name' => :'String',
111
+ :'can_set_sticker_set' => :'BOOLEAN'
93
112
  }
94
113
  end
95
114
 
@@ -145,20 +164,20 @@ module Teleswagger
145
164
  self.pinned_message = attributes[:'pinned_message']
146
165
  end
147
166
 
167
+ if attributes.has_key?(:'sticker_set_name')
168
+ self.sticker_set_name = attributes[:'sticker_set_name']
169
+ end
170
+
171
+ if attributes.has_key?(:'can_set_sticker_set')
172
+ self.can_set_sticker_set = attributes[:'can_set_sticker_set']
173
+ end
174
+
148
175
  end
149
176
 
150
177
  # Show invalid properties with the reasons. Usually used together with valid?
151
178
  # @return Array for valid properies with the reasons
152
179
  def list_invalid_properties
153
180
  invalid_properties = Array.new
154
- if @id.nil?
155
- invalid_properties.push("invalid value for 'id', id cannot be nil.")
156
- end
157
-
158
- if @type.nil?
159
- invalid_properties.push("invalid value for 'type', type cannot be nil.")
160
- end
161
-
162
181
  return invalid_properties
163
182
  end
164
183
 
@@ -197,7 +216,9 @@ module Teleswagger
197
216
  photo == o.photo &&
198
217
  description == o.description &&
199
218
  invite_link == o.invite_link &&
200
- pinned_message == o.pinned_message
219
+ pinned_message == o.pinned_message &&
220
+ sticker_set_name == o.sticker_set_name &&
221
+ can_set_sticker_set == o.can_set_sticker_set
201
222
  end
202
223
 
203
224
  # @see the `==` method
@@ -209,7 +230,7 @@ module Teleswagger
209
230
  # Calculates hash code according to all attributes.
210
231
  # @return [Fixnum] Hash code
211
232
  def hash
212
- [id, type, title, username, first_name, last_name, all_members_are_administrators, photo, description, invite_link, pinned_message].hash
233
+ [id, type, title, username, first_name, last_name, all_members_are_administrators, photo, description, invite_link, pinned_message, sticker_set_name, can_set_sticker_set].hash
213
234
  end
214
235
 
215
236
  # Builds the object from hash
@@ -218,7 +239,7 @@ module Teleswagger
218
239
  def build_from_hash(attributes)
219
240
  return nil unless attributes.is_a?(Hash)
220
241
  self.class.swagger_types.each_pair do |key, type|
221
- if type =~ /\AArray<(.*)>/i
242
+ if type =~ /^Array<(.*)>/i
222
243
  # check to ensure the input is an array given that the the attribute
223
244
  # is documented as an array but the input is not
224
245
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -249,7 +270,7 @@ module Teleswagger
249
270
  when :Float
250
271
  value.to_f
251
272
  when :BOOLEAN
252
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
273
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
253
274
  true
254
275
  else
255
276
  false
@@ -260,7 +281,7 @@ module Teleswagger
260
281
  when /\AArray<(?<inner_type>.+)>\z/
261
282
  inner_type = Regexp.last_match[:inner_type]
262
283
  value.map { |v| _deserialize(inner_type, v) }
263
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
284
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
264
285
  k_type = Regexp.last_match[:k_type]
265
286
  v_type = Regexp.last_match[:v_type]
266
287
  {}.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
 
@@ -191,14 +202,6 @@ module Teleswagger
191
202
  # @return Array for valid properies with the reasons
192
203
  def list_invalid_properties
193
204
  invalid_properties = Array.new
194
- if @user.nil?
195
- invalid_properties.push("invalid value for 'user', user cannot be nil.")
196
- end
197
-
198
- if @status.nil?
199
- invalid_properties.push("invalid value for 'status', status cannot be nil.")
200
- end
201
-
202
205
  return invalid_properties
203
206
  end
204
207
 
@@ -263,7 +266,7 @@ module Teleswagger
263
266
  def build_from_hash(attributes)
264
267
  return nil unless attributes.is_a?(Hash)
265
268
  self.class.swagger_types.each_pair do |key, type|
266
- if type =~ /\AArray<(.*)>/i
269
+ if type =~ /^Array<(.*)>/i
267
270
  # check to ensure the input is an array given that the the attribute
268
271
  # is documented as an array but the input is not
269
272
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -294,7 +297,7 @@ module Teleswagger
294
297
  when :Float
295
298
  value.to_f
296
299
  when :BOOLEAN
297
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
300
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
298
301
  true
299
302
  else
300
303
  false
@@ -305,7 +308,7 @@ module Teleswagger
305
308
  when /\AArray<(?<inner_type>.+)>\z/
306
309
  inner_type = Regexp.last_match[:inner_type]
307
310
  value.map { |v| _deserialize(inner_type, v) }
308
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
311
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
309
312
  k_type = Regexp.last_match[:k_type]
310
313
  v_type = Regexp.last_match[:v_type]
311
314
  {}.tap do |hash|