Class: Kuapir::FilmsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/kuapir/api/films_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ FilmsApi

Returns a new instance of FilmsApi.



9
10
11
# File 'lib/kuapir/api/films_api.rb', line 9

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



7
8
9
# File 'lib/kuapir/api/films_api.rb', line 7

def api_client
  @api_client
end

Instance Method Details

#api_v21_films_id_sequels_and_prequels_get(id, opts = {}) ⇒ Array<FilmSequelsAndPrequelsResponse>

получить сиквелы и приквелы для фильма по kinopoisk film id tbd

Parameters:

  • id (Integer)

    kinopoisk film id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



18
19
20
21
# File 'lib/kuapir/api/films_api.rb', line 18

def api_v21_films_id_sequels_and_prequels_get(id, opts = {})
  data, _status_code, _headers = api_v21_films_id_sequels_and_prequels_get_with_http_info(id, opts)
  data
end

#api_v21_films_id_sequels_and_prequels_get_with_http_info(id, opts = {}) ⇒ Array<(Array<FilmSequelsAndPrequelsResponse>, Integer, Hash)>

получить сиквелы и приквелы для фильма по kinopoisk film id tbd

Parameters:

  • id (Integer)

    kinopoisk film id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<FilmSequelsAndPrequelsResponse>, Integer, Hash)>)

    Array<FilmSequelsAndPrequelsResponse> data, response status code and response headers



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/kuapir/api/films_api.rb', line 28

