Class: TmdbApiClient::AccountMovieRecommendationsResponseResultsItem

Inherits:
Object
  • Object
show all
Defined in:
lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(adult: OMIT, backdrop_path: OMIT, id: OMIT, title: OMIT, original_language: OMIT, original_title: OMIT, overview: OMIT, poster_path: OMIT, media_type: OMIT, genre_ids: OMIT, popularity: OMIT, release_date: OMIT, video: OMIT, vote_average: OMIT, vote_count: OMIT, additional_properties: nil) ⇒ TmdbApiClient::AccountMovieRecommendationsResponseResultsItem

Parameters:

  • adult (Boolean) (defaults to: OMIT)
  • backdrop_path (String) (defaults to: OMIT)
  • id (Integer) (defaults to: OMIT)
  • title (String) (defaults to: OMIT)
  • original_language (String) (defaults to: OMIT)
  • original_title (String) (defaults to: OMIT)
  • overview (String) (defaults to: OMIT)
  • poster_path (String) (defaults to: OMIT)
  • media_type (String) (defaults to: OMIT)
  • genre_ids (Array<Integer>) (defaults to: OMIT)
  • popularity (Float) (defaults to: OMIT)
  • release_date (String) (defaults to: OMIT)
  • video (Boolean) (defaults to: OMIT)
  • vote_average (Float) (defaults to: OMIT)
  • vote_count (Integer) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil) —

    Additional properties unmapped to the current class definition



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb', line 63

def initialize(adult: OMIT, backdrop_path: OMIT, id: OMIT, title: OMIT, original_language: OMIT,
               original_title: OMIT, overview: OMIT, poster_path: OMIT, media_type: OMIT, genre_ids: OMIT, popularity: OMIT, release_date: OMIT, video: OMIT, vote_average: OMIT, vote_count: OMIT, additional_properties: nil)
  @adult = adult if adult != OMIT
  @backdrop_path = backdrop_path if backdrop_path != OMIT
  @id = id if id != OMIT
  @title = title if title != OMIT
  @original_language = original_language if original_language != OMIT
  @original_title = original_title if original_title != OMIT
  @overview = overview if overview != OMIT
  @poster_path = poster_path if poster_path != OMIT
  @media_type = media_type if media_type != OMIT
  @genre_ids = genre_ids if genre_ids != OMIT
  @popularity = popularity if popularity != OMIT
  @release_date = release_date if release_date != OMIT
  @video = video if video != OMIT
  @vote_average = vote_average if vote_average != OMIT
  @vote_count = vote_count if vote_count != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "adult": adult,
    "backdrop_path": backdrop_path,
    "id": id,
    "title": title,
    "original_language": original_language,
    "original_title": original_title,
    "overview": overview,
    "poster_path": poster_path,
    "media_type": media_type,
    "genre_ids": genre_ids,
    "popularity": popularity,
    "release_date": release_date,
    "video": video,
    "vote_average": vote_average,
    "vote_count": vote_count
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#additional_properties ⇒ OpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct) —

    Additional properties unmapped to the current class definition



39
40
41
# File 'lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb', line 39

def additional_properties
  @additional_properties
end

#adult ⇒ Boolean (readonly)

Returns:

  • (Boolean)


9
10
11
# File 'lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb', line 9

def adult
  @adult
end

#backdrop_path ⇒ String (readonly)

Returns:

  • (String)


11
12
13
# File 'lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb', line 11

def backdrop_path
  @backdrop_path
end

#genre_ids ⇒ Array<Integer> (readonly)

Returns:

  • (Array<Integer>)


27
28
29
# File 'lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb', line 27

def genre_ids
  @genre_ids
end

#id ⇒ Integer (readonly)

Returns:

  • (Integer)


13
14
15
# File 'lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb', line 13

def id
  @id
end

#media_type ⇒ String (readonly)

Returns:

  • (String)


25
26
27
# File 'lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb', line 25

def media_type
  @media_type
end

#original_language ⇒ String (readonly)

Returns:

  • (String)


17
18
19
# File 'lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb', line 17

def original_language
  @original_language
end

#original_title ⇒ String (readonly)

Returns:

  • (String)


19
20
21
# File 'lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb', line 19

def original_title
  @original_title
end

#overview ⇒ String (readonly)

Returns:

  • (String)


21
22
23
# File 'lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb', line 21

def overview
  @overview
end

#popularity ⇒ Float (readonly)

Returns:

  • (Float)


