kuapir 0.1.2

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 (190) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +13 -0
  3. data/Gemfile.lock +77 -0
  4. data/LICENSE +21 -0
  5. data/README.md +170 -0
  6. data/Rakefile +12 -0
  7. data/docs/BoxOffice.md +26 -0
  8. data/docs/BoxOfficeResponse.md +20 -0
  9. data/docs/Company.md +18 -0
  10. data/docs/Country.md +18 -0
  11. data/docs/DigitalReleaseItem.md +44 -0
  12. data/docs/DigitalReleaseResponse.md +22 -0
  13. data/docs/Distribution.md +28 -0
  14. data/docs/DistributionResponse.md +20 -0
  15. data/docs/Episode.md +28 -0
  16. data/docs/Fact.md +22 -0
  17. data/docs/FactResponse.md +20 -0
  18. data/docs/Film.md +100 -0
  19. data/docs/FilmSearchByFiltersResponse.md +22 -0
  20. data/docs/FilmSearchByFiltersResponseItems.md +42 -0
  21. data/docs/FilmSearchResponse.md +24 -0
  22. data/docs/FilmSearchResponseFilms.md +42 -0
  23. data/docs/FilmSequelsAndPrequelsResponse.md +30 -0
  24. data/docs/FilmTopResponse.md +20 -0
  25. data/docs/FilmTopResponseFilms.md +38 -0
  26. data/docs/FilmsApi.md +1126 -0
  27. data/docs/FiltersResponse.md +20 -0
  28. data/docs/FiltersResponseCountries.md +20 -0
  29. data/docs/FiltersResponseGenres.md +20 -0
  30. data/docs/Genre.md +18 -0
  31. data/docs/ImageResponse.md +22 -0
  32. data/docs/ImageResponseItems.md +20 -0
  33. data/docs/PersonByNameResponse.md +20 -0
  34. data/docs/PersonByNameResponseItems.md +28 -0
  35. data/docs/PersonResponse.md +50 -0
  36. data/docs/PersonResponseFilms.md +30 -0
  37. data/docs/PersonResponseSpouses.md +32 -0
  38. data/docs/PersonsApi.md +83 -0
  39. data/docs/PremiereResponse.md +20 -0
  40. data/docs/PremiereResponseItem.md +36 -0
  41. data/docs/RelatedFilmResponse.md +20 -0
  42. data/docs/RelatedFilmResponseItems.md +30 -0
  43. data/docs/ReviewDetailsResponse.md +32 -0
  44. data/docs/ReviewsApi.md +155 -0
  45. data/docs/ReviewsResponse.md +34 -0
  46. data/docs/ReviewsResponseReviews.md +32 -0
  47. data/docs/Season.md +20 -0
  48. data/docs/SeasonResponse.md +20 -0
  49. data/docs/StaffApi.md +147 -0
  50. data/docs/StaffResponse.md +30 -0
  51. data/docs/VideoResponse.md +20 -0
  52. data/docs/VideoResponseItems.md +22 -0
  53. data/kinopoiskapiunofficial-openapi.json +2918 -0
  54. data/kuapir.gemspec +42 -0
  55. data/lib/kuapir/api/films_api.rb +1193 -0
  56. data/lib/kuapir/api/persons_api.rb +89 -0
  57. data/lib/kuapir/api/reviews_api.rb +165 -0
  58. data/lib/kuapir/api/staff_api.rb +145 -0
  59. data/lib/kuapir/api_client.rb +390 -0
  60. data/lib/kuapir/api_error.rb +57 -0
  61. data/lib/kuapir/configuration.rb +287 -0
  62. data/lib/kuapir/models/box_office.rb +246 -0
  63. data/lib/kuapir/models/box_office_response.rb +224 -0
  64. data/lib/kuapir/models/company.rb +214 -0
  65. data/lib/kuapir/models/country.rb +214 -0
  66. data/lib/kuapir/models/digital_release_item.rb +334 -0
  67. data/lib/kuapir/models/digital_release_response.rb +232 -0
  68. data/lib/kuapir/models/distribution.rb +300 -0
  69. data/lib/kuapir/models/distribution_response.rb +224 -0
  70. data/lib/kuapir/models/episode.rb +249 -0
  71. data/lib/kuapir/models/fact.rb +266 -0
  72. data/lib/kuapir/models/fact_response.rb +224 -0
  73. data/lib/kuapir/models/film.rb +551 -0
  74. data/lib/kuapir/models/film_search_by_filters_response.rb +232 -0
  75. data/lib/kuapir/models/film_search_by_filters_response_items.rb +319 -0
  76. data/lib/kuapir/models/film_search_response.rb +244 -0
  77. data/lib/kuapir/models/film_search_response_films.rb +311 -0
  78. data/lib/kuapir/models/film_sequels_and_prequels_response.rb +300 -0
  79. data/lib/kuapir/models/film_top_response.rb +224 -0
  80. data/lib/kuapir/models/film_top_response_films.rb +272 -0
  81. data/lib/kuapir/models/filters_response.rb +226 -0
  82. data/lib/kuapir/models/filters_response_countries.rb +214 -0
  83. data/lib/kuapir/models/filters_response_genres.rb +214 -0
  84. data/lib/kuapir/models/genre.rb +214 -0
  85. data/lib/kuapir/models/image_response.rb +238 -0
  86. data/lib/kuapir/models/image_response_items.rb +214 -0
  87. data/lib/kuapir/models/person_by_name_response.rb +224 -0
  88. data/lib/kuapir/models/person_by_name_response_items.rb +274 -0
  89. data/lib/kuapir/models/person_response.rb +363 -0
  90. data/lib/kuapir/models/person_response_films.rb +284 -0
  91. data/lib/kuapir/models/person_response_spouses.rb +283 -0
  92. data/lib/kuapir/models/premiere_response.rb +224 -0
  93. data/lib/kuapir/models/premiere_response_item.rb +289 -0
  94. data/lib/kuapir/models/related_film_response.rb +224 -0
  95. data/lib/kuapir/models/related_film_response_items.rb +279 -0
  96. data/lib/kuapir/models/review_details_response.rb +314 -0
  97. data/lib/kuapir/models/reviews_response.rb +294 -0
  98. data/lib/kuapir/models/reviews_response_reviews.rb +282 -0
  99. data/lib/kuapir/models/season.rb +224 -0
  100. data/lib/kuapir/models/season_response.rb +224 -0
  101. data/lib/kuapir/models/staff_response.rb +301 -0
  102. data/lib/kuapir/models/video_response.rb +224 -0
  103. data/lib/kuapir/models/video_response_items.rb +255 -0
  104. data/lib/kuapir/version.rb +5 -0
  105. data/lib/kuapir.rb +83 -0
  106. data/openapi-generator-templates/Gemfile.mustache +9 -0
  107. data/openapi-generator-templates/README.mustache +148 -0
  108. data/openapi-generator-templates/Rakefile.mustache +10 -0
  109. data/openapi-generator-templates/api.mustache +205 -0
  110. data/openapi-generator-templates/api_client.mustache +260 -0
  111. data/openapi-generator-templates/api_client_faraday_partial.mustache +136 -0
  112. data/openapi-generator-templates/api_client_spec.mustache +216 -0
  113. data/openapi-generator-templates/api_client_typhoeus_partial.mustache +153 -0
  114. data/openapi-generator-templates/api_doc.mustache +118 -0
  115. data/openapi-generator-templates/api_error.mustache +45 -0
  116. data/openapi-generator-templates/api_info.mustache +12 -0
  117. data/openapi-generator-templates/api_test.mustache +43 -0
  118. data/openapi-generator-templates/base_object.mustache +120 -0
  119. data/openapi-generator-templates/configuration.mustache +381 -0
  120. data/openapi-generator-templates/configuration_spec.mustache +30 -0
  121. data/openapi-generator-templates/configuration_tls_faraday_partial.mustache +29 -0
  122. data/openapi-generator-templates/configuration_tls_typhoeus_partial.mustache +34 -0
  123. data/openapi-generator-templates/gem.mustache +50 -0
  124. data/openapi-generator-templates/gemspec.mustache +31 -0
  125. data/openapi-generator-templates/git_push.sh.mustache +57 -0
  126. data/openapi-generator-templates/gitignore.mustache +39 -0
  127. data/openapi-generator-templates/model.mustache +22 -0
  128. data/openapi-generator-templates/model_doc.mustache +12 -0
  129. data/openapi-generator-templates/model_test.mustache +73 -0
  130. data/openapi-generator-templates/partial_model_enum_class.mustache +20 -0
  131. data/openapi-generator-templates/partial_model_generic.mustache +371 -0
  132. data/openapi-generator-templates/partial_model_generic_doc.mustache +28 -0
  133. data/openapi-generator-templates/partial_oneof_module.mustache +137 -0
  134. data/openapi-generator-templates/partial_oneof_module_doc.mustache +92 -0
  135. data/openapi-generator-templates/rspec.mustache +2 -0
  136. data/openapi-generator-templates/rubocop.mustache +148 -0
  137. data/openapi-generator-templates/spec_helper.mustache +99 -0
  138. data/openapi-generator-templates/travis.mustache +14 -0
  139. data/openapi-generator-templates/version.mustache +3 -0
  140. data/openapitools.json +21 -0
  141. data/spec/api/films_api_spec.rb +227 -0
  142. data/spec/api/persons_api_spec.rb +45 -0
  143. data/spec/api/reviews_api_spec.rb +57 -0
  144. data/spec/api/staff_api_spec.rb +54 -0
  145. data/spec/api_client_spec.rb +229 -0
  146. data/spec/configuration_spec.rb +28 -0
  147. data/spec/models/box_office_response_spec.rb +37 -0
  148. data/spec/models/box_office_spec.rb +55 -0
  149. data/spec/models/company_spec.rb +31 -0
  150. data/spec/models/country_spec.rb +31 -0
  151. data/spec/models/digital_release_item_spec.rb +109 -0
  152. data/spec/models/digital_release_response_spec.rb +43 -0
  153. data/spec/models/distribution_response_spec.rb +37 -0
  154. data/spec/models/distribution_spec.rb +69 -0
  155. data/spec/models/episode_spec.rb +61 -0
  156. data/spec/models/fact_response_spec.rb +37 -0
  157. data/spec/models/fact_spec.rb +47 -0
  158. data/spec/models/film_search_by_filters_response_items_spec.rb +107 -0
  159. data/spec/models/film_search_by_filters_response_spec.rb +43 -0
  160. data/spec/models/film_search_response_films_spec.rb +107 -0
  161. data/spec/models/film_search_response_spec.rb +49 -0
  162. data/spec/models/film_sequels_and_prequels_response_spec.rb +71 -0
  163. data/spec/models/film_spec.rb +285 -0
  164. data/spec/models/film_top_response_films_spec.rb +91 -0
  165. data/spec/models/film_top_response_spec.rb +37 -0
  166. data/spec/models/filters_response_countries_spec.rb +37 -0
  167. data/spec/models/filters_response_genres_spec.rb +37 -0
  168. data/spec/models/filters_response_spec.rb +37 -0
  169. data/spec/models/genre_spec.rb +31 -0
  170. data/spec/models/image_response_items_spec.rb +37 -0
  171. data/spec/models/image_response_spec.rb +43 -0
  172. data/spec/models/person_by_name_response_items_spec.rb +65 -0
  173. data/spec/models/person_by_name_response_spec.rb +37 -0
  174. data/spec/models/person_response_films_spec.rb +71 -0
  175. data/spec/models/person_response_spec.rb +131 -0
  176. data/spec/models/person_response_spouses_spec.rb +77 -0
  177. data/spec/models/premiere_response_item_spec.rb +85 -0
  178. data/spec/models/premiere_response_spec.rb +37 -0
  179. data/spec/models/related_film_response_items_spec.rb +71 -0
  180. data/spec/models/related_film_response_spec.rb +37 -0
  181. data/spec/models/review_details_response_spec.rb +77 -0
  182. data/spec/models/reviews_response_reviews_spec.rb +77 -0
  183. data/spec/models/reviews_response_spec.rb +79 -0
  184. data/spec/models/season_response_spec.rb +37 -0
  185. data/spec/models/season_spec.rb +37 -0
  186. data/spec/models/staff_response_spec.rb +71 -0
  187. data/spec/models/video_response_items_spec.rb +47 -0
  188. data/spec/models/video_response_spec.rb +37 -0
  189. data/spec/spec_helper.rb +107 -0
  190. metadata +326 -0