def api_v21_films_id_sequels_and_prequels_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FilmsApi.api_v21_films_id_sequels_and_prequels_get ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    raise ArgumentError,
          "Missing the required parameter 'id' when calling FilmsApi.api_v21_films_id_sequels_and_prequels_get"
  end

  if @api_client.config.client_side_validation && id < 1
    raise ArgumentError,
          'invalid value for "id" when calling FilmsApi.api_v21_films_id_sequels_and_prequels_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/api/v2.1/films/{id}/sequels_and_prequels".sub("{id}", CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params["Accept"] = @api_client.select_header_accept(["application/json"])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || "Array<FilmSequelsAndPrequelsResponse>"

  # auth_names
  auth_names = opts[:debug_auth_names] || ["ApiKeyAuth"]

  new_options = opts.merge(
    operation:     :"FilmsApi.api_v21_films_id_sequels_and_prequels_get",
    header_params: header_params,
    query_params:  query_params,
    form_params:   form_params,
    body:          post_body,
    auth_names:    auth_names,
    return_type:   return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilmsApi#api_v21_films_id_sequels_and_prequels_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#api_v21_films_releases_get(year, month, opts = {}) ⇒ DigitalReleaseResponse

получить список цифровых релизов Данный эндпоинт возвращает список цифровых релизов. Например www.kinopoisk.ru/comingsoon/digital/

Parameters:

  • year (Integer)

    год релиза

  • month (String)

    месяц релиза

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    номер страницы (default to 1)

Returns:



90
91
92
93
# File 'lib/kuapir/api/films_api.rb', line 90

def api_v21_films_releases_get(year, month, opts = {})
  data, _status_code, _headers = api_v21_films_releases_get_with_http_info(year, month, opts)
  data
end

#api_v21_films_releases_get_with_http_info(year, month, opts = {}) ⇒ Array<(DigitalReleaseResponse, Integer, Hash)>

получить список цифровых релизов Данный эндпоинт возвращает список цифровых релизов. Например www.kinopoisk.ru/comingsoon/digital/

Parameters:

  • year (Integer)

    год релиза

  • month (String)

    месяц релиза

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    номер страницы

Returns:

  • (Array<(DigitalReleaseResponse, Integer, Hash)>)

    DigitalReleaseResponse data, response status code and response headers



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/kuapir/api/films_api.rb', line 102

def api_v21_films_releases_get_with_http_info(year, month, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FilmsApi.api_v21_films_releases_get ..."
  end
  # verify the required parameter 'year' is set
  if @api_client.config.client_side_validation && year.nil?
    raise ArgumentError,
          "Missing the required parameter 'year' when calling FilmsApi.api_v21_films_releases_get"
  end
  # verify the required parameter 'month' is set
  if @api_client.config.client_side_validation && month.nil?
    raise ArgumentError,
          "Missing the required parameter 'month' when calling FilmsApi.api_v21_films_releases_get"
  end

  # verify enum value
  allowable_values = %w[JANUARY FEBRUARY MARCH APRIL MAY JUNE JULY AUGUST SEPTEMBER OCTOBER NOVEMBER DECEMBER]
  if @api_client.config.client_side_validation && !allowable_values.include?(month)
    raise ArgumentError,
          "invalid value for \"month\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:page].nil? && opts[:page] > 20
    raise ArgumentError,
          'invalid value for "opts[:"page"]" when calling FilmsApi.api_v21_films_releases_get, must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && !opts[:page].nil? && opts[:page] < 1
    raise ArgumentError,
          'invalid value for "opts[:"page"]" when calling FilmsApi.api_v21_films_releases_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/api/v2.1/films/releases"

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:year] = year
  query_params[:month] = month
  query_params[:page] = opts[:page] unless opts[:page].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params["Accept"] = @api_client.select_header_accept(["application/json"])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || "DigitalReleaseResponse"

  # auth_names
  auth_names = opts[:debug_auth_names] || ["ApiKeyAuth"]

  new_options = opts.merge(
    operation:     :"FilmsApi.api_v21_films_releases_get",
    header_params: header_params,
    query_params:  query_params,
    form_params:   form_params,
    body:          post_body,
    auth_names:    auth_names,
    return_type:   return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilmsApi#api_v21_films_releases_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#api_v21_films_search_by_keyword_get(keyword, opts = {}) ⇒ FilmSearchResponse

получить список фильмов по ключевым словам Возвращает список фильмов с пагинацией. Каждая страница содержит не более чем 20 фильмов.

Parameters:

  • keyword (String)

    ключивые слова для поиска

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    номер страницы (default to 1)

Returns:



182
183
184
185
# File 'lib/kuapir/api/films_api.rb', line 182

def api_v21_films_search_by_keyword_get(keyword, opts = {})
  data, _status_code, _headers = api_v21_films_search_by_keyword_get_with_http_info(keyword, opts)
  data
end

#api_v21_films_search_by_keyword_get_with_http_info(keyword, opts = {}) ⇒ Array<(FilmSearchResponse, Integer, Hash)>

получить список фильмов по ключевым словам Возвращает список фильмов с пагинацией. Каждая страница содержит не более чем 20 фильмов.

Parameters:

  • keyword (String)

    ключивые слова для поиска

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    номер страницы

Returns:

  • (Array<(FilmSearchResponse, Integer, Hash)>)

    FilmSearchResponse data, response status code and response headers



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'lib/kuapir/api/films_api.rb', line 193

def api_v21_films_search_by_keyword_get_with_http_info(keyword, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FilmsApi.api_v21_films_search_by_keyword_get ..."
  end
  # verify the required parameter 'keyword' is set
  if @api_client.config.client_side_validation && keyword.nil?
    raise ArgumentError,
          "Missing the required parameter 'keyword' when calling FilmsApi.api_v21_films_search_by_keyword_get"
  end
  if @api_client.config.client_side_validation && !opts[:page].nil? && opts[:page] > 20
    raise ArgumentError,
          'invalid value for "opts[:"page"]" when calling FilmsApi.api_v21_films_search_by_keyword_get, must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && !opts[:page].nil? && opts[:page] < 1
    raise ArgumentError,
          'invalid value for "opts[:"page"]" when calling FilmsApi.api_v21_films_search_by_keyword_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/api/v2.1/films/search-by-keyword"

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:keyword] = keyword
  query_params[:page] = opts[:page] unless opts[:page].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params["Accept"] = @api_client.select_header_accept(["application/json"])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || "FilmSearchResponse"

  # auth_names
  auth_names = opts[:debug_auth_names] || ["ApiKeyAuth"]

  new_options = opts.merge(
    operation:     :"FilmsApi.api_v21_films_search_by_keyword_get",
    header_params: header_params,
    query_params:  query_params,
    form_params:   form_params,
    body:          post_body,
    auth_names:    auth_names,
    return_type:   return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilmsApi#api_v21_films_search_by_keyword_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#api_v22_films_filters_get(opts = {}) ⇒ FiltersResponse

получить id стран и жанров для использования в /api/v2.2/films Возвращает список id стран и жанров, которые могут быть использованы в /api/v2.2/films

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



258
259
260
261
# File 'lib/kuapir/api/films_api.rb', line 258

def api_v22_films_filters_get(opts = {})
  data, _status_code, _headers = api_v22_films_filters_get_with_http_info(opts)
  data
end

#api_v22_films_filters_get_with_http_info(opts = {}) ⇒ Array<(FiltersResponse, Integer, Hash)>

получить id стран и жанров для использования в /api/v2.2/films Возвращает список id стран и жанров, которые могут быть использованы в /api/v2.2/films

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(FiltersResponse, Integer, Hash)>)

    FiltersResponse data, response status code and response headers



267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
# File 'lib/kuapir/api/films_api.rb', line 267

def api_v22_films_filters_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FilmsApi.api_v22_films_filters_get ..."
  end
  # resource path
  local_var_path = "/api/v2.2/films/filters"

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params["Accept"] = @api_client.select_header_accept(["application/json"])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || "FiltersResponse"

  # auth_names
  auth_names = opts[:debug_auth_names] || ["ApiKeyAuth"]

  new_options = opts.merge(
    operation:     :"FilmsApi.api_v22_films_filters_get",
    header_params: header_params,
    query_params:  query_params,
    form_params:   form_params,
    body:          post_body,
    auth_names:    auth_names,
    return_type:   return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilmsApi#api_v22_films_filters_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#api_v22_films_get(opts = {}) ⇒ FilmSearchByFiltersResponse

получить список фильмов по различным фильтрам Возвращает список фильмов с пагинацией. Каждая страница содержит не более чем 20 фильмов. Данный эндпоинт не возращает более 400 фильмов. Используй /api/v2.2/films/filters чтобы получить id стран и жанров.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :countries (Array<Integer>)

    список id стран разделенные запятой. Например &lt;i&gt;countries&#x3D;1,2,3&lt;/i&gt;. На данный момент можно указать не более одной страны.

  • :genres (Array<Integer>)

    список id жанров разделенные запятой. Например &lt;i&gt;genres&#x3D;1,2,3&lt;/i&gt;. На данный момент можно указать не более одного жанра.

  • :order (String)

    сортировка (default to ‘RATING’)

  • :type (String)

    тип фильма (default to ‘ALL’)

  • :rating_from (Integer)

    минимальный рейтинг (default to 0)

  • :rating_to (Integer)

    максимальный рейтинг (default to 10)

  • :year_from (Integer)

    минимальный год (default to 1000)

  • :year_to (Integer)

    максимальный год (default to 3000)

  • :imdb_id (String)

    imdb id

  • :keyword (String)

    ключевое слово, которое встречается в названии фильма

  • :page (Integer)

    номер страницы (default to 1)

Returns:



326
327
328
329
# File 'lib/kuapir/api/films_api.rb', line 326

def api_v22_films_get(opts = {})
  data, _status_code, _headers = api_v22_films_get_with_http_info(opts)
  data
end

#api_v22_films_get_with_http_info(opts = {}) ⇒ Array<(FilmSearchByFiltersResponse, Integer, Hash)>

получить список фильмов по различным фильтрам Возвращает список фильмов с пагинацией. Каждая страница содержит не более чем 20 фильмов. Данный эндпоинт не возращает более 400 фильмов. &lt;i&gt;Используй /api/v2.2/films/filters чтобы получить id стран и жанров.&lt;/i&gt;

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :countries (Array<Integer>)

    список id стран разделенные запятой. Например &lt;i&gt;countries&#x3D;1,2,3&lt;/i&gt;. На данный момент можно указать не более одной страны.

  • :genres (Array<Integer>)

    список id жанров разделенные запятой. Например &lt;i&gt;genres&#x3D;1,2,3&lt;/i&gt;. На данный момент можно указать не более одного жанра.

  • :order (String)

    сортировка

  • :type (String)

    тип фильма

  • :rating_from (Integer)

    минимальный рейтинг

  • :rating_to (Integer)

    максимальный рейтинг

  • :year_from (Integer)

    минимальный год

  • :year_to (Integer)

    максимальный год

  • :imdb_id (String)

    imdb id

  • :keyword (String)

    ключевое слово, которое встречается в названии фильма

  • :page (Integer)

    номер страницы

Returns:

  • (Array<(FilmSearchByFiltersResponse, Integer, Hash)>)

    FilmSearchByFiltersResponse data, response status code and response headers



346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
# File 'lib/kuapir/api/films_api.rb', line 346

def api_v22_films_get_with_http_info(opts = {})
  @api_client.config.logger.debug "Calling API: FilmsApi.api_v22_films_get ..." if @api_client.config.debugging
  allowable_values = %w[RATING NUM_VOTE YEAR]
  if @api_client.config.client_side_validation && opts[:order] && !allowable_values.include?(opts[:order])
    raise ArgumentError,
          "invalid value for \"order\", must be one of #{allowable_values}"
  end

  allowable_values = %w[FILM VIDEO TV_SERIES MINI_SERIES TV_SHOW ALL]
  if @api_client.config.client_side_validation && opts[:type] && !allowable_values.include?(opts[:type])
    raise ArgumentError,
          "invalid value for \"type\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:page].nil? && opts[:page] > 20
    raise ArgumentError,
          'invalid value for "opts[:"page"]" when calling FilmsApi.api_v22_films_get, must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && !opts[:page].nil? && opts[:page] < 1
    raise ArgumentError,
          'invalid value for "opts[:"page"]" when calling FilmsApi.api_v22_films_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/api/v2.2/films"

  # query parameters
  query_params = opts[:query_params] || {}
  unless opts[:countries].nil?
    query_params[:countries] =
      @api_client.build_collection_param(opts[:countries], :multi)
  end
  query_params[:genres] = @api_client.build_collection_param(opts[:genres], :multi) unless opts[:genres].nil?
  query_params[:order] = opts[:order] unless opts[:order].nil?
  query_params[:type] = opts[:type] unless opts[:type].nil?
  query_params[:ratingFrom] = opts[:rating_from] unless opts[:rating_from].nil?
  query_params[:ratingTo] = opts[:rating_to] unless opts[:rating_to].nil?
  query_params[:yearFrom] = opts[:year_from] unless opts[:year_from].nil?
  query_params[:yearTo] = opts[:year_to] unless opts[:year_to].nil?
  query_params[:imdbId] = opts[:imdb_id] unless opts[:imdb_id].nil?
  query_params[:keyword] = opts[:keyword] unless opts[:keyword].nil?
  query_params[:page] = opts[:page] unless opts[:page].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params["Accept"] = @api_client.select_header_accept(["application/json"])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || "FilmSearchByFiltersResponse"

  # auth_names
  auth_names = opts[:debug_auth_names] || ["ApiKeyAuth"]

  new_options = opts.merge(
    operation:     :"FilmsApi.api_v22_films_get",
    header_params: header_params,
    query_params:  query_params,
    form_params:   form_params,
    body:          post_body,
    auth_names:    auth_names,
    return_type:   return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilmsApi#api_v22_films_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#api_v22_films_id_box_office_get(id, opts = {}) ⇒ BoxOfficeResponse

получить данные о бюджете и сборах фильма по kinopoisk film id Данный эндпоинт возвращает данные о бюджете и сборах.

Parameters:

  • id (Integer)

    kinopoisk film id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



428
429
430
431
# File 'lib/kuapir/api/films_api.rb', line 428

def api_v22_films_id_box_office_get(id, opts = {})
  data, _status_code, _headers = api_v22_films_id_box_office_get_with_http_info(id, opts)
  data
end

#api_v22_films_id_box_office_get_with_http_info(id, opts = {}) ⇒ Array<(BoxOfficeResponse, Integer, Hash)>

получить данные о бюджете и сборах фильма по kinopoisk film id Данный эндпоинт возвращает данные о бюджете и сборах.

Parameters:

  • id (Integer)

    kinopoisk film id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(BoxOfficeResponse, Integer, Hash)>)

    BoxOfficeResponse data, response status code and response headers



438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
# File 'lib/kuapir/api/films_api.rb', line 438

def api_v22_films_id_box_office_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FilmsApi.api_v22_films_id_box_office_get ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    raise ArgumentError,
          "Missing the required parameter 'id' when calling FilmsApi.api_v22_films_id_box_office_get"
  end

  if @api_client.config.client_side_validation && id < 1
    raise ArgumentError,
          'invalid value for "id" when calling FilmsApi.api_v22_films_id_box_office_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/api/v2.2/films/{id}/box_office".sub("{id}", CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params["Accept"] = @api_client.select_header_accept(["application/json"])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || "BoxOfficeResponse"

  # auth_names
  auth_names = opts[:debug_auth_names] || ["ApiKeyAuth"]

  new_options = opts.merge(
    operation:     :"FilmsApi.api_v22_films_id_box_office_get",
    header_params: header_params,
    query_params:  query_params,
    form_params:   form_params,
    body:          post_body,
    auth_names:    auth_names,
    return_type:   return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilmsApi#api_v22_films_id_box_office_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#api_v22_films_id_distributions_get(id, opts = {}) ⇒ DistributionResponse

получить данные о прокате фильма по kinopoisk film id Данный эндпоинт возвращает данные о прокате в разных странах.

Parameters:

  • id (Integer)

    kinopoisk film id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



498
499
500
501
# File 'lib/kuapir/api/films_api.rb', line 498

def api_v22_films_id_distributions_get(id, opts = {})
  data, _status_code, _headers = api_v22_films_id_distributions_get_with_http_info(id, opts)
  data
end

#api_v22_films_id_distributions_get_with_http_info(id, opts = {}) ⇒ Array<(DistributionResponse, Integer, Hash)>

получить данные о прокате фильма по kinopoisk film id Данный эндпоинт возвращает данные о прокате в разных странах.

Parameters:

  • id (Integer)

    kinopoisk film id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(DistributionResponse, Integer, Hash)>)

    DistributionResponse data, response status code and response headers



508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
# File 'lib/kuapir/api/films_api.rb', line 508

def api_v22_films_id_distributions_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FilmsApi.api_v22_films_id_distributions_get ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    raise ArgumentError,
          "Missing the required parameter 'id' when calling FilmsApi.api_v22_films_id_distributions_get"
  end

  if @api_client.config.client_side_validation && id < 1
    raise ArgumentError,
          'invalid value for "id" when calling FilmsApi.api_v22_films_id_distributions_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/api/v2.2/films/{id}/distributions".sub("{id}", CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params["Accept"] = @api_client.select_header_accept(["application/json"])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || "DistributionResponse"

  # auth_names
  auth_names = opts[:debug_auth_names] || ["ApiKeyAuth"]

  new_options = opts.merge(
    operation:     :"FilmsApi.api_v22_films_id_distributions_get",
    header_params: header_params,
    query_params:  query_params,
    form_params:   form_params,
    body:          post_body,
    auth_names:    auth_names,
    return_type:   return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilmsApi#api_v22_films_id_distributions_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#api_v22_films_id_facts_get(id, opts = {}) ⇒ FactResponse

получить данные о фактах и ошибках в фильме по kinopoisk film id Данный эндпоинт возвращает список фактов и ошибок в фильме.
type - FACT, обозначает интересный факт о фильме.
type - BLOOPER, обозначает ошибку в фильме.

Parameters:

  • id (Integer)

    kinopoisk film id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



568
569
570
571
# File 'lib/kuapir/api/films_api.rb', line 568

def api_v22_films_id_facts_get(id, opts = {})
  data, _status_code, _headers = api_v22_films_id_facts_get_with_http_info(id, opts)
  data
end

#api_v22_films_id_facts_get_with_http_info(id, opts = {}) ⇒ Array<(FactResponse, Integer, Hash)>

получить данные о фактах и ошибках в фильме по kinopoisk film id Данный эндпоинт возвращает список фактов и ошибок в фильме. &lt;br&gt; type - &lt;b&gt;FACT&lt;/b&gt;, обозначает интересный факт о фильме. &lt;br&gt; type - &lt;b&gt;BLOOPER&lt;/b&gt;, обозначает ошибку в фильме.

Parameters:

  • id (Integer)

    kinopoisk film id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(FactResponse, Integer, Hash)>)

    FactResponse data, response status code and response headers



578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
# File 'lib/kuapir/api/films_api.rb', line 578

def api_v22_films_id_facts_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FilmsApi.api_v22_films_id_facts_get ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    raise ArgumentError,
          "Missing the required parameter 'id' when calling FilmsApi.api_v22_films_id_facts_get"
  end

  if @api_client.config.client_side_validation && id < 1
    raise ArgumentError,
          'invalid value for "id" when calling FilmsApi.api_v22_films_id_facts_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/api/v2.2/films/{id}/facts".sub("{id}", CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params["Accept"] = @api_client.select_header_accept(["application/json"])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || "FactResponse"

  # auth_names
  auth_names = opts[:debug_auth_names] || ["ApiKeyAuth"]

  new_options = opts.merge(
    operation:     :"FilmsApi.api_v22_films_id_facts_get",
    header_params: header_params,
    query_params:  query_params,
    form_params:   form_params,
    body:          post_body,
    auth_names:    auth_names,
    return_type:   return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilmsApi#api_v22_films_id_facts_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#api_v22_films_id_get(id, opts = {}) ⇒ Film

получить данные о фильме по kinopoisk id Данный эндпоинт возвращает базовые данные о фильме. Поле lastSync показывает дату последнего обновления данных.

Parameters:

  • id (Integer)

    kinopoisk film id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



638
639
640
641
# File 'lib/kuapir/api/films_api.rb', line 638

def api_v22_films_id_get(id, opts = {})
  data, _status_code, _headers = api_v22_films_id_get_with_http_info(id, opts)
  data
end

#api_v22_films_id_get_with_http_info(id, opts = {}) ⇒ Array<(Film, Integer, Hash)>

получить данные о фильме по kinopoisk id Данный эндпоинт возвращает базовые данные о фильме. Поле &lt;b&gt;lastSync&lt;/b&gt; показывает дату последнего обновления данных.

Parameters:

  • id (Integer)

    kinopoisk film id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Film, Integer, Hash)>)

    Film data, response status code and response headers



648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
# File 'lib/kuapir/api/films_api.rb', line 648

def api_v22_films_id_get_with_http_info(id, opts = {})
  @api_client.config.logger.debug "Calling API: FilmsApi.api_v22_films_id_get ..." if @api_client.config.debugging
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    raise ArgumentError,
          "Missing the required parameter 'id' when calling FilmsApi.api_v22_films_id_get"
  end

  if @api_client.config.client_side_validation && id < 1
    raise ArgumentError,
          'invalid value for "id" when calling FilmsApi.api_v22_films_id_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/api/v2.2/films/{id}".sub("{id}", CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params["Accept"] = @api_client.select_header_accept(["application/json"])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || "Film"

  # auth_names
  auth_names = opts[:debug_auth_names] || ["ApiKeyAuth"]

  new_options = opts.merge(
    operation:     :"FilmsApi.api_v22_films_id_get",
    header_params: header_params,
    query_params:  query_params,
    form_params:   form_params,
    body:          post_body,
    auth_names:    auth_names,
    return_type:   return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilmsApi#api_v22_films_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#api_v22_films_id_images_get(id, opts = {}) ⇒ ImageResponse

получить изображения(кадры, постеры, фан-арты, обои и т.д.) связанные с фильмом по kinopoisk film id Данный эндпоинт возвращает изображения связанные с фильмом с пагинацией. Каждая страница содержит не более чем 20 фильмов.</br> Доступные изображения:</br> <ul> <li>STILL - кадры</li> <li>SHOOTING - изображения со съемок</li> <li>POSTER - постеры</li> <li>FAN_ART - фан-арты</li> <li>PROMO - промо</li> <li>CONCEPT - концепт-арты</li> <li>WALLPAPER - обои</li> <li>COVER - обложки</li> <li>SCREENSHOT - скриншоты</li> </ul>

Parameters:

  • id (Integer)

    kinopoisk film id

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :type (String)

    тип изображения (default to ‘STILL’)

  • :page (Integer)

    номер страницы (default to 1)

Returns:



708
709
710
711
# File 'lib/kuapir/api/films_api.rb', line 708

def api_v22_films_id_images_get(id, opts = {})
  data, _status_code, _headers = api_v22_films_id_images_get_with_http_info(id, opts)
  data
end

#api_v22_films_id_images_get_with_http_info(id, opts = {}) ⇒ Array<(ImageResponse, Integer, Hash)>

получить изображения(кадры, постеры, фан-арты, обои и т.д.) связанные с фильмом по kinopoisk film id Данный эндпоинт возвращает изображения связанные с фильмом с пагинацией. Каждая страница содержит &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;

Parameters:

  • id (Integer)

    kinopoisk film id

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :type (String)

    тип изображения

  • :page (Integer)

    номер страницы

Returns:

  • (Array<(ImageResponse, Integer, Hash)>)

    ImageResponse data, response status code and response headers



720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
# File 'lib/kuapir/api/films_api.rb', line 720

def api_v22_films_id_images_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FilmsApi.api_v22_films_id_images_get ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    raise ArgumentError,
          "Missing the required parameter 'id' when calling FilmsApi.api_v22_films_id_images_get"
  end

  if @api_client.config.client_side_validation && id < 1
    raise ArgumentError,
          'invalid value for "id" when calling FilmsApi.api_v22_films_id_images_get, must be greater than or equal to 1.'
  end

  allowable_values = %w[STILL SHOOTING POSTER FAN_ART PROMO CONCEPT WALLPAPER COVER SCREENSHOT]
  if @api_client.config.client_side_validation && opts[:type] && !allowable_values.include?(opts[:type])
    raise ArgumentError,
          "invalid value for \"type\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:page].nil? && opts[:page] > 20
    raise ArgumentError,
          'invalid value for "opts[:"page"]" when calling FilmsApi.api_v22_films_id_images_get, must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && !opts[:page].nil? && opts[:page] < 1
    raise ArgumentError,
          'invalid value for "opts[:"page"]" when calling FilmsApi.api_v22_films_id_images_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/api/v2.2/films/{id}/images".sub("{id}", CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:type] = opts[:type] unless opts[:type].nil?
  query_params[:page] = opts[:page] unless opts[:page].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params["Accept"] = @api_client.select_header_accept(["application/json"])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || "ImageResponse"

  # auth_names
  auth_names = opts[:debug_auth_names] || ["ApiKeyAuth"]

  new_options = opts.merge(
    operation:     :"FilmsApi.api_v22_films_id_images_get",
    header_params: header_params,
    query_params:  query_params,
    form_params:   form_params,
    body:          post_body,
    auth_names:    auth_names,
    return_type:   return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilmsApi#api_v22_films_id_images_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#api_v22_films_id_seasons_get(id, opts = {}) ⇒ SeasonResponse

получить данные о сезонах для сериала по kinopoisk film id Данный эндпоинт возвращает данные о сезонах для сериала.

Parameters:

  • id (Integer)

    kinopoisk film id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



797
798
799
800
# File 'lib/kuapir/api/films_api.rb', line 797

def api_v22_films_id_seasons_get(id, opts = {})
  data, _status_code, _headers = api_v22_films_id_seasons_get_with_http_info(id, opts)
  data
end

#api_v22_films_id_seasons_get_with_http_info(id, opts = {}) ⇒ Array<(SeasonResponse, Integer, Hash)>

получить данные о сезонах для сериала по kinopoisk film id Данный эндпоинт возвращает данные о сезонах для сериала.

Parameters:

  • id (Integer)

    kinopoisk film id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(SeasonResponse, Integer, Hash)>)

    SeasonResponse data, response status code and response headers



807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
# File 'lib/kuapir/api/films_api.rb', line 807

def api_v22_films_id_seasons_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FilmsApi.api_v22_films_id_seasons_get ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    raise ArgumentError,
          "Missing the required parameter 'id' when calling FilmsApi.api_v22_films_id_seasons_get"
  end

  if @api_client.config.client_side_validation && id < 1
    raise ArgumentError,
          'invalid value for "id" when calling FilmsApi.api_v22_films_id_seasons_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/api/v2.2/films/{id}/seasons".sub("{id}", CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params["Accept"] = @api_client.select_header_accept(["application/json"])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || "SeasonResponse"

  # auth_names
  auth_names = opts[:debug_auth_names] || ["ApiKeyAuth"]

  new_options = opts.merge(
    operation:     :"FilmsApi.api_v22_films_id_seasons_get",
    header_params: header_params,
    query_params:  query_params,
    form_params:   form_params,
    body:          post_body,
    auth_names:    auth_names,
    return_type:   return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilmsApi#api_v22_films_id_seasons_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#api_v22_films_id_similars_get(id, opts = {}) ⇒ RelatedFilmResponse

получить список похожих фильмов по kinopoisk film id

Parameters:

  • id (Integer)

    kinopoisk film id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



866
867
868
869
# File 'lib/kuapir/api/films_api.rb', line 866

def api_v22_films_id_similars_get(id, opts = {})
  data, _status_code, _headers = api_v22_films_id_similars_get_with_http_info(id, opts)
  data
end

#api_v22_films_id_similars_get_with_http_info(id, opts = {}) ⇒ Array<(RelatedFilmResponse, Integer, Hash)>

получить список похожих фильмов по kinopoisk film id

Parameters:

  • id (Integer)

    kinopoisk film id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(RelatedFilmResponse, Integer, Hash)>)

    RelatedFilmResponse data, response status code and response headers



875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
# File 'lib/kuapir/api/films_api.rb', line 875

def api_v22_films_id_similars_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FilmsApi.api_v22_films_id_similars_get ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    raise ArgumentError,
          "Missing the required parameter 'id' when calling FilmsApi.api_v22_films_id_similars_get"
  end

  if @api_client.config.client_side_validation && id < 1
    raise ArgumentError,
          'invalid value for "id" when calling FilmsApi.api_v22_films_id_similars_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/api/v2.2/films/{id}/similars".sub("{id}", CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params["Accept"] = @api_client.select_header_accept(["application/json"])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || "RelatedFilmResponse"

  # auth_names
  auth_names = opts[:debug_auth_names] || ["ApiKeyAuth"]

  new_options = opts.merge(
    operation:     :"FilmsApi.api_v22_films_id_similars_get",
    header_params: header_params,
    query_params:  query_params,
    form_params:   form_params,
    body:          post_body,
    auth_names:    auth_names,
    return_type:   return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilmsApi#api_v22_films_id_similars_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#api_v22_films_id_videos_get(id, opts = {}) ⇒ VideoResponse

получить трейлеры,тизеры,видео для фильма по kinopoisk film id Данный эндпоинт возвращает трейлеры,тизеры,видео для фильма по kinopoisk film id. В данный момент доступно два site: <br/> <ul><li>YOUTUBE - в этом случае url это просто ссылка на youtube видео.</li><li>KINOPOISK_WIDGET - в этом случае url это ссылка на кинопоиск виджет. Например widgets.kinopoisk.ru/discovery/trailer/123573?onlyPlayer=1&autoplay=1&cover=1. Если вы хотите вставить этот виджет на вашу страницу, вы можете сделать следующее: <br/><br/>&lt;script src=&quot;unpkg.com/@ungap/custom-elements-builtin&quot;&gt;&lt;/script&gt;<br/>&lt;script type=&quot;module&quot; src=&quot;unpkg.com/x-frame-bypass&quot;&gt;&lt;/script&gt;<br/>&lt;iframe is=&quot;x-frame-bypass&quot; src=&quot;widgets.kinopoisk.ru/discovery/trailer/167560?onlyPlayer=1&amp;autoplay=1&amp;cover=1&quot; width=&quot;500&quot; height=&quot;500&quot;&gt;&lt;/iframe&gt;</li></ul>

Parameters:

  • id (Integer)

    kinopoisk film id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



935
936
937
938
# File 'lib/kuapir/api/films_api.rb', line 935

def api_v22_films_id_videos_get(id, opts = {})
  data, _status_code, _headers = api_v22_films_id_videos_get_with_http_info(id, opts)
  data
end

#api_v22_films_id_videos_get_with_http_info(id, opts = {}) ⇒ Array<(VideoResponse, Integer, Hash)>

получить трейлеры,тизеры,видео для фильма по kinopoisk film id Данный эндпоинт возвращает трейлеры,тизеры,видео для фильма по 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; это ссылка на кинопоиск виджет. Например 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;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;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;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;

Parameters:

  • id (Integer)

    kinopoisk film id

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(VideoResponse, Integer, Hash)>)

    VideoResponse data, response status code and response headers



945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
# File 'lib/kuapir/api/films_api.rb', line 945

def api_v22_films_id_videos_get_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FilmsApi.api_v22_films_id_videos_get ..."
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    raise ArgumentError,
          "Missing the required parameter 'id' when calling FilmsApi.api_v22_films_id_videos_get"
  end

  if @api_client.config.client_side_validation && id < 1
    raise ArgumentError,
          'invalid value for "id" when calling FilmsApi.api_v22_films_id_videos_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/api/v2.2/films/{id}/videos".sub("{id}", CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params["Accept"] = @api_client.select_header_accept(["application/json"])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || "VideoResponse"

  # auth_names
  auth_names = opts[:debug_auth_names] || ["ApiKeyAuth"]

  new_options = opts.merge(
    operation:     :"FilmsApi.api_v22_films_id_videos_get",
    header_params: header_params,
    query_params:  query_params,
    form_params:   form_params,
    body:          post_body,
    auth_names:    auth_names,
    return_type:   return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilmsApi#api_v22_films_id_videos_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#api_v22_films_premieres_get(year, month, opts = {}) ⇒ PremiereResponse

получить список кинопремьер Данный эндпоинт возвращает список кинопремьер. Например www.kinopoisk.ru/premiere/

Parameters:

  • year (Integer)

    год релиза

  • month (String)

    месяц релиза

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1006
1007
1008
1009
# File 'lib/kuapir/api/films_api.rb', line 1006

def api_v22_films_premieres_get(year, month, opts = {})
  data, _status_code, _headers = api_v22_films_premieres_get_with_http_info(year, month, opts)
  data
end

#api_v22_films_premieres_get_with_http_info(year, month, opts = {}) ⇒ Array<(PremiereResponse, Integer, Hash)>

получить список кинопремьер Данный эндпоинт возвращает список кинопремьер. Например www.kinopoisk.ru/premiere/

Parameters:

  • year (Integer)

    год релиза

  • month (String)

    месяц релиза

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(PremiereResponse, Integer, Hash)>)

    PremiereResponse data, response status code and response headers



1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
# File 'lib/kuapir/api/films_api.rb', line 1017

def api_v22_films_premieres_get_with_http_info(year, month, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: FilmsApi.api_v22_films_premieres_get ..."
  end
  # verify the required parameter 'year' is set
  if @api_client.config.client_side_validation && year.nil?
    raise ArgumentError,
          "Missing the required parameter 'year' when calling FilmsApi.api_v22_films_premieres_get"
  end
  # verify the required parameter 'month' is set
  if @api_client.config.client_side_validation && month.nil?
    raise ArgumentError,
          "Missing the required parameter 'month' when calling FilmsApi.api_v22_films_premieres_get"
  end

  # verify enum value
  allowable_values = %w[JANUARY FEBRUARY MARCH APRIL MAY JUNE JULY AUGUST SEPTEMBER OCTOBER NOVEMBER DECEMBER]
  if @api_client.config.client_side_validation && !allowable_values.include?(month)
    raise ArgumentError,
          "invalid value for \"month\", must be one of #{allowable_values}"
  end

  # resource path
  local_var_path = "/api/v2.2/films/premieres"

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:year] = year
  query_params[:month] = month

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params["Accept"] = @api_client.select_header_accept(["application/json"])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || "PremiereResponse"

  # auth_names
  auth_names = opts[:debug_auth_names] || ["ApiKeyAuth"]

  new_options = opts.merge(
    operation:     :"FilmsApi.api_v22_films_premieres_get",
    header_params: header_params,
    query_params:  query_params,
    form_params:   form_params,
    body:          post_body,
    auth_names:    auth_names,
    return_type:   return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilmsApi#api_v22_films_premieres_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end

#api_v22_films_top_get(opts = {}) ⇒ FilmTopResponse

получить список фильмов из различных топов или коллекций. Например www.kinopoisk.ru/top/lists/58/ Возвращает список фильмов с пагинацией. Каждая страница содержит не более чем 20 фильмов.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :type (String)

    тип топа или коллекции (default to ‘TOP_250_BEST_FILMS’)

  • :page (Integer)

    номер страницы (default to 1)

Returns:



1087
1088
1089
1090
# File 'lib/kuapir/api/films_api.rb', line 1087

def api_v22_films_top_get(opts = {})
  data, _status_code, _headers = api_v22_films_top_get_with_http_info(opts)
  data
end

#api_v22_films_top_get_with_http_info(opts = {}) ⇒ Array<(FilmTopResponse, Integer, Hash)>

получить список фильмов из различных топов или коллекций. Например www.kinopoisk.ru/top/lists/58/ Возвращает список фильмов с пагинацией. Каждая страница содержит не более чем 20 фильмов.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :type (String)

    тип топа или коллекции

  • :page (Integer)

    номер страницы

Returns:

  • (Array<(FilmTopResponse, Integer, Hash)>)

    FilmTopResponse data, response status code and response headers



1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
# File 'lib/kuapir/api/films_api.rb', line 1098

def api_v22_films_top_get_with_http_info(opts = {})
  @api_client.config.logger.debug "Calling API: FilmsApi.api_v22_films_top_get ..." if @api_client.config.debugging
  allowable_values = %w[TOP_250_BEST_FILMS TOP_100_POPULAR_FILMS TOP_AWAIT_FILMS]
  if @api_client.config.client_side_validation && opts[:type] && !allowable_values.include?(opts[:type])
    raise ArgumentError,
          "invalid value for \"type\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:page].nil? && opts[:page] > 20
    raise ArgumentError,
          'invalid value for "opts[:"page"]" when calling FilmsApi.api_v22_films_top_get, must be smaller than or equal to 20.'
  end

  if @api_client.config.client_side_validation && !opts[:page].nil? && opts[:page] < 1
    raise ArgumentError,
          'invalid value for "opts[:"page"]" when calling FilmsApi.api_v22_films_top_get, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = "/api/v2.2/films/top"

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:type] = opts[:type] unless opts[:type].nil?
  query_params[:page] = opts[:page] unless opts[:page].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params["Accept"] = @api_client.select_header_accept(["application/json"])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || "FilmTopResponse"

  # auth_names
  auth_names = opts[:debug_auth_names] || ["ApiKeyAuth"]

  new_options = opts.merge(
    operation:     :"FilmsApi.api_v22_films_top_get",
    header_params: header_params,
    query_params:  query_params,
    form_params:   form_params,
    body:          post_body,
    auth_names:    auth_names,
    return_type:   return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: FilmsApi#api_v22_films_top_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  [data, status_code, headers]
end