29
30
31
# File 'lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb', line 29

def popularity
  @popularity
end

#poster_path ⇒ String (readonly)

Returns:

  • (String)


23
24
25
# File 'lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb', line 23

def poster_path
  @poster_path
end

#release_date ⇒ String (readonly)

Returns:

  • (String)


31
32
33
# File 'lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb', line 31

def release_date
  @release_date
end

#title ⇒ String (readonly)

Returns:

  • (String)


15
16
17
# File 'lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb', line 15

def title
  @title
end

#video ⇒ Boolean (readonly)

Returns:

  • (Boolean)


33
34
35
# File 'lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb', line 33

def video
  @video
end

#vote_average ⇒ Float (readonly)

Returns:

  • (Float)


35
36
37
# File 'lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb', line 35

def vote_average
  @vote_average
end

#vote_count ⇒ Integer (readonly)

Returns:

  • (Integer)


37
38
39
# File 'lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb', line 37

def vote_count
  @vote_count
end

Class Method Details

.from_json(json_object:) ⇒ TmdbApiClient::AccountMovieRecommendationsResponseResultsItem

Deserialize a JSON object to an instance of AccountMovieRecommendationsResponseResultsItem

Parameters:

  • json_object (String)

Returns:



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
# File 'lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb', line 107

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  adult = parsed_json["adult"]
  backdrop_path = parsed_json["backdrop_path"]
  id = parsed_json["id"]
  title = parsed_json["title"]
  original_language = parsed_json["original_language"]
  original_title = parsed_json["original_title"]
  overview = parsed_json["overview"]
  poster_path = parsed_json["poster_path"]
  media_type = parsed_json["media_type"]
  genre_ids = parsed_json["genre_ids"]
  popularity = parsed_json["popularity"]
  release_date = parsed_json["release_date"]
  video = parsed_json["video"]
  vote_average = parsed_json["vote_average"]
  vote_count = parsed_json["vote_count"]
  new(
    adult: adult,
    backdrop_path: backdrop_path,
    id: id,
    title: title,
    original_language: original_language,
    original_title: original_title,
    overview: overview,
    poster_path: poster_path,
    media_type: media_type,
    genre_ids: genre_ids,
    popularity: popularity,
    release_date: release_date,
    video: video,
    vote_average: vote_average,
    vote_count: vote_count,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.

Parameters:

  • obj (Object)

Returns:

  • (Void)


159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb', line 159

def self.validate_raw(obj:)
  obj.adult&.is_a?(Boolean) != false || raise("Passed value for field obj.adult is not the expected type, validation failed.")
  obj.backdrop_path&.is_a?(String) != false || raise("Passed value for field obj.backdrop_path is not the expected type, validation failed.")
  obj.id&.is_a?(Integer) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
  obj.title&.is_a?(String) != false || raise("Passed value for field obj.title is not the expected type, validation failed.")
  obj.original_language&.is_a?(String) != false || raise("Passed value for field obj.original_language is not the expected type, validation failed.")
  obj.original_title&.is_a?(String) != false || raise("Passed value for field obj.original_title is not the expected type, validation failed.")
  obj.overview&.is_a?(String) != false || raise("Passed value for field obj.overview is not the expected type, validation failed.")
  obj.poster_path&.is_a?(String) != false || raise("Passed value for field obj.poster_path is not the expected type, validation failed.")
  obj.media_type&.is_a?(String) != false || raise("Passed value for field obj.media_type is not the expected type, validation failed.")
  obj.genre_ids&.is_a?(Array) != false || raise("Passed value for field obj.genre_ids is not the expected type, validation failed.")
  obj.popularity&.is_a?(Float) != false || raise("Passed value for field obj.popularity is not the expected type, validation failed.")
  obj.release_date&.is_a?(String) != false || raise("Passed value for field obj.release_date is not the expected type, validation failed.")
  obj.video&.is_a?(Boolean) != false || raise("Passed value for field obj.video is not the expected type, validation failed.")
  obj.vote_average&.is_a?(Float) != false || raise("Passed value for field obj.vote_average is not the expected type, validation failed.")
  obj.vote_count&.is_a?(Integer) != false || raise("Passed value for field obj.vote_count is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of AccountMovieRecommendationsResponseResultsItem to a JSON object

Returns:

  • (String)


149
150
151
# File 'lib/tmdb_ryanstep/types/account_movie_recommendations_response_results_item.rb', line 149

def to_json(*_args)
  @_field_set&.to_json
end