kinopoisk_dev_api 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) 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 +5 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +118 -0
  8. data/Rakefile +17 -0
  9. data/data/type_attributes.json +1624 -0
  10. data/lib/kinopoisk_dev_api/client.rb +98 -0
  11. data/lib/kinopoisk_dev_api/configuration.rb +13 -0
  12. data/lib/kinopoisk_dev_api/endpoints.rb +75 -0
  13. data/lib/kinopoisk_dev_api/exceptions/base.rb +7 -0
  14. data/lib/kinopoisk_dev_api/exceptions/response_error.rb +35 -0
  15. data/lib/kinopoisk_dev_api/inflector.rb +16 -0
  16. data/lib/kinopoisk_dev_api/types/audience.rb +10 -0
  17. data/lib/kinopoisk_dev_api/types/base.rb +12 -0
  18. data/lib/kinopoisk_dev_api/types/birth_place.rb +9 -0
  19. data/lib/kinopoisk_dev_api/types/compactable.rb +19 -0
  20. data/lib/kinopoisk_dev_api/types/currency_value.rb +10 -0
  21. data/lib/kinopoisk_dev_api/types/death_place.rb +9 -0
  22. data/lib/kinopoisk_dev_api/types/episode_v1_4.rb +22 -0
  23. data/lib/kinopoisk_dev_api/types/external_id.rb +12 -0
  24. data/lib/kinopoisk_dev_api/types/fact_in_movie.rb +11 -0
  25. data/lib/kinopoisk_dev_api/types/fact_in_person.rb +9 -0
  26. data/lib/kinopoisk_dev_api/types/fees.rb +11 -0
  27. data/lib/kinopoisk_dev_api/types/image.rb +21 -0
  28. data/lib/kinopoisk_dev_api/types/image_docs_response_dto_v1_4.rb +16 -0
  29. data/lib/kinopoisk_dev_api/types/item_name.rb +9 -0
  30. data/lib/kinopoisk_dev_api/types/keyword.rb +15 -0
  31. data/lib/kinopoisk_dev_api/types/keyword_docs_response_dto_v1_4.rb +16 -0
  32. data/lib/kinopoisk_dev_api/types/linked_movie_v1_4.rb +21 -0
  33. data/lib/kinopoisk_dev_api/types/list.rb +18 -0
  34. data/lib/kinopoisk_dev_api/types/list_docs_response_dto_v1_4.rb +16 -0
  35. data/lib/kinopoisk_dev_api/types/logo.rb +9 -0
  36. data/lib/kinopoisk_dev_api/types/meili_person_entity_v1_4.rb +26 -0
  37. data/lib/kinopoisk_dev_api/types/movie.rb +11 -0
  38. data/lib/kinopoisk_dev_api/types/movie_award.rb +16 -0
  39. data/lib/kinopoisk_dev_api/types/movie_award_docs_response_dto.rb +13 -0
  40. data/lib/kinopoisk_dev_api/types/movie_docs_response_dto_v1_4.rb +16 -0
  41. data/lib/kinopoisk_dev_api/types/movie_dto_v1_4.rb +76 -0
  42. data/lib/kinopoisk_dev_api/types/movie_from_keyword.rb +9 -0
  43. data/lib/kinopoisk_dev_api/types/movie_from_studio.rb +9 -0
  44. data/lib/kinopoisk_dev_api/types/movie_in_person.rb +17 -0
  45. data/lib/kinopoisk_dev_api/types/name.rb +11 -0
  46. data/lib/kinopoisk_dev_api/types/network_item_v1_4.rb +13 -0
  47. data/lib/kinopoisk_dev_api/types/networks_v1_4.rb +12 -0
  48. data/lib/kinopoisk_dev_api/types/nomination.rb +10 -0
  49. data/lib/kinopoisk_dev_api/types/nomination_award.rb +10 -0
  50. data/lib/kinopoisk_dev_api/types/pattern_matching.rb +11 -0
  51. data/lib/kinopoisk_dev_api/types/person.rb +32 -0
  52. data/lib/kinopoisk_dev_api/types/person_award.rb +17 -0
  53. data/lib/kinopoisk_dev_api/types/person_award_docs_response_dto.rb +13 -0
  54. data/lib/kinopoisk_dev_api/types/person_docs_response_dto_v1_4.rb +16 -0
  55. data/lib/kinopoisk_dev_api/types/person_in_movie.rb +17 -0
  56. data/lib/kinopoisk_dev_api/types/possible_value_dto.rb +10 -0
  57. data/lib/kinopoisk_dev_api/types/premiere.rb +15 -0
  58. data/lib/kinopoisk_dev_api/types/profession.rb +9 -0
  59. data/lib/kinopoisk_dev_api/types/rating.rb +16 -0
  60. data/lib/kinopoisk_dev_api/types/review.rb +28 -0
  61. data/lib/kinopoisk_dev_api/types/review_docs_response_dto_v1_4.rb +16 -0
  62. data/lib/kinopoisk_dev_api/types/review_info.rb +12 -0
  63. data/lib/kinopoisk_dev_api/types/search_movie_dto_v1_4.rb +53 -0
  64. data/lib/kinopoisk_dev_api/types/search_movie_response_dto_v1_4.rb +16 -0
  65. data/lib/kinopoisk_dev_api/types/search_person_response_dto_v1_4.rb +16 -0
  66. data/lib/kinopoisk_dev_api/types/season_docs_response_dto_v1_4.rb +16 -0
  67. data/lib/kinopoisk_dev_api/types/season_info.rb +11 -0
  68. data/lib/kinopoisk_dev_api/types/season_v1_4.rb +31 -0
  69. data/lib/kinopoisk_dev_api/types/short_image.rb +11 -0
  70. data/lib/kinopoisk_dev_api/types/spouses.rb +16 -0
  71. data/lib/kinopoisk_dev_api/types/studio.rb +18 -0
  72. data/lib/kinopoisk_dev_api/types/studio_docs_response_dto_v1_4.rb +16 -0
  73. data/lib/kinopoisk_dev_api/types/video.rb +13 -0
  74. data/lib/kinopoisk_dev_api/types/video_types.rb +9 -0
  75. data/lib/kinopoisk_dev_api/types/votes.rb +16 -0
  76. data/lib/kinopoisk_dev_api/types/watchability.rb +9 -0
  77. data/lib/kinopoisk_dev_api/types/watchability_item.rb +11 -0
  78. data/lib/kinopoisk_dev_api/types/year_range.rb +10 -0
  79. data/lib/kinopoisk_dev_api/types.rb +7 -0
  80. data/lib/kinopoisk_dev_api/version.rb +5 -0
  81. data/lib/kinopoisk_dev_api.rb +25 -0
  82. data/rakelib/parse_schema.rake +90 -0
  83. data/rakelib/rebuild_types.rake +95 -0
  84. data/rakelib/templates/empty_type.erb +9 -0
  85. data/rakelib/templates/type.erb +24 -0
  86. metadata +169 -0
