Class: TmdbApiClient::AccountListsResponseResultsItem

Inherits:
Object
  • Object
show all
Defined in:
lib/tmdb_ryanstep/types/account_lists_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(account_object_id: OMIT, adult: OMIT, average_rating: OMIT, created_at: OMIT, description: OMIT, featured: OMIT, id: OMIT, iso_3166_1: OMIT, iso_639_1: OMIT, name: OMIT, number_of_items: OMIT, public: OMIT, revenue: OMIT, runtime: OMIT, sort_by: OMIT, updated_at: OMIT, additional_properties: nil) ⇒ TmdbApiClient::AccountListsResponseResultsItem

Parameters:

  • account_object_id (String) (defaults to: OMIT)
  • adult (Integer) (defaults to: OMIT)
  • average_rating (Float) (defaults to: OMIT)
  • created_at (String) (defaults to: OMIT)
  • description (String) (defaults to: OMIT)
  • featured (Integer) (defaults to: OMIT)
  • id (Integer) (defaults to: OMIT)
  • iso_3166_1 (String) (defaults to: OMIT)
  • iso_639_1 (String) (defaults to: OMIT)
  • name (String) (defaults to: OMIT)
  • number_of_items (Integer) (defaults to: OMIT)
  • public (Integer) (defaults to: OMIT)
  • revenue (String) (defaults to: OMIT)
  • runtime (Integer) (defaults to: OMIT)
  • sort_by (Integer) (defaults to: OMIT)
  • updated_at (String) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil) —

    Additional properties unmapped to the current class definition



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
101
102
103
104
105
# File 'lib/tmdb_ryanstep/types/account_lists_response_results_item.rb', line 66

def initialize(account_object_id: OMIT, adult: OMIT, average_rating: OMIT, created_at: OMIT, description: OMIT,
               featured: OMIT, id: OMIT, iso_3166_1: OMIT, iso_639_1: OMIT, name: OMIT, number_of_items: OMIT, public: OMIT, revenue: OMIT, runtime: OMIT, sort_by: OMIT, updated_at: OMIT, additional_properties: nil)
  @account_object_id =  if  != OMIT
  @adult = adult if adult != OMIT
  @average_rating = average_rating if average_rating != OMIT
  @created_at = created_at if created_at != OMIT
  @description = description if description != OMIT
  @featured = featured if featured != OMIT
  @id = id if id != OMIT
  @iso_3166_1 = iso_3166_1 if iso_3166_1 != OMIT
  @iso_639_1 = iso_639_1 if iso_639_1 != OMIT
  @name = name if name != OMIT
  @number_of_items = number_of_items if number_of_items != OMIT
  @public = public if public != OMIT
  @revenue = revenue if revenue != OMIT
  @runtime = runtime if runtime != OMIT
  @sort_by = sort_by if sort_by != OMIT
  @updated_at = updated_at if updated_at != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "account_object_id": ,
    "adult": adult,
    "average_rating": average_rating,
    "created_at": created_at,
    "description": description,
    "featured": featured,
    "id": id,
    "iso_3166_1": iso_3166_1,
    "iso_639_1": iso_639_1,
    "name": name,
    "number_of_items": number_of_items,
    "public": public,
    "revenue": revenue,
    "runtime": runtime,
    "sort_by": sort_by,
    "updated_at": updated_at
  }.reject do |_k, v|
    v == OMIT
  end
end

Instance Attribute Details

#account_object_id ⇒ String (readonly)

Returns:

  • (String)


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

def 
  @account_object_id
end

#additional_properties ⇒ OpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct) —

    Additional properties unmapped to the current class definition



41
42
43
# File 'lib/tmdb_ryanstep/types/account_lists_response_results_item.rb', line 41

def additional_properties
  @additional_properties
end

#adult ⇒ Integer (readonly)

Returns:

  • (Integer)


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

def adult
  @adult
end

#average_rating ⇒ Float (readonly)

Returns:

  • (Float)


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

def average_rating
  @average_rating
end

#created_at ⇒ String (readonly)

Returns:

  • (String)


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

def created_at
  @created_at
end

#description ⇒ String (readonly)

Returns:

  • (String)


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

def description
  @description
end

Returns:

  • (Integer)


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

def featured
  @featured
end

#id ⇒ Integer (readonly)

