kinopoisk_unofficial_api 1.0.0.1

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 (105) hide show
  1. checksums.yaml +7 -0
  2. data/.env.example +1 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +23 -0
  5. data/CHANGELOG.md +3 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +185 -0
  8. data/Rakefile +17 -0
  9. data/data/countries.json +1002 -0
  10. data/data/genres.json +134 -0
  11. data/data/type_attributes.json +1589 -0
  12. data/lib/kinopoisk_unofficial_api/client.rb +67 -0
  13. data/lib/kinopoisk_unofficial_api/configuration.rb +15 -0
  14. data/lib/kinopoisk_unofficial_api/endpoints.rb +139 -0
  15. data/lib/kinopoisk_unofficial_api/exceptions/base.rb +7 -0
  16. data/lib/kinopoisk_unofficial_api/exceptions/response_error.rb +37 -0
  17. data/lib/kinopoisk_unofficial_api/request_schemas/api_key.rb +9 -0
  18. data/lib/kinopoisk_unofficial_api/request_schemas/base.rb +17 -0
  19. data/lib/kinopoisk_unofficial_api/request_schemas/film.rb +11 -0
  20. data/lib/kinopoisk_unofficial_api/request_schemas/film_awards.rb +7 -0
  21. data/lib/kinopoisk_unofficial_api/request_schemas/film_box_office.rb +7 -0
  22. data/lib/kinopoisk_unofficial_api/request_schemas/film_collections.rb +29 -0
  23. data/lib/kinopoisk_unofficial_api/request_schemas/film_distributions.rb +7 -0
  24. data/lib/kinopoisk_unofficial_api/request_schemas/film_external_sources.rb +9 -0
  25. data/lib/kinopoisk_unofficial_api/request_schemas/film_facts.rb +7 -0
  26. data/lib/kinopoisk_unofficial_api/request_schemas/film_images.rb +24 -0
  27. data/lib/kinopoisk_unofficial_api/request_schemas/film_premieres.rb +25 -0
  28. data/lib/kinopoisk_unofficial_api/request_schemas/film_reviews.rb +21 -0
  29. data/lib/kinopoisk_unofficial_api/request_schemas/film_seasons.rb +7 -0
  30. data/lib/kinopoisk_unofficial_api/request_schemas/film_sequels_and_prequels.rb +7 -0
  31. data/lib/kinopoisk_unofficial_api/request_schemas/film_similars.rb +7 -0
  32. data/lib/kinopoisk_unofficial_api/request_schemas/film_staff.rb +11 -0
  33. data/lib/kinopoisk_unofficial_api/request_schemas/film_videos.rb +7 -0
  34. data/lib/kinopoisk_unofficial_api/request_schemas/films.rb +84 -0
  35. data/lib/kinopoisk_unofficial_api/request_schemas/kp_user_votes.rb +12 -0
  36. data/lib/kinopoisk_unofficial_api/request_schemas/media_posts.rb +9 -0
  37. data/lib/kinopoisk_unofficial_api/request_schemas/persons.rb +10 -0
  38. data/lib/kinopoisk_unofficial_api/request_schemas/search_film_by_keyword.rb +10 -0
  39. data/lib/kinopoisk_unofficial_api/request_schemas/staff.rb +11 -0
  40. data/lib/kinopoisk_unofficial_api/request_schemas.rb +7 -0
  41. data/lib/kinopoisk_unofficial_api/types/api_key_response/daily_quota.rb +12 -0
  42. data/lib/kinopoisk_unofficial_api/types/api_key_response/total_quota.rb +12 -0
  43. data/lib/kinopoisk_unofficial_api/types/api_key_response.rb +11 -0
  44. data/lib/kinopoisk_unofficial_api/types/award.rb +14 -0
  45. data/lib/kinopoisk_unofficial_api/types/award_person.rb +21 -0
  46. data/lib/kinopoisk_unofficial_api/types/award_response.rb +10 -0
  47. data/lib/kinopoisk_unofficial_api/types/base.rb +14 -0
  48. data/lib/kinopoisk_unofficial_api/types/box_office.rb +13 -0
  49. data/lib/kinopoisk_unofficial_api/types/box_office_response.rb +10 -0
  50. data/lib/kinopoisk_unofficial_api/types/compactable.rb +19 -0
  51. data/lib/kinopoisk_unofficial_api/types/company.rb +9 -0
  52. data/lib/kinopoisk_unofficial_api/types/country.rb +9 -0
  53. data/lib/kinopoisk_unofficial_api/types/digital_release_item.rb +22 -0
  54. data/lib/kinopoisk_unofficial_api/types/digital_release_response.rb +11 -0
  55. data/lib/kinopoisk_unofficial_api/types/distribution.rb +14 -0
  56. data/lib/kinopoisk_unofficial_api/types/distribution_response.rb +10 -0
  57. data/lib/kinopoisk_unofficial_api/types/episode.rb +14 -0
  58. data/lib/kinopoisk_unofficial_api/types/external_source_response/item.rb +18 -0
  59. data/lib/kinopoisk_unofficial_api/types/external_source_response.rb +10 -0
  60. data/lib/kinopoisk_unofficial_api/types/fact.rb +11 -0
  61. data/lib/kinopoisk_unofficial_api/types/fact_response.rb +10 -0
  62. data/lib/kinopoisk_unofficial_api/types/film.rb +53 -0
  63. data/lib/kinopoisk_unofficial_api/types/film_collection_response/item.rb +22 -0
  64. data/lib/kinopoisk_unofficial_api/types/film_collection_response.rb +11 -0
  65. data/lib/kinopoisk_unofficial_api/types/film_search_by_filters_response/item.rb +23 -0
  66. data/lib/kinopoisk_unofficial_api/types/film_search_by_filters_response.rb +11 -0
  67. data/lib/kinopoisk_unofficial_api/types/film_search_response/film.rb +23 -0
  68. data/lib/kinopoisk_unofficial_api/types/film_search_response.rb +12 -0
  69. data/lib/kinopoisk_unofficial_api/types/film_sequels_and_prequels_response.rb +15 -0
  70. data/lib/kinopoisk_unofficial_api/types/filters_response/country.rb +12 -0
  71. data/lib/kinopoisk_unofficial_api/types/filters_response/genre.rb +12 -0
  72. data/lib/kinopoisk_unofficial_api/types/filters_response.rb +10 -0
  73. data/lib/kinopoisk_unofficial_api/types/genre.rb +9 -0
  74. data/lib/kinopoisk_unofficial_api/types/image_response/item.rb +12 -0
  75. data/lib/kinopoisk_unofficial_api/types/image_response.rb +11 -0
  76. data/lib/kinopoisk_unofficial_api/types/kinopoisk_user_vote_response/item.rb +23 -0
  77. data/lib/kinopoisk_unofficial_api/types/kinopoisk_user_vote_response.rb +11 -0
  78. data/lib/kinopoisk_unofficial_api/types/media_posts_response/item.rb +16 -0
  79. data/lib/kinopoisk_unofficial_api/types/media_posts_response.rb +11 -0
  80. data/lib/kinopoisk_unofficial_api/types/pattern_matching.rb +11 -0
  81. data/lib/kinopoisk_unofficial_api/types/person_by_name_response/item.rb +16 -0
  82. data/lib/kinopoisk_unofficial_api/types/person_by_name_response.rb +10 -0
  83. data/lib/kinopoisk_unofficial_api/types/person_response/film.rb +17 -0
  84. data/lib/kinopoisk_unofficial_api/types/person_response/spouse.rb +18 -0
  85. data/lib/kinopoisk_unofficial_api/types/person_response.rb +25 -0
  86. data/lib/kinopoisk_unofficial_api/types/premiere_response.rb +10 -0
  87. data/lib/kinopoisk_unofficial_api/types/premiere_response_item.rb +18 -0
  88. data/lib/kinopoisk_unofficial_api/types/related_film_response/item.rb +17 -0
  89. data/lib/kinopoisk_unofficial_api/types/related_film_response.rb +10 -0
  90. data/lib/kinopoisk_unofficial_api/types/review_response/item.rb +18 -0
  91. data/lib/kinopoisk_unofficial_api/types/review_response.rb +14 -0
  92. data/lib/kinopoisk_unofficial_api/types/season.rb +10 -0
  93. data/lib/kinopoisk_unofficial_api/types/season_response.rb +10 -0
  94. data/lib/kinopoisk_unofficial_api/types/staff_response.rb +15 -0
  95. data/lib/kinopoisk_unofficial_api/types/video_response/item.rb +13 -0
  96. data/lib/kinopoisk_unofficial_api/types/video_response.rb +10 -0
  97. data/lib/kinopoisk_unofficial_api/types.rb +7 -0
  98. data/lib/kinopoisk_unofficial_api/version.rb +5 -0
  99. data/lib/kinopoisk_unofficial_api.rb +25 -0
  100. data/rakelib/parse_schema.rake +103 -0
  101. data/rakelib/rebuild_types.rake +105 -0
  102. data/rakelib/templates/empty_type.erb +12 -0
  103. data/rakelib/templates/nested_type.erb +13 -0
  104. data/rakelib/templates/type.erb +11 -0
  105. metadata +188 -0
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class ApiKeyResponse < Base
6
+ class TotalQuota < Base
7
+ attribute :value, Types::Integer
8
+ attribute :used, Types::Integer
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class ApiKeyResponse < Base
6
+ attribute :total_quota, ApiKeyResponse::TotalQuota
7
+ attribute :daily_quota, ApiKeyResponse::DailyQuota
8
+ attribute :account_type, Types::String
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class Award < Base
6
+ attribute :name, Types::String
7
+ attribute :win, Types::Bool
8
+ attribute :image_url, Types::String.optional
9
+ attribute :nomination_name, Types::String
10
+ attribute :year, Types::Integer
11
+ attribute? :persons, Types::Array.of(AwardPerson)
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class AwardPerson < Base
6
+ attribute :kinopoisk_id, Types::Integer
7
+ attribute :web_url, Types::String
8
+ attribute :name_ru, Types::String.optional
9
+ attribute :name_en, Types::String.optional
10
+ attribute :sex, Types::String
11
+ attribute :poster_url, Types::String
12
+ attribute :growth, Types::Integer.optional
13
+ attribute :birthday, Types::String.optional
14
+ attribute :death, Types::String.optional
15
+ attribute :age, Types::Integer.optional
16
+ attribute :birthplace, Types::String.optional
17
+ attribute :deathplace, Types::String.optional
18
+ attribute :profession, Types::String.optional
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class AwardResponse < Base
6
+ attribute :total, Types::Integer
7
+ attribute :items, Types::Array.of(Award)
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class Base < Dry::Struct
6
+ include Compactable
7
+ include PatternMatching
8
+
9
+ transform_keys do |key|
10
+ key.to_s.gsub(/([a-z\d])([A-Z])/, '\1_\2').downcase.to_sym
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class BoxOffice < Base
6
+ attribute :type, Types::String
7
+ attribute :amount, Types::Integer
8
+ attribute :currency_code, Types::String
9
+ attribute :name, Types::String
10
+ attribute :symbol, Types::String
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class BoxOfficeResponse < Base
6
+ attribute :total, Types::Integer
7
+ attribute :items, Types::Array.of(BoxOffice)
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ module Compactable
6
+ def to_compact_hash
7
+ attributes.dup.compact.to_h do |key, value|
8
+ value = value.to_compact_hash if value.respond_to?(:to_compact_hash)
9
+
10
+ [key, value]
11
+ end
12
+ end
13
+
14
+ def to_json(*args)
15
+ to_compact_hash.select { |_, v| v }.to_json(*args)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class Company < Base
6
+ attribute :name, Types::String
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class Country < Base
6
+ attribute :country, Types::String
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class DigitalReleaseItem < Base
6
+ attribute :film_id, Types::Integer
7
+ attribute :name_ru, Types::String
8
+ attribute :name_en, Types::String
9
+ attribute :year, Types::Integer
10
+ attribute :poster_url, Types::String
11
+ attribute :poster_url_preview, Types::String
12
+ attribute :countries, Types::Array.of(Country)
13
+ attribute :genres, Types::Array.of(Genre)
14
+ attribute :rating, Types::Float | Types::Integer
15
+ attribute :rating_vote_count, Types::Integer
16
+ attribute :expectations_rating, Types::Float | Types::Integer
17
+ attribute :expectations_rating_vote_count, Types::Integer
18
+ attribute :duration, Types::Integer
19
+ attribute :release_date, Types::String
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class DigitalReleaseResponse < Base
6
+ attribute :page, Types::Integer
7
+ attribute :total, Types::Integer
8
+ attribute :releases, Types::Array.of(DigitalReleaseItem)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class Distribution < Base
6
+ attribute :type, Types::String
7
+ attribute :sub_type, Types::String.optional
8
+ attribute :date, Types::String.optional
9
+ attribute :re_release, Types::Bool.optional
10
+ attribute :country, Country.optional
11
+ attribute :companies, Types::Array.of(Company)
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class DistributionResponse < Base
6
+ attribute :total, Types::Integer
7
+ attribute :items, Types::Array.of(Distribution)
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class Episode < Base
6
+ attribute :season_number, Types::Integer
7
+ attribute :episode_number, Types::Integer
8
+ attribute :name_ru, Types::String.optional
9
+ attribute :name_en, Types::String.optional
10
+ attribute :synopsis, Types::String.optional
11
+ attribute :release_date, Types::String.optional
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class ExternalSourceResponse < Base
6
+ class Item < Base
7
+ attribute? :url, Types::String
8
+ attribute? :platform, Types::String
9
+ attribute? :logo_url, Types::String
10
+ attribute? :positive_rating, Types::Integer
11
+ attribute? :negative_rating, Types::Integer
12
+ attribute? :author, Types::String
13
+ attribute? :title, Types::String.optional
14
+ attribute? :description, Types::String
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class ExternalSourceResponse < Base
6
+ attribute :total, Types::Integer
7
+ attribute :items, Types::Array.of(ExternalSourceResponse::Item)
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class Fact < Base
6
+ attribute :text, Types::String
7
+ attribute :type, Types::String
8
+ attribute :spoiler, Types::Bool
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class FactResponse < Base
6
+ attribute :total, Types::Integer
7
+ attribute :items, Types::Array.of(Fact)
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class Film < Base
6
+ attribute :kinopoisk_id, Types::Integer
7
+ attribute :kinopoisk_hdid, Types::String.optional
8
+ attribute :imdb_id, Types::String.optional
9
+ attribute :name_ru, Types::String.optional
10
+ attribute :name_en, Types::String.optional
11
+ attribute :name_original, Types::String.optional
12
+ attribute :poster_url, Types::String
13
+ attribute :poster_url_preview, Types::String
14
+ attribute :cover_url, Types::String.optional
15
+ attribute :logo_url, Types::String.optional
16
+ attribute :reviews_count, Types::Integer
17
+ attribute :rating_good_review, Types::Float | Types::Integer.optional
18
+ attribute :rating_good_review_vote_count, Types::Integer.optional
19
+ attribute :rating_kinopoisk, Types::Float | Types::Integer.optional
20
+ attribute :rating_kinopoisk_vote_count, Types::Integer.optional
21
+ attribute :rating_imdb, Types::Float | Types::Integer.optional
22
+ attribute :rating_imdb_vote_count, Types::Integer.optional
23
+ attribute :rating_film_critics, Types::Float | Types::Integer.optional
24
+ attribute :rating_film_critics_vote_count, Types::Integer.optional
25
+ attribute :rating_await, Types::Float | Types::Integer.optional
26
+ attribute :rating_await_count, Types::Integer.optional
27
+ attribute :rating_rf_critics, Types::Float | Types::Integer.optional
28
+ attribute :rating_rf_critics_vote_count, Types::Integer.optional
29
+ attribute :web_url, Types::String
30
+ attribute :year, Types::Integer.optional
31
+ attribute :film_length, Types::Integer.optional
32
+ attribute :slogan, Types::String.optional
33
+ attribute :description, Types::String.optional
34
+ attribute :short_description, Types::String.optional
35
+ attribute :editor_annotation, Types::String.optional
36
+ attribute :is_tickets_available, Types::Bool
37
+ attribute :production_status, Types::String.optional
38
+ attribute :type, Types::String
39
+ attribute :rating_mpaa, Types::String.optional
40
+ attribute :rating_age_limits, Types::String.optional
41
+ attribute :has_imax, Types::Bool.optional
42
+ attribute :has3_d, Types::Bool.optional
43
+ attribute :last_sync, Types::String
44
+ attribute :countries, Types::Array.of(Country)
45
+ attribute :genres, Types::Array.of(Genre)
46
+ attribute :start_year, Types::Integer.optional
47
+ attribute :end_year, Types::Integer.optional
48
+ attribute? :serial, Types::Bool.optional
49
+ attribute? :short_film, Types::Bool.optional
50
+ attribute? :completed, Types::Bool.optional
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class FilmCollectionResponse < Base
6
+ class Item < Base
7
+ attribute? :kinopoisk_id, Types::Integer
8
+ attribute? :name_ru, Types::String.optional
9
+ attribute? :name_en, Types::String.optional
10
+ attribute? :name_original, Types::String.optional
11
+ attribute? :countries, Types::Array.of(Country)
12
+ attribute? :genres, Types::Array.of(Genre)
13
+ attribute? :rating_kinopoisk, Types::Float | Types::Integer.optional
14
+ attribute? :rating_imbd, Types::Float | Types::Integer.optional
15
+ attribute? :year, Types::Integer.optional
16
+ attribute? :type, Types::String
17
+ attribute? :poster_url, Types::String
18
+ attribute? :poster_url_preview, Types::String
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class FilmCollectionResponse < Base
6
+ attribute :total, Types::Integer
7
+ attribute :total_pages, Types::Integer
8
+ attribute :items, Types::Array.of(FilmCollectionResponse::Item)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class FilmSearchByFiltersResponse < Base
6
+ class Item < Base
7
+ attribute? :kinopoisk_id, Types::Integer
8
+ attribute? :imdb_id, Types::String.optional
9
+ attribute? :name_ru, Types::String.optional
10
+ attribute? :name_en, Types::String.optional
11
+ attribute? :name_original, Types::String.optional
12
+ attribute? :countries, Types::Array.of(Country)
13
+ attribute? :genres, Types::Array.of(Genre)
14
+ attribute? :rating_kinopoisk, Types::Float | Types::Integer.optional
15
+ attribute? :rating_imdb, Types::Float | Types::Integer.optional
16
+ attribute? :year, Types::Float | Types::Integer.optional
17
+ attribute? :type, Types::String
18
+ attribute? :poster_url, Types::String
19
+ attribute? :poster_url_preview, Types::String
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class FilmSearchByFiltersResponse < Base
6
+ attribute :total, Types::Integer
7
+ attribute :total_pages, Types::Integer
8
+ attribute :items, Types::Array.of(FilmSearchByFiltersResponse::Item)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class FilmSearchResponse < Base
6
+ class Film < Base
7
+ attribute? :film_id, Types::Integer
8
+ attribute? :name_ru, Types::String
9
+ attribute? :name_en, Types::String
10
+ attribute? :type, Types::String
11
+ attribute? :year, Types::String
12
+ attribute? :description, Types::String
13
+ attribute? :film_length, Types::String
14
+ attribute? :countries, Types::Array.of(Country)
15
+ attribute? :genres, Types::Array.of(Genre)
16
+ attribute? :rating, Types::String
17
+ attribute? :rating_vote_count, Types::Integer
18
+ attribute? :poster_url, Types::String
19
+ attribute? :poster_url_preview, Types::String
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class FilmSearchResponse < Base
6
+ attribute :keyword, Types::String
7
+ attribute :pages_count, Types::Integer
8
+ attribute :search_films_count_result, Types::Integer
9
+ attribute :films, Types::Array.of(FilmSearchResponse::Film)
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class FilmSequelsAndPrequelsResponse < Base
6
+ attribute :film_id, Types::Integer
7
+ attribute :name_ru, Types::String
8
+ attribute :name_en, Types::String
9
+ attribute :name_original, Types::String
10
+ attribute :poster_url, Types::String
11
+ attribute :poster_url_preview, Types::String
12
+ attribute :relation_type, Types::String
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class FiltersResponse < Base
6
+ class Country < Base
7
+ attribute? :id, Types::Integer
8
+ attribute? :country, Types::String
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class FiltersResponse < Base
6
+ class Genre < Base
7
+ attribute? :id, Types::Integer
8
+ attribute? :genre, Types::String
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class FiltersResponse < Base
6
+ attribute :genres, Types::Array.of(FiltersResponse::Genre)
7
+ attribute :countries, Types::Array.of(FiltersResponse::Country)
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class Genre < Base
6
+ attribute :genre, Types::String
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class ImageResponse < Base
6
+ class Item < Base
7
+ attribute? :image_url, Types::String
8
+ attribute? :preview_url, Types::String
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class ImageResponse < Base
6
+ attribute :total, Types::Integer
7
+ attribute :total_pages, Types::Integer
8
+ attribute :items, Types::Array.of(ImageResponse::Item)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class KinopoiskUserVoteResponse < Base
6
+ class Item < Base
7
+ attribute? :kinopoisk_id, Types::Integer
8
+ attribute? :name_ru, Types::String.optional
9
+ attribute? :name_en, Types::String.optional
10
+ attribute? :name_original, Types::String.optional
11
+ attribute? :countries, Types::Array.of(Country)
12
+ attribute? :genres, Types::Array.of(Genre)
13
+ attribute? :rating_kinopoisk, Types::Float | Types::Integer.optional
14
+ attribute? :rating_imbd, Types::Float | Types::Integer.optional
15
+ attribute? :year, Types::Integer.optional
16
+ attribute? :type, Types::String
17
+ attribute? :poster_url, Types::String
18
+ attribute? :poster_url_preview, Types::String
19
+ attribute? :user_rating, Types::Integer
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class KinopoiskUserVoteResponse < Base
6
+ attribute :total, Types::Integer
7
+ attribute :total_pages, Types::Integer
8
+ attribute :items, Types::Array.of(KinopoiskUserVoteResponse::Item)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class MediaPostsResponse < Base
6
+ class Item < Base
7
+ attribute? :kinopoisk_id, Types::Integer
8
+ attribute? :image_url, Types::String
9
+ attribute? :title, Types::String
10
+ attribute? :description, Types::String
11
+ attribute? :url, Types::String
12
+ attribute? :published_at, Types::String
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class MediaPostsResponse < Base
6
+ attribute :total, Types::Integer
7
+ attribute :total_pages, Types::Integer
8
+ attribute :items, Types::Array.of(MediaPostsResponse::Item)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ module PatternMatching
6
+ def deconstruct_keys(_keys)
7
+ attributes
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class PersonByNameResponse < Base
6
+ class Item < Base
7
+ attribute? :kinopoisk_id, Types::Integer
8
+ attribute? :web_url, Types::String
9
+ attribute? :name_ru, Types::String.optional
10
+ attribute? :name_en, Types::String.optional
11
+ attribute? :sex, Types::String.optional
12
+ attribute? :poster_url, Types::String
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskUnofficialApi
4
+ module Types
5
+ class PersonByNameResponse < Base
6
+ attribute :total, Types::Integer
7
+ attribute :items, Types::Array.of(PersonByNameResponse::Item)
8
+ end
9
+ end
10
+ end