Class: AssemblyAI::Transcripts::PageDetails
- Inherits:
-
Object
- Object
- AssemblyAI::Transcripts::PageDetails
- Defined in:
- lib/assemblyai/transcripts/types/page_details.rb
Overview
Details of the transcript page. Transcripts are sorted from newest to oldest.
The previous URL always points to a page with older transcripts.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#current_url ⇒ String
readonly
The URL used to retrieve the current page of transcripts.
-
#limit ⇒ Integer
readonly
The number of results this page is limited to.
-
#next_url ⇒ String
readonly
The URL to the next page of transcripts.
-
#prev_url ⇒ String
readonly
The URL to the next page of transcripts.
-
#result_count ⇒ Integer
readonly
The actual number of results in the page.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ AssemblyAI::Transcripts::PageDetails
Deserialize a JSON object to an instance of PageDetails.
-
.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(limit:, result_count:, current_url:, prev_url: OMIT, next_url: OMIT, additional_properties: nil) ⇒ AssemblyAI::Transcripts::PageDetails constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of PageDetails to a JSON object.
Constructor Details
#initialize(limit:, result_count:, current_url:, prev_url: OMIT, next_url: OMIT, additional_properties: nil) ⇒ AssemblyAI::Transcripts::PageDetails
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/assemblyai/transcripts/types/page_details.rb', line 40 def initialize(limit:, result_count:, current_url:, prev_url: OMIT, next_url: OMIT, additional_properties: nil) @limit = limit @result_count = result_count @current_url = current_url @prev_url = prev_url if prev_url != OMIT @next_url = next_url if next_url != OMIT @additional_properties = additional_properties @_field_set = { "limit": limit, "result_count": result_count, "current_url": current_url, "prev_url": prev_url, "next_url": next_url }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
24 25 26 |
# File 'lib/assemblyai/transcripts/types/page_details.rb', line 24 def additional_properties @additional_properties end |
#current_url ⇒ String (readonly)
Returns The URL used to retrieve the current page of transcripts.
16 17 18 |
# File 'lib/assemblyai/transcripts/types/page_details.rb', line 16 def current_url @current_url end |
#limit ⇒ Integer (readonly)
Returns The number of results this page is limited to.
12 13 14 |
# File 'lib/assemblyai/transcripts/types/page_details.rb', line 12 def limit @limit end |
#next_url ⇒ String (readonly)
Returns The URL to the next page of transcripts. The next URL always points to a page with newer transcripts.
22 23 24 |
# File 'lib/assemblyai/transcripts/types/page_details.rb', line 22 def next_url @next_url end |
#prev_url ⇒ String (readonly)
Returns The URL to the next page of transcripts. The previous URL always points to a page with older transcripts.
19 20 21 |
# File 'lib/assemblyai/transcripts/types/page_details.rb', line 19 def prev_url @prev_url end |
#result_count ⇒ Integer (readonly)
Returns The actual number of results in the page.
14 15 16 |
# File 'lib/assemblyai/transcripts/types/page_details.rb', line 14 def result_count @result_count end |
Class Method Details
.from_json(json_object:) ⇒ AssemblyAI::Transcripts::PageDetails
Deserialize a JSON object to an instance of PageDetails
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/assemblyai/transcripts/types/page_details.rb', line 62 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) limit = struct["limit"] result_count = struct["result_count"] current_url = struct["current_url"] prev_url = struct["prev_url"] next_url = struct["next_url"] new( limit: limit, result_count: result_count, current_url: current_url, prev_url: prev_url, next_url: next_url, 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.
92 93 94 95 96 97 98 |
# File 'lib/assemblyai/transcripts/types/page_details.rb', line 92 def self.validate_raw(obj:) obj.limit.is_a?(Integer) != false || raise("Passed value for field obj.limit is not the expected type, validation failed.") obj.result_count.is_a?(Integer) != false || raise("Passed value for field obj.result_count is not the expected type, validation failed.") obj.current_url.is_a?(String) != false || raise("Passed value for field obj.current_url is not the expected type, validation failed.") obj.prev_url&.is_a?(String) != false || raise("Passed value for field obj.prev_url is not the expected type, validation failed.") obj.next_url&.is_a?(String) != false || raise("Passed value for field obj.next_url is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of PageDetails to a JSON object
82 83 84 |
# File 'lib/assemblyai/transcripts/types/page_details.rb', line 82 def to_json(*_args) @_field_set&.to_json end |