@@ -0,0 +1,227 @@
1
+ # frozen_string_literal: true
2
+
3
+ # #Kinopoisk Unofficial API
4
+
5
+ # The version of the OpenAPI document: 2.0.1
6
+ # Contact: support@kinopoiskapiunofficial.tech
7
+ # Generated by: https://openapi-generator.tech
8
+ # OpenAPI Generator version: 5.3.1
9
+ #
10
+
11
+ require "spec_helper"
12
+ require "json"
13
+
14
+ # Unit tests for Kuapir::FilmsApi
15
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
16
+ # Please update as you see appropriate
17
+ describe "FilmsApi" do
18
+ before do
19
+ # run before each test
20
+ @api_instance = Kuapir::FilmsApi.new
21
+ end
22
+
23
+ after do
24
+ # run after each test
25
+ end
26
+
27
+ describe "test an instance of FilmsApi" do
28
+ it "should create an instance of FilmsApi" do
29
+ expect(@api_instance).to be_instance_of(Kuapir::FilmsApi)
30
+ end
31
+ end
32
+
33
+ # unit tests for api_v21_films_id_sequels_and_prequels_get
34
+ # получить сиквелы и приквелы для фильма по kinopoisk film id
35
+ # tbd
36
+ # @param id kinopoisk film id
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<FilmSequelsAndPrequelsResponse>]
39
+ describe "api_v21_films_id_sequels_and_prequels_get test" do
40
+ it "should work" do
41
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
42
+ end
43
+ end
44
+
45
+ # unit tests for api_v21_films_releases_get
46
+ # получить список цифровых релизов
47
+ # Данный эндпоинт возвращает список цифровых релизов. Например https://www.kinopoisk.ru/comingsoon/digital/
48
+ # @param year год релиза
49
+ # @param month месяц релиза
50
+ # @param [Hash] opts the optional parameters
51
+ # @option opts [Integer] :page номер страницы
52
+ # @return [DigitalReleaseResponse]
53
+ describe "api_v21_films_releases_get test" do
54
+ it "should work" do
55
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
56
+ end
57
+ end
58
+
59
+ # unit tests for api_v21_films_search_by_keyword_get
60
+ # получить список фильмов по ключевым словам
61
+ # Возвращает список фильмов с пагинацией. Каждая страница содержит не более чем 20 фильмов.
62
+ # @param keyword ключивые слова для поиска
63
+ # @param [Hash] opts the optional parameters
64
+ # @option opts [Integer] :page номер страницы
65
+ # @return [FilmSearchResponse]
66
+ describe "api_v21_films_search_by_keyword_get test" do
67
+ it "should work" do
68
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
69
+ end
70
+ end
71
+
72
+ # unit tests for api_v22_films_filters_get
73
+ # получить id стран и жанров для использования в /api/v2.2/films
74
+ # Возвращает список id стран и жанров, которые могут быть использованы в /api/v2.2/films
75
+ # @param [Hash] opts the optional parameters
76
+ # @return [FiltersResponse]
77
+ describe "api_v22_films_filters_get test" do
78
+ it "should work" do
79
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
80
+ end
81
+ end
82
+
83
+ # unit tests for api_v22_films_get
84
+ # получить список фильмов по различным фильтрам
85
+ # Возвращает список фильмов с пагинацией. Каждая страница содержит не более чем 20 фильмов. Данный эндпоинт не возращает более 400 фильмов. &lt;i&gt;Используй /api/v2.2/films/filters чтобы получить id стран и жанров.&lt;/i&gt;
86
+ # @param [Hash] opts the optional parameters
87
+ # @option opts [Array<Integer>] :countries список id стран разделенные запятой. Например &lt;i&gt;countries&#x3D;1,2,3&lt;/i&gt;. На данный момент можно указать не более одной страны.
88
+ # @option opts [Array<Integer>] :genres список id жанров разделенные запятой. Например &lt;i&gt;genres&#x3D;1,2,3&lt;/i&gt;. На данный момент можно указать не более одного жанра.
89
+ # @option opts [String] :order сортировка
90
+ # @option opts [String] :type тип фильма
91
+ # @option opts [Integer] :rating_from минимальный рейтинг
92
+ # @option opts [Integer] :rating_to максимальный рейтинг
93
+ # @option opts [Integer] :year_from минимальный год
94
+ # @option opts [Integer] :year_to максимальный год
95
+ # @option opts [String] :imdb_id imdb id
96
+ # @option opts [String] :keyword ключевое слово, которое встречается в названии фильма
97
+ # @option opts [Integer] :page номер страницы
98
+ # @return [FilmSearchByFiltersResponse]
99
+ describe "api_v22_films_get test" do
100
+ it "should work" do
101
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
102
+ end
103
+ end
104
+
105
+ # unit tests for api_v22_films_id_box_office_get
106
+ # получить данные о бюджете и сборах фильма по kinopoisk film id
107
+ # Данный эндпоинт возвращает данные о бюджете и сборах.
108
+ # @param id kinopoisk film id
109
+ # @param [Hash] opts the optional parameters
110
+ # @return [BoxOfficeResponse]
111
+ describe "api_v22_films_id_box_office_get test" do
112
+ it "should work" do
113
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
114
+ end
115
+ end
116
+
117
+ # unit tests for api_v22_films_id_distributions_get
118
+ # получить данные о прокате фильма по kinopoisk film id
119
+ # Данный эндпоинт возвращает данные о прокате в разных странах.
120
+ # @param id kinopoisk film id
121
+ # @param [Hash] opts the optional parameters
122
+ # @return [DistributionResponse]
123
+ describe "api_v22_films_id_distributions_get test" do
124
+ it "should work" do
125
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
126
+ end
127
+ end
128
+
129
+ # unit tests for api_v22_films_id_facts_get
130
+ # получить данные о фактах и ошибках в фильме по kinopoisk film id
131
+ # Данный эндпоинт возвращает список фактов и ошибок в фильме. &lt;br&gt; type - &lt;b&gt;FACT&lt;/b&gt;, обозначает интересный факт о фильме. &lt;br&gt; type - &lt;b&gt;BLOOPER&lt;/b&gt;, обозначает ошибку в фильме.
132
+ # @param id kinopoisk film id
133
+ # @param [Hash] opts the optional parameters
134
+ # @return [FactResponse]
135
+ describe "api_v22_films_id_facts_get test" do
136
+ it "should work" do
137
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
138
+ end
139
+ end
140
+
141
+ # unit tests for api_v22_films_id_get
142
+ # получить данные о фильме по kinopoisk id
143
+ # Данный эндпоинт возвращает базовые данные о фильме. Поле &lt;b&gt;lastSync&lt;/b&gt; показывает дату последнего обновления данных.
144
+ # @param id kinopoisk film id
145
+ # @param [Hash] opts the optional parameters
146
+ # @return [Film]
147
+ describe "api_v22_films_id_get test" do
148
+ it "should work" do
149
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
150
+ end
151
+ end
152
+
153
+ # unit tests for api_v22_films_id_images_get
154
+ # получить изображения(кадры, постеры, фан-арты, обои и т.д.) связанные с фильмом по kinopoisk film id
155
+ # Данный эндпоинт возвращает изображения связанные с фильмом с пагинацией. Каждая страница содержит &lt;b&gt;не более чем 20 фильмов&lt;/b&gt;.&lt;/br&gt; Доступные изображения:&lt;/br&gt; &lt;ul&gt; &lt;li&gt;STILL - кадры&lt;/li&gt; &lt;li&gt;SHOOTING - изображения со съемок&lt;/li&gt; &lt;li&gt;POSTER - постеры&lt;/li&gt; &lt;li&gt;FAN_ART - фан-арты&lt;/li&gt; &lt;li&gt;PROMO - промо&lt;/li&gt; &lt;li&gt;CONCEPT - концепт-арты&lt;/li&gt; &lt;li&gt;WALLPAPER - обои&lt;/li&gt; &lt;li&gt;COVER - обложки&lt;/li&gt; &lt;li&gt;SCREENSHOT - скриншоты&lt;/li&gt; &lt;/ul&gt;
156
+ # @param id kinopoisk film id
157
+ # @param [Hash] opts the optional parameters
158
+ # @option opts [String] :type тип изображения
159
+ # @option opts [Integer] :page номер страницы
160
+ # @return [ImageResponse]
161
+ describe "api_v22_films_id_images_get test" do
162
+ it "should work" do
163
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
164
+ end
165
+ end
166
+
167
+ # unit tests for api_v22_films_id_seasons_get
168
+ # получить данные о сезонах для сериала по kinopoisk film id
169
+ # Данный эндпоинт возвращает данные о сезонах для сериала.
170
+ # @param id kinopoisk film id
171
+ # @param [Hash] opts the optional parameters
172
+ # @return [SeasonResponse]
173
+ describe "api_v22_films_id_seasons_get test" do
174
+ it "should work" do
175
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
176
+ end
177
+ end
178
+
179
+ # unit tests for api_v22_films_id_similars_get
180
+ # получить список похожих фильмов по kinopoisk film id
181
+ # @param id kinopoisk film id
182
+ # @param [Hash] opts the optional parameters
183
+ # @return [RelatedFilmResponse]
184
+ describe "api_v22_films_id_similars_get test" do
185
+ it "should work" do
186
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
187
+ end
188
+ end
189
+
190
+ # unit tests for api_v22_films_id_videos_get
191
+ # получить трейлеры,тизеры,видео для фильма по kinopoisk film id
192
+ # Данный эндпоинт возвращает трейлеры,тизеры,видео для фильма по kinopoisk film id. В данный момент доступно два site: &lt;br/&gt; &lt;ul&gt;&lt;li&gt;YOUTUBE - в этом случае &lt;b&gt;url&lt;/b&gt; это просто ссылка на youtube видео.&lt;/li&gt;&lt;li&gt;KINOPOISK_WIDGET - в этом случае &lt;b&gt;url&lt;/b&gt; это ссылка на кинопоиск виджет. Например https://widgets.kinopoisk.ru/discovery/trailer/123573?onlyPlayer&#x3D;1&amp;autoplay&#x3D;1&amp;cover&#x3D;1. Если вы хотите вставить этот виджет на вашу страницу, вы можете сделать следующее: &lt;br/&gt;&lt;br/&gt;&amp;lt;script src&#x3D;&amp;quot;https://unpkg.com/@ungap/custom-elements-builtin&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br/&gt;&amp;lt;script type&#x3D;&amp;quot;module&amp;quot; src&#x3D;&amp;quot;https://unpkg.com/x-frame-bypass&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br/&gt;&amp;lt;iframe is&#x3D;&amp;quot;x-frame-bypass&amp;quot; src&#x3D;&amp;quot;https://widgets.kinopoisk.ru/discovery/trailer/167560?onlyPlayer&#x3D;1&amp;amp;autoplay&#x3D;1&amp;amp;cover&#x3D;1&amp;quot; width&#x3D;&amp;quot;500&amp;quot; height&#x3D;&amp;quot;500&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/li&gt;&lt;/ul&gt;
193
+ # @param id kinopoisk film id
194
+ # @param [Hash] opts the optional parameters
195
+ # @return [VideoResponse]
196
+ describe "api_v22_films_id_videos_get test" do
197
+ it "should work" do
198
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
199
+ end
200
+ end
201
+
202
+ # unit tests for api_v22_films_premieres_get
203
+ # получить список кинопремьер
204
+ # Данный эндпоинт возвращает список кинопремьер. Например https://www.kinopoisk.ru/premiere/
205
+ # @param year год релиза
206
+ # @param month месяц релиза
207
+ # @param [Hash] opts the optional parameters
208
+ # @return [PremiereResponse]
209
+ describe "api_v22_films_premieres_get test" do
210
+ it "should work" do
211
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
212
+ end
213
+ end
214
+
215
+ # unit tests for api_v22_films_top_get
216
+ # получить список фильмов из различных топов или коллекций. Например https://www.kinopoisk.ru/top/lists/58/
217
+ # Возвращает список фильмов с пагинацией. Каждая страница содержит не более чем 20 фильмов.
218
+ # @param [Hash] opts the optional parameters
219
+ # @option opts [String] :type тип топа или коллекции
220
+ # @option opts [Integer] :page номер страницы
221
+ # @return [FilmTopResponse]
222
+ describe "api_v22_films_top_get test" do
223
+ it "should work" do
224
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
225
+ end
226
+ end
227
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ # #Kinopoisk Unofficial API
4
+
5
+ # The version of the OpenAPI document: 2.0.1
6
+ # Contact: support@kinopoiskapiunofficial.tech
7
+ # Generated by: https://openapi-generator.tech
8
+ # OpenAPI Generator version: 5.3.1
9
+ #
10
+
11
+ require "spec_helper"
12
+ require "json"
13
+
14
+ # Unit tests for Kuapir::PersonsApi
15
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
16
+ # Please update as you see appropriate
17
+ describe "PersonsApi" do
18
+ before do
19
+ # run before each test
20
+ @api_instance = Kuapir::PersonsApi.new
21
+ end
22
+
23
+ after do
24
+ # run after each test
25
+ end
26
+
27
+ describe "test an instance of PersonsApi" do
28
+ it "should create an instance of PersonsApi" do
29
+ expect(@api_instance).to be_instance_of(Kuapir::PersonsApi)
30
+ end
31
+ end
32
+
33
+ # unit tests for api_v1_persons_get
34
+ # поиск актеров, режиссеров и т.д. по имени
35
+ # Одна страница может содержать до 50 элементов в items.
36
+ # @param name имя человека
37
+ # @param [Hash] opts the optional parameters
38
+ # @option opts [Integer] :page номер страницы
39
+ # @return [PersonByNameResponse]
40
+ describe "api_v1_persons_get test" do
41
+ it "should work" do
42
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ # #Kinopoisk Unofficial API
4
+
5
+ # The version of the OpenAPI document: 2.0.1
6
+ # Contact: support@kinopoiskapiunofficial.tech
7
+ # Generated by: https://openapi-generator.tech
8
+ # OpenAPI Generator version: 5.3.1
9
+ #
10
+
11
+ require "spec_helper"
12
+ require "json"
13
+
14
+ # Unit tests for Kuapir::ReviewsApi
15
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
16
+ # Please update as you see appropriate
17
+ describe "ReviewsApi" do
18
+ before do
19
+ # run before each test
20
+ @api_instance = Kuapir::ReviewsApi.new
21
+ end
22
+
23
+ after do
24
+ # run after each test
25
+ end
26
+
27
+ describe "test an instance of ReviewsApi" do
28
+ it "should create an instance of ReviewsApi" do
29
+ expect(@api_instance).to be_instance_of(Kuapir::ReviewsApi)
30
+ end
31
+ end
32
+
33
+ # unit tests for api_v1_reviews_details_get
34
+ # получить полную рецензию по kinopoisk review id
35
+ # Возвращает полную информацию о рецензии.
36
+ # @param review_id kinopoisk review id
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [ReviewDetailsResponse]
39
+ describe "api_v1_reviews_details_get test" do
40
+ it "should work" do
41
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
42
+ end
43
+ end
44
+
45
+ # unit tests for api_v1_reviews_get
46
+ # получить рецензии зрителей
47
+ # Возвращает список рецензий с пагинацией. Каждая страница содержит не более чем 20 рецензий. Поле &lt;b&gt;description&lt;/b&gt; содержит не полный текст рецензии. Полный текст может быть получен из /api/v1/reviews/details
48
+ # @param film_id kinopoisk film id
49
+ # @param [Hash] opts the optional parameters
50
+ # @option opts [Integer] :page номер страницы
51
+ # @return [ReviewsResponse]
52
+ describe "api_v1_reviews_get test" do
53
+ it "should work" do
54
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ # #Kinopoisk Unofficial API
4
+
5
+ # The version of the OpenAPI document: 2.0.1
6
+ # Contact: support@kinopoiskapiunofficial.tech
7
+ # Generated by: https://openapi-generator.tech
8
+ # OpenAPI Generator version: 5.3.1
9
+ #
10
+
11
+ require "spec_helper"
12
+ require "json"
13
+
14
+ # Unit tests for Kuapir::StaffApi
15
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
16
+ # Please update as you see appropriate
17
+ describe "StaffApi" do
18
+ before do
19
+ # run before each test
20
+ @api_instance = Kuapir::StaffApi.new
21
+ end
22
+
23
+ after do
24
+ # run after each test
25
+ end
26
+
27
+ describe "test an instance of StaffApi" do
28
+ it "should create an instance of StaffApi" do
29
+ expect(@api_instance).to be_instance_of(Kuapir::StaffApi)
30
+ end
31
+ end
32
+
33
+ # unit tests for api_v1_staff_get
34
+ # получить данные об актерах, режисерах и т.д. по kinopoisk film id
35
+ # @param film_id kinopoisk film id
36
+ # @param [Hash] opts the optional parameters
37
+ # @return [Array<StaffResponse>]
38
+ describe "api_v1_staff_get test" do
39
+ it "should work" do
40
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
41
+ end
42
+ end
43
+
44
+ # unit tests for api_v1_staff_id_get
45
+ # получить данные о конкретном человеке по kinopoisk person id
46
+ # @param id kinopoisk person id
47
+ # @param [Hash] opts the optional parameters
48
+ # @return [PersonResponse]
49
+ describe "api_v1_staff_id_get test" do
50
+ it "should work" do
51
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,229 @@
1
+ # frozen_string_literal: true
2
+
3
+ # #Kinopoisk Unofficial API
4
+
5
+ # The version of the OpenAPI document: 2.0.1
6
+ # Contact: support@kinopoiskapiunofficial.tech
7
+ # Generated by: https://openapi-generator.tech
8
+ # OpenAPI Generator version: 5.3.1
9
+ #
10
+
11
+ require "spec_helper"
12
+
13
+ describe Kuapir::ApiClient do
14
+ context "initialization" do
15
+ context "URL stuff" do
16
+ context "host" do
17
+ it "removes http from host" do
18
+ Kuapir.configure { |c| c.host = "http://example.com" }
19
+ expect(Kuapir::Configuration.default.host).to eq("example.com")
20
+ end
21
+
22
+ it "removes https from host" do
23
+ Kuapir.configure { |c| c.host = "https://wookiee.com" }
24
+ expect(Kuapir::ApiClient.default.config.host).to eq("wookiee.com")
25
+ end
26
+
27
+ it "removes trailing path from host" do
28
+ Kuapir.configure { |c| c.host = "hobo.com/v4" }
29
+ expect(Kuapir::Configuration.default.host).to eq("hobo.com")
30
+ end
31
+ end
32
+
33
+ context "base_path" do
34
+ it "prepends a slash to base_path" do
35
+ Kuapir.configure { |c| c.base_path = "v4/dog" }
36
+ expect(Kuapir::Configuration.default.base_path).to eq("/v4/dog")
37
+ end
38
+
39
+ it "doesn't prepend a slash if one is already there" do
40
+ Kuapir.configure { |c| c.base_path = "/v4/dog" }
41
+ expect(Kuapir::Configuration.default.base_path).to eq("/v4/dog")
42
+ end
43
+
44
+ it "ends up as a blank string if nil" do
45
+ Kuapir.configure { |c| c.base_path = nil }
46
+ expect(Kuapir::Configuration.default.base_path).to eq("")
47
+ end
48
+ end
49
+ end
50
+ end
51
+
52
+ describe "params_encoding in #build_request" do
53
+ let(:config) { Kuapir::Configuration.new }
54
+ let(:api_client) { Kuapir::ApiClient.new(config) }
55
+
56
+ it "defaults to nil" do
57
+ expect(Kuapir::Configuration.default.params_encoding).to eq(nil)
58
+ expect(config.params_encoding).to eq(nil)
59
+
60
+ request = api_client.build_request(:get, "/test")
61
+ expect(request.options[:params_encoding]).to eq(nil)
62
+ end
63
+
64
+ it "can be customized" do
65
+ config.params_encoding = :multi
66
+ request = api_client.build_request(:get, "/test")
67
+ expect(request.options[:params_encoding]).to eq(:multi)
68
+ end
69
+ end
70
+
71
+ describe "timeout in #build_request" do
72
+ let(:config) { Kuapir::Configuration.new }
73
+ let(:api_client) { Kuapir::ApiClient.new(config) }
74
+
75
+ it "defaults to 0" do
76
+ expect(Kuapir::Configuration.default.timeout).to eq(0)
77
+ expect(config.timeout).to eq(0)
78
+
79
+ request = api_client.build_request(:get, "/test")
80
+ expect(request.options[:timeout]).to eq(0)
81
+ end
82
+
83
+ it "can be customized" do
84
+ config.timeout = 100
85
+ request = api_client.build_request(:get, "/test")
86
+ expect(request.options[:timeout]).to eq(100)
87
+ end
88
+ end
89
+
90
+ describe "#deserialize" do
91
+ it "handles Array<Integer>" do
92
+ api_client = Kuapir::ApiClient.new
93
+ headers = { "Content-Type" => "application/json" }
94
+ response = double("response", headers: headers, body: "[12, 34]")
95
+ data = api_client.deserialize(response, "Array<Integer>")
96
+ expect(data).to be_instance_of(Array)
97
+ expect(data).to eq([12, 34])
98
+ end
99
+
100
+ it "handles Array<Array<Integer>>" do
101
+ api_client = Kuapir::ApiClient.new
102
+ headers = { "Content-Type" => "application/json" }
103
+ response = double("response", headers: headers, body: "[[12, 34], [56]]")
104
+ data = api_client.deserialize(response, "Array<Array<Integer>>")
105
+ expect(data).to be_instance_of(Array)
106
+ expect(data).to eq([[12, 34], [56]])
107
+ end
108
+
109
+ it "handles Hash<String, String>" do
110
+ api_client = Kuapir::ApiClient.new
111
+ headers = { "Content-Type" => "application/json" }
112
+ response = double("response", headers: headers, body: '{"message": "Hello"}')
113
+ data = api_client.deserialize(response, "Hash<String, String>")
114
+ expect(data).to be_instance_of(Hash)
115
+ expect(data).to eq(message: "Hello")
116
+ end
117
+ end
118
+
119
+ describe "#object_to_hash" do
120
+ it "ignores nils and includes empty arrays" do
121
+ # uncomment below to test object_to_hash for model
122
+ # api_client = Kuapir::ApiClient.new
123
+ # _model = Kuapir::ModelName.new
124
+ # update the model attribute below
125
+ # _model.id = 1
126
+ # update the expected value (hash) below
127
+ # expected = {id: 1, name: '', tags: []}
128
+ # expect(api_client.object_to_hash(_model)).to eq(expected)
129
+ end
130
+ end
131
+
132
+ describe "#build_collection_param" do
133
+ let(:param) { %w[aa bb cc] }
134
+ let(:api_client) { Kuapir::ApiClient.new }
135
+
136
+ it "works for csv" do
137
+ expect(api_client.build_collection_param(param, :csv)).to eq("aa,bb,cc")
138
+ end
139
+
140
+ it "works for ssv" do
141
+ expect(api_client.build_collection_param(param, :ssv)).to eq("aa bb cc")
142
+ end
143
+
144
+ it "works for tsv" do
145
+ expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
146
+ end
147
+
148
+ it "works for pipes" do
149
+ expect(api_client.build_collection_param(param, :pipes)).to eq("aa|bb|cc")
150
+ end
151
+
152
+ it "works for multi" do
153
+ expect(api_client.build_collection_param(param, :multi)).to eq(%w[aa bb cc])
154
+ end
155
+
156
+ it "fails for invalid collection format" do
157
+ expect do
158
+ api_client.build_collection_param(param,
159
+ :INVALID)
160
+ end.to raise_error(RuntimeError, "unknown collection format: :INVALID")
161
+ end
162
+ end
163
+
164
+ describe "#json_mime?" do
165
+ let(:api_client) { Kuapir::ApiClient.new }
166
+
167
+ it "works" do
168
+ expect(api_client.json_mime?(nil)).to eq false
169
+ expect(api_client.json_mime?("")).to eq false
170
+
171
+ expect(api_client.json_mime?("application/json")).to eq true
172
+ expect(api_client.json_mime?("application/json; charset=UTF8")).to eq true
173
+ expect(api_client.json_mime?("APPLICATION/JSON")).to eq true
174
+
175
+ expect(api_client.json_mime?("application/xml")).to eq false
176
+ expect(api_client.json_mime?("text/plain")).to eq false
177
+ expect(api_client.json_mime?("application/jsonp")).to eq false
178
+ end
179
+ end
180
+
181
+ describe "#select_header_accept" do
182
+ let(:api_client) { Kuapir::ApiClient.new }
183
+
184
+ it "works" do
185
+ expect(api_client.select_header_accept(nil)).to be_nil
186
+ expect(api_client.select_header_accept([])).to be_nil
187
+
188
+ expect(api_client.select_header_accept(["application/json"])).to eq("application/json")
189
+ expect(api_client.select_header_accept(["application/xml",
190
+ "application/json; charset=UTF8"])).to eq("application/json; charset=UTF8")
191
+ expect(api_client.select_header_accept(["APPLICATION/JSON", "text/html"])).to eq("APPLICATION/JSON")
192
+
193
+ expect(api_client.select_header_accept(["application/xml"])).to eq("application/xml")
194
+ expect(api_client.select_header_accept(["text/html", "application/xml"])).to eq("text/html,application/xml")
195
+ end
196
+ end
197
+
198
+ describe "#select_header_content_type" do
199
+ let(:api_client) { Kuapir::ApiClient.new }
200
+
201
+ it "works" do
202
+ expect(api_client.select_header_content_type(nil)).to be_nil
203
+ expect(api_client.select_header_content_type([])).to be_nil
204
+
205
+ expect(api_client.select_header_content_type(["application/json"])).to eq("application/json")
206
+ expect(api_client.select_header_content_type(["application/xml",
207
+ "application/json; charset=UTF8"])).to eq("application/json; charset=UTF8")
208
+ expect(api_client.select_header_content_type(["APPLICATION/JSON", "text/html"])).to eq("APPLICATION/JSON")
209
+ expect(api_client.select_header_content_type(["application/xml"])).to eq("application/xml")
210
+ expect(api_client.select_header_content_type(["text/plain", "application/xml"])).to eq("text/plain")
211
+ end
212
+ end
213
+
214
+ describe "#sanitize_filename" do
215
+ let(:api_client) { Kuapir::ApiClient.new }
216
+
217
+ it "works" do
218
+ expect(api_client.sanitize_filename("sun")).to eq("sun")
219
+ expect(api_client.sanitize_filename("sun.gif")).to eq("sun.gif")
220
+ expect(api_client.sanitize_filename("../sun.gif")).to eq("sun.gif")
221
+ expect(api_client.sanitize_filename("/var/tmp/sun.gif")).to eq("sun.gif")
222
+ expect(api_client.sanitize_filename("./sun.gif")).to eq("sun.gif")
223
+ expect(api_client.sanitize_filename('..\sun.gif')).to eq("sun.gif")
224
+ expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq("sun.gif")
225
+ expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq("sun.gif")
226
+ expect(api_client.sanitize_filename('.\sun.gif')).to eq("sun.gif")
227
+ end
228
+ end
229
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ # #Kinopoisk Unofficial API
4
+
5
+ # The version of the OpenAPI document: 2.0.1
6
+ # Contact: support@kinopoiskapiunofficial.tech
7
+ # Generated by: https://openapi-generator.tech
8
+ # OpenAPI Generator version: 5.3.1
9
+ #
10
+
11
+ require "spec_helper"
12
+
13
+ describe Kuapir::Configuration do
14
+ let(:config) { Kuapir::Configuration.default }
15
+
16
+ describe "#base_url" do
17
+ it "should have the default value" do
18
+ expect(config.base_url).to eq("https://kinopoiskapiunofficial.tech")
19
+ end
20
+
21
+ it "should remove trailing slashes" do
22
+ [nil, "", "/", "//"].each do |base_path|
23
+ config.base_path = base_path
24
+ expect(config.base_url).to eq("https://kinopoiskapiunofficial.tech")
25
+ end
26
+ end
27
+ end
28
+ end