Class: TmdbApiClient::ListItemStatusResponse
- Inherits:
-
Object
- Object
- TmdbApiClient::ListItemStatusResponse
- Defined in:
- lib/tmdb_ryanstep/types/list_item_status_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #id ⇒ Integer readonly
- #media_id ⇒ Integer readonly
- #media_type ⇒ String readonly
- #status_code ⇒ Integer readonly
- #status_message ⇒ String readonly
- #success ⇒ Boolean readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ TmdbApiClient::ListItemStatusResponse
Deserialize a JSON object to an instance of ListItemStatusResponse.
-
.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.
Instance Method Summary collapse
- #initialize(media_type: OMIT, success: OMIT, status_message: OMIT, id: OMIT, media_id: OMIT, status_code: OMIT, additional_properties: nil) ⇒ TmdbApiClient::ListItemStatusResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ListItemStatusResponse to a JSON object.
Constructor Details
#initialize(media_type: OMIT, success: OMIT, status_message: OMIT, id: OMIT, media_id: OMIT, status_code: OMIT, additional_properties: nil) ⇒ TmdbApiClient::ListItemStatusResponse
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/tmdb_ryanstep/types/list_item_status_response.rb', line 36 def initialize(media_type: OMIT, success: OMIT, status_message: OMIT, id: OMIT, media_id: OMIT, status_code: OMIT, additional_properties: nil) @media_type = media_type if media_type != OMIT @success = success if success != OMIT = if != OMIT @id = id if id != OMIT @media_id = media_id if media_id != OMIT @status_code = status_code if status_code != OMIT @additional_properties = additional_properties @_field_set = { "media_type": media_type, "success": success, "status_message": , "id": id, "media_id": media_id, "status_code": status_code }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
21 22 23 |
# File 'lib/tmdb_ryanstep/types/list_item_status_response.rb', line 21 def additional_properties @additional_properties end |
#id ⇒ Integer (readonly)
15 16 17 |
# File 'lib/tmdb_ryanstep/types/list_item_status_response.rb', line 15 def id @id end |
#media_id ⇒ Integer (readonly)
17 18 19 |
# File 'lib/tmdb_ryanstep/types/list_item_status_response.rb', line 17 def media_id @media_id end |
#media_type ⇒ String (readonly)
9 10 11 |
# File 'lib/tmdb_ryanstep/types/list_item_status_response.rb', line 9 def media_type @media_type end |
#status_code ⇒ Integer (readonly)
19 20 21 |
# File 'lib/tmdb_ryanstep/types/list_item_status_response.rb', line 19 def status_code @status_code end |
#status_message ⇒ String (readonly)
13 14 15 |
# File 'lib/tmdb_ryanstep/types/list_item_status_response.rb', line 13 def end |
#success ⇒ Boolean (readonly)
11 12 13 |
# File 'lib/tmdb_ryanstep/types/list_item_status_response.rb', line 11 def success @success end |
Class Method Details
.from_json(json_object:) ⇒ TmdbApiClient::ListItemStatusResponse
Deserialize a JSON object to an instance of ListItemStatusResponse
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/tmdb_ryanstep/types/list_item_status_response.rb', line 61 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) media_type = parsed_json["media_type"] success = parsed_json["success"] = parsed_json["status_message"] id = parsed_json["id"] media_id = parsed_json["media_id"] status_code = parsed_json["status_code"] new( media_type: media_type, success: success, status_message: , id: id, media_id: media_id, status_code: status_code, 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.
94 95 96 97 98 99 100 101 |
# File 'lib/tmdb_ryanstep/types/list_item_status_response.rb', line 94 def self.validate_raw(obj:) obj.media_type&.is_a?(String) != false || raise("Passed value for field obj.media_type is not the expected type, validation failed.") obj.success&.is_a?(Boolean) != false || raise("Passed value for field obj.success is not the expected type, validation failed.") obj.&.is_a?(String) != false || raise("Passed value for field obj.status_message 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.media_id&.is_a?(Integer) != false || raise("Passed value for field obj.media_id is not the expected type, validation failed.") obj.status_code&.is_a?(Integer) != false || raise("Passed value for field obj.status_code is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of ListItemStatusResponse to a JSON object
84 85 86 |
# File 'lib/tmdb_ryanstep/types/list_item_status_response.rb', line 84 def to_json(*_args) @_field_set&.to_json end |