Returns:

  • (Integer)


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

def id
  @id
end

#iso_3166_1 ⇒ String (readonly)

Returns:

  • (String)


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

def iso_3166_1
  @iso_3166_1
end

#iso_639_1 ⇒ String (readonly)

Returns:

  • (String)


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

def iso_639_1
  @iso_639_1
end

#name ⇒ String (readonly)

Returns:

  • (String)


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

def name
  @name
end

#number_of_items ⇒ Integer (readonly)

Returns:

  • (Integer)


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

def number_of_items
  @number_of_items
end

#public ⇒ Integer (readonly)

Returns:

  • (Integer)


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

def public
  @public
end

#revenue ⇒ String (readonly)

Returns:

  • (String)


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

def revenue
  @revenue
end

#runtime ⇒ Integer (readonly)

Returns:

  • (Integer)


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

def runtime
  @runtime
end

#sort_by ⇒ Integer (readonly)

Returns:

  • (Integer)


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

def sort_by
  @sort_by
end

#updated_at ⇒ String (readonly)

Returns:

  • (String)


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

def updated_at
  @updated_at
end

Class Method Details

.from_json(json_object:) ⇒ TmdbApiClient::AccountListsResponseResultsItem

Deserialize a JSON object to an instance of AccountListsResponseResultsItem

Parameters:

  • json_object (String)

Returns:



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

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
   = parsed_json["account_object_id"]
  adult = parsed_json["adult"]
  average_rating = parsed_json["average_rating"]
  created_at = parsed_json["created_at"]
  description = parsed_json["description"]
  featured = parsed_json["featured"]
  id = parsed_json["id"]
  iso_3166_1 = parsed_json["iso_3166_1"]
  iso_639_1 = parsed_json["iso_639_1"]
  name = parsed_json["name"]
  number_of_items = parsed_json["number_of_items"]
  public = parsed_json["public"]
  revenue = parsed_json["revenue"]
  runtime = parsed_json["runtime"]
  sort_by = parsed_json["sort_by"]
  updated_at = parsed_json["updated_at"]
  new(
    account_object_id: ,
    adult: adult,
    average_rating: average_rating,
    created_at: created_at,
    description: description,
    featured: featured,
    id: id,
    iso_3166_1: iso_3166_1,
    iso_639_1: iso_639_1,
    name: name,
    number_of_items: number_of_items,
    public: public,
    revenue: revenue,
    runtime: runtime,
    sort_by: sort_by,
    updated_at: updated_at,
    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)


164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/tmdb_ryanstep/types/account_lists_response_results_item.rb', line 164

def self.validate_raw(obj:)
  obj.&.is_a?(String) != false || raise("Passed value for field obj.account_object_id is not the expected type, validation failed.")
  obj.adult&.is_a?(Integer) != false || raise("Passed value for field obj.adult is not the expected type, validation failed.")
  obj.average_rating&.is_a?(Float) != false || raise("Passed value for field obj.average_rating is not the expected type, validation failed.")
  obj.created_at&.is_a?(String) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
  obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.")
  obj.featured&.is_a?(Integer) != false || raise("Passed value for field obj.featured 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.iso_3166_1&.is_a?(String) != false || raise("Passed value for field obj.iso_3166_1 is not the expected type, validation failed.")
  obj.iso_639_1&.is_a?(String) != false || raise("Passed value for field obj.iso_639_1 is not the expected type, validation failed.")
  obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
  obj.number_of_items&.is_a?(Integer) != false || raise("Passed value for field obj.number_of_items is not the expected type, validation failed.")
  obj.public&.is_a?(Integer) != false || raise("Passed value for field obj.public is not the expected type, validation failed.")
  obj.revenue&.is_a?(String) != false || raise("Passed value for field obj.revenue is not the expected type, validation failed.")
  obj.runtime&.is_a?(Integer) != false || raise("Passed value for field obj.runtime is not the expected type, validation failed.")
  obj.sort_by&.is_a?(Integer) != false || raise("Passed value for field obj.sort_by is not the expected type, validation failed.")
  obj.updated_at&.is_a?(String) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of AccountListsResponseResultsItem to a JSON object

Returns:

  • (String)


154
155
156
# File 'lib/tmdb_ryanstep/types/account_lists_response_results_item.rb', line 154

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