@@ -0,0 +1,98 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ class Client
5
+ attr_reader :api_key, :url
6
+
7
+ API_VERSION = "v1.4"
8
+
9
+ def initialize(api_key, url: "https://api.kinopoisk.dev")
10
+ @api_key = api_key
11
+ @url = url
12
+ end
13
+
14
+ def connection
15
+ @connection ||= Faraday.new(url: url, headers: { "X-API-KEY" => api_key }) do |faraday|
16
+ faraday.adapter KinopoiskDevApi.configuration.adapter
17
+ faraday.options.timeout = KinopoiskDevApi.configuration.connection_timeout
18
+ faraday.options.open_timeout = KinopoiskDevApi.configuration.connection_open_timeout
19
+ faraday.options.params_encoder = Faraday::FlatParamsEncoder
20
+ end
21
+ end
22
+
23
+ def method_missing(method_name, *args, &block)
24
+ return super unless ENDPOINTS.key?(method_name)
25
+
26
+ endpoint = ENDPOINTS[method_name]
27
+
28
+ result = call(endpoint, *args)
29
+
30
+ endpoint_type(endpoint).call(result)
31
+ end
32
+
33
+ def respond_to_missing?(*args)
34
+ method_name = args[0]
35
+
36
+ ENDPOINTS.key?(method_name) || super
37
+ end
38
+
39
+ def call(endpoint, raw_params = {})
40
+ params = build_params(raw_params)
41
+ path = build_path(endpoint, params)
42
+ response = connection.get(path, params)
43
+ raise Exceptions::ResponseError.new(response: response) unless response.status == 200
44
+
45
+ JSON.parse(response.body)
46
+ end
47
+
48
+ private
49
+
50
+ def endpoint_type(endpoint)
51
+ response_type = endpoint[:response_type]
52
+ return response_type unless response_type.is_a?(String)
53
+
54
+ version = (endpoint[:version] || API_VERSION).tr(".", "_").upcase
55
+ KinopoiskDevApi.const_get(response_type.sub("<VERSION>", version))
56
+ end
57
+
58
+ def build_params(raw_params)
59
+ params = raw_params.dup
60
+
61
+ params.transform_keys! do |key|
62
+ words = key.to_s.split("_")
63
+ words.drop(1).map(&:capitalize!)
64
+ words.join
65
+ end
66
+
67
+ params.transform_values! { |value| transform_value(value) }
68
+
69
+ params
70
+ end
71
+
72
+ def build_path(endpoint, params)
73
+ version = endpoint[:version] || API_VERSION
74
+ path = (+"/").concat(version, endpoint[:path])
75
+
76
+ path.gsub(/:(\w+)/) do |path_param|
77
+ params.key?(::Regexp.last_match(1)) ? params.delete(::Regexp.last_match(1)) : path_param
78
+ end
79
+ end
80
+
81
+ def transform_value(raw_value) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLength
82
+ case raw_value
83
+ when Array
84
+ raw_value.map { |e| transform_value(e) }
85
+ when String
86
+ raw_value
87
+ when Date, Time, DateTime
88
+ raw_value.strftime("%d.%m.%Y")
89
+ when TrueClass, FalseClass
90
+ raw_value ? "true" : "false"
91
+ when Range
92
+ transform_value([raw_value.begin, raw_value.end]).join("-")
93
+ else
94
+ raw_value.to_s
95
+ end
96
+ end
97
+ end
98
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ class Configuration
5
+ attr_accessor :adapter, :connection_open_timeout, :connection_timeout
6
+
7
+ def initialize
8
+ @adapter = Faraday.default_adapter
9
+ @connection_open_timeout = 20
10
+ @connection_timeout = 20
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,75 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ ENDPOINTS = {
5
+ movie_by_id: {
6
+ path: "/movie/:id",
7
+ response_type: "Types::MovieDto<VERSION>"
8
+ }.freeze,
9
+ movie: {
10
+ path: "/movie",
11
+ response_type: "Types::MovieDocsResponseDto<VERSION>"
12
+ }.freeze,
13
+ movie_search: {
14
+ path: "/movie/search",
15
+ response_type: "Types::SearchMovieResponseDto<VERSION>"
16
+ }.freeze,
17
+ movie_random: {
18
+ path: "/movie/random",
19
+ response_type: "Types::MovieDto<VERSION>"
20
+ }.freeze,
21
+ movie_awards: {
22
+ path: "/movie/awards",
23
+ response_type: Types::MovieAwardDocsResponseDto
24
+ }.freeze,
25
+ movie_possible_values_by_field: {
26
+ path: "/movie/possible-values-by-field",
27
+ response_type: Types::Array.of(Types::PossibleValueDto),
28
+ version: "v1"
29
+ }.freeze,
30
+ season: {
31
+ path: "/season",
32
+ response_type: "Types::SeasonDocsResponseDto<VERSION>"
33
+ }.freeze,
34
+ review: {
35
+ path: "/review",
36
+ response_type: "Types::ReviewDocsResponseDto<VERSION>"
37
+ }.freeze,
38
+ person_by_id: {
39
+ path: "/person/:id",
40
+ response_type: Types::Person
41
+ }.freeze,
42
+ person: {
43
+ path: "/person",
44
+ response_type: "Types::PersonDocsResponseDto<VERSION>"
45
+ }.freeze,
46
+ person_search: {
47
+ path: "/person/search",
48
+ response_type: "Types::SearchPersonResponseDto<VERSION>"
49
+ }.freeze,
50
+ person_awards: {
51
+ path: "/person/awards",
52
+ response_type: Types::PersonAwardDocsResponseDto
53
+ }.freeze,
54
+ studio: {
55
+ path: "/studio",
56
+ response_type: "Types::StudioDocsResponseDto<VERSION>"
57
+ }.freeze,
58
+ keyword: {
59
+ path: "/keyword",
60
+ response_type: "Types::KeywordDocsResponseDto<VERSION>"
61
+ }.freeze,
62
+ image: {
63
+ path: "/image",
64
+ response_type: "Types::ImageDocsResponseDto<VERSION>"
65
+ }.freeze,
66
+ list: {
67
+ path: "/list",
68
+ response_type: "Types::ListDocsResponseDto<VERSION>"
69
+ }.freeze,
70
+ list_by_slug: {
71
+ path: "/list/:slug",
72
+ response_type: Types::List
73
+ }.freeze
74
+ }.freeze
75
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Exceptions
5
+ class Base < StandardError; end
6
+ end
7
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Exceptions
5
+ class ResponseError < Base
6
+ attr_reader :response
7
+
8
+ def initialize(response:)
9
+ @response = response
10
+
11
+ super("Kinopoisk.dev API has returned the error. (#{data.map { |k, v| %(#{k}: #{v.inspect}) }.join(", ")})")
12
+ end
13
+
14
+ def error_code
15
+ data[:statusCode] || data["statusCode"]
16
+ end
17
+
18
+ def error_type
19
+ data[:error] || data["error"]
20
+ end
21
+
22
+ def error_message
23
+ data[:message] || data["message"]
24
+ end
25
+
26
+ def data
27
+ @data ||= begin
28
+ JSON.parse(response.body)
29
+ rescue JSON::ParserError
30
+ { error_code: response.status, uri: response.env.url.to_s }
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ class Inflector < Zeitwerk::GemInflector
5
+ def camelize(basename, abspath)
6
+ case basename
7
+ when "endpoints"
8
+ "ENDPOINTS"
9
+ when /(.*)_(v\d+(?:_\d+)*)/
10
+ super(::Regexp.last_match(1), abspath) + ::Regexp.last_match(2).upcase
11
+ else
12
+ super
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ class Audience < Base
6
+ attribute? :count, Types::Float | Types::Integer.optional
7
+ attribute? :country, Types::Coercible::String.optional
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ class Base < Dry::Struct
6
+ include Compactable
7
+ include PatternMatching
8
+
9
+ transform_keys(&:to_sym)
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ class BirthPlace < Base
6
+ attribute? :value, Types::Coercible::String
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
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,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ class CurrencyValue < Base
6
+ attribute? :value, Types::Float | Types::Integer.optional
7
+ attribute? :currency, Types::Coercible::String.optional
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ class DeathPlace < Base
6
+ attribute? :value, Types::Coercible::String
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ ## Just for classes consistency
6
+ # rubocop:disable Naming/ClassAndModuleCamelCase
7
+ class EpisodeV1_4 < Base
8
+ attribute? :number, Types::Float | Types::Integer
9
+ attribute? :name, Types::Coercible::String
10
+ attribute? :enName, Types::Coercible::String
11
+ attribute? :date, Types::Coercible::String
12
+ attribute? :description, Types::Coercible::String
13
+ attribute? :still, ShortImage
14
+ attribute? :airDate, Types::Coercible::String
15
+ attribute? :enDescription, Types::Coercible::String
16
+ alias en_name enName
17
+ alias air_date airDate
18
+ alias en_description enDescription
19
+ end
20
+ # rubocop:enable Naming/ClassAndModuleCamelCase
21
+ end
22
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ class ExternalId < Base
6
+ attribute? :kpHD, Types::Coercible::String.optional
7
+ attribute? :imdb, Types::Coercible::String.optional
8
+ attribute? :tmdb, Types::Float | Types::Integer.optional
9
+ alias kp_hd kpHD
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ class FactInMovie < Base
6
+ attribute? :value, Types::Coercible::String
7
+ attribute? :type, Types::Coercible::String.optional
8
+ attribute? :spoiler, Types::Bool.optional
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ class FactInPerson < Base
6
+ attribute? :value, Types::Coercible::String
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ class Fees < Base
6
+ attribute? :world, CurrencyValue
7
+ attribute? :russia, CurrencyValue
8
+ attribute? :usa, CurrencyValue
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ class Image < Base
6
+ attribute? :movieId, Types::Float | Types::Integer
7
+ attribute? :type, Types::Coercible::String
8
+ attribute? :language, Types::Coercible::String
9
+ attribute? :url, Types::Coercible::String
10
+ attribute? :previewUrl, Types::Coercible::String
11
+ attribute? :height, Types::Float | Types::Integer
12
+ attribute? :width, Types::Float | Types::Integer
13
+ attribute? :updatedAt, Types::Coercible::String
14
+ attribute? :createdAt, Types::Coercible::String
15
+ alias movie_id movieId
16
+ alias preview_url previewUrl
17
+ alias updated_at updatedAt
18
+ alias created_at createdAt
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ ## Just for classes consistency
6
+ # rubocop:disable Naming/ClassAndModuleCamelCase
7
+ class ImageDocsResponseDtoV1_4 < Base
8
+ attribute? :docs, Types::Array.of(Image)
9
+ attribute? :total, Types::Float | Types::Integer
10
+ attribute? :limit, Types::Float | Types::Integer
11
+ attribute? :page, Types::Float | Types::Integer
12
+ attribute? :pages, Types::Float | Types::Integer
13
+ end
14
+ # rubocop:enable Naming/ClassAndModuleCamelCase
15
+ end
16
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ class ItemName < Base
6
+ attribute? :name, Types::Coercible::String
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ class Keyword < Base
6
+ attribute? :id, Types::Float | Types::Integer
7
+ attribute? :title, Types::Coercible::String.optional
8
+ attribute? :movies, Types::Array.of(MovieFromKeyword)
9
+ attribute? :updatedAt, Types::Coercible::String
10
+ attribute? :createdAt, Types::Coercible::String
11
+ alias updated_at updatedAt
12
+ alias created_at createdAt
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ ## Just for classes consistency
6
+ # rubocop:disable Naming/ClassAndModuleCamelCase
7
+ class KeywordDocsResponseDtoV1_4 < Base
8
+ attribute? :docs, Types::Array.of(Keyword)
9
+ attribute? :total, Types::Float | Types::Integer
10
+ attribute? :limit, Types::Float | Types::Integer
11
+ attribute? :page, Types::Float | Types::Integer
12
+ attribute? :pages, Types::Float | Types::Integer
13
+ end
14
+ # rubocop:enable Naming/ClassAndModuleCamelCase
15
+ end
16
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ ## Just for classes consistency
6
+ # rubocop:disable Naming/ClassAndModuleCamelCase
7
+ class LinkedMovieV1_4 < Base
8
+ attribute? :id, Types::Float | Types::Integer
9
+ attribute? :name, Types::Coercible::String.optional
10
+ attribute? :enName, Types::Coercible::String.optional
11
+ attribute? :alternativeName, Types::Coercible::String.optional
12
+ attribute? :type, Types::Coercible::String.optional
13
+ attribute? :poster, ShortImage.optional
14
+ attribute? :rating, Rating.optional
15
+ attribute? :year, Types::Float | Types::Integer.optional
16
+ alias en_name enName
17
+ alias alternative_name alternativeName
18
+ end
19
+ # rubocop:enable Naming/ClassAndModuleCamelCase
20
+ end
21
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ class List < Base
6
+ attribute? :category, Types::Coercible::String.optional
7
+ attribute? :slug, Types::Coercible::String.optional
8
+ attribute? :moviesCount, Types::Float | Types::Integer.optional
9
+ attribute? :cover, ShortImage.optional
10
+ attribute? :name, Types::Coercible::String
11
+ attribute? :updatedAt, Types::Coercible::String
12
+ attribute? :createdAt, Types::Coercible::String
13
+ alias movies_count moviesCount
14
+ alias updated_at updatedAt
15
+ alias created_at createdAt
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ ## Just for classes consistency
6
+ # rubocop:disable Naming/ClassAndModuleCamelCase
7
+ class ListDocsResponseDtoV1_4 < Base
8
+ attribute? :docs, Types::Array.of(List)
9
+ attribute? :total, Types::Float | Types::Integer
10
+ attribute? :limit, Types::Float | Types::Integer
11
+ attribute? :page, Types::Float | Types::Integer
12
+ attribute? :pages, Types::Float | Types::Integer
13
+ end
14
+ # rubocop:enable Naming/ClassAndModuleCamelCase
15
+ end
16
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ class Logo < Base
6
+ attribute? :url, Types::Coercible::String.optional
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ ## Just for classes consistency
6
+ # rubocop:disable Naming/ClassAndModuleCamelCase
7
+ class MeiliPersonEntityV1_4 < Base
8
+ attribute? :id, Types::Float | Types::Integer
9
+ attribute? :name, Types::Coercible::String.optional
10
+ attribute? :enName, Types::Coercible::String.optional
11
+ attribute? :photo, Types::Coercible::String.optional
12
+ attribute? :sex, Types::Coercible::String.optional
13
+ attribute? :growth, Types::Float | Types::Integer.optional
14
+ attribute? :birthday, Types::Coercible::String.optional
15
+ attribute? :death, Types::Coercible::String.optional
16
+ attribute? :age, Types::Float | Types::Integer.optional
17
+ attribute? :birthPlace, Types::Array.of(BirthPlace)
18
+ attribute? :deathPlace, Types::Array.of(DeathPlace)
19
+ attribute? :profession, Types::Array.of(Profession)
20
+ alias en_name enName
21
+ alias birth_place birthPlace
22
+ alias death_place deathPlace
23
+ end
24
+ # rubocop:enable Naming/ClassAndModuleCamelCase
25
+ end
26
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ class Movie < Base
6
+ attribute? :id, Types::Float | Types::Integer
7
+ attribute? :name, Types::Coercible::String.optional
8
+ attribute? :rating, Types::Float | Types::Integer.optional
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ class MovieAward < Base
6
+ attribute? :nomination, Nomination.optional
7
+ attribute? :winning, Types::Bool.optional
8
+ attribute? :updatedAt, Types::Coercible::String.optional
9
+ attribute? :createdAt, Types::Coercible::String.optional
10
+ attribute? :movieId, Types::Float | Types::Integer.optional
11
+ alias updated_at updatedAt
12
+ alias created_at createdAt
13
+ alias movie_id movieId
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ class MovieAwardDocsResponseDto < Base
6
+ attribute? :docs, Types::Array.of(MovieAward)
7
+ attribute? :total, Types::Float | Types::Integer
8
+ attribute? :limit, Types::Float | Types::Integer
9
+ attribute? :page, Types::Float | Types::Integer
10
+ attribute? :pages, Types::Float | Types::Integer
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KinopoiskDevApi
4
+ module Types
5
+ ## Just for classes consistency
6
+ # rubocop:disable Naming/ClassAndModuleCamelCase
7
+ class MovieDocsResponseDtoV1_4 < Base
8
+ attribute? :docs, Types::Array.of(MovieDtoV1_4)
9
+ attribute? :total, Types::Float | Types::Integer
10
+ attribute? :limit, Types::Float | Types::Integer
11
+ attribute? :page, Types::Float | Types::Integer
12
+ attribute? :pages, Types::Float | Types::Integer
13
+ end
14
+ # rubocop:enable Naming/ClassAndModuleCamelCase
15
+ end
16
+ end