faqieh 0.0.1
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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/LICENSE +21 -0
- data/README.md +173 -0
- data/Rakefile +10 -0
- data/docs/Channel.md +50 -0
- data/docs/ChannelsApi.md +155 -0
- data/docs/DownloadTranscript202Response.md +18 -0
- data/docs/DownloadUrls.md +22 -0
- data/docs/Error.md +18 -0
- data/docs/ErrorError.md +24 -0
- data/docs/FacetOption.md +22 -0
- data/docs/GetChannel200Response.md +18 -0
- data/docs/GetMedium200Response.md +18 -0
- data/docs/GetPlaylist200Response.md +18 -0
- data/docs/GetSpeaker200Response.md +18 -0
- data/docs/GetTranscript200Response.md +20 -0
- data/docs/ListChannels200Response.md +20 -0
- data/docs/ListMedia200Response.md +20 -0
- data/docs/ListPlaylists200Response.md +20 -0
- data/docs/ListSpeakers200Response.md +20 -0
- data/docs/ListTranscripts200Response.md +18 -0
- data/docs/MediaApi.md +161 -0
- data/docs/Medium.md +64 -0
- data/docs/Pagination.md +28 -0
- data/docs/Platform.md +15 -0
- data/docs/Playlist.md +54 -0
- data/docs/PlaylistsApi.md +159 -0
- data/docs/Search200Response.md +20 -0
- data/docs/SearchApi.md +96 -0
- data/docs/SearchSection.md +22 -0
- data/docs/SearchSectionFacets.md +22 -0
- data/docs/Speaker.md +40 -0
- data/docs/SpeakerCountriesInner.md +20 -0
- data/docs/SpeakersApi.md +155 -0
- data/docs/TranscriptDetail.md +28 -0
- data/docs/TranscriptSearchResult.md +42 -0
- data/docs/TranscriptSegment.md +30 -0
- data/docs/TranscriptSummary.md +24 -0
- data/docs/TranscriptsApi.md +222 -0
- data/faqieh.gemspec +41 -0
- data/lib/faqieh/api/channels_api.rb +192 -0
- data/lib/faqieh/api/media_api.rb +200 -0
- data/lib/faqieh/api/playlists_api.rb +198 -0
- data/lib/faqieh/api/search_api.rb +159 -0
- data/lib/faqieh/api/speakers_api.rb +192 -0
- data/lib/faqieh/api/transcripts_api.rb +280 -0
- data/lib/faqieh/api_client.rb +441 -0
- data/lib/faqieh/api_error.rb +58 -0
- data/lib/faqieh/api_model_base.rb +88 -0
- data/lib/faqieh/configuration.rb +385 -0
- data/lib/faqieh/models/channel.rb +340 -0
- data/lib/faqieh/models/download_transcript202_response.rb +188 -0
- data/lib/faqieh/models/download_urls.rb +216 -0
- data/lib/faqieh/models/error.rb +164 -0
- data/lib/faqieh/models/error_error.rb +243 -0
- data/lib/faqieh/models/facet_option.rb +216 -0
- data/lib/faqieh/models/get_channel200_response.rb +164 -0
- data/lib/faqieh/models/get_medium200_response.rb +164 -0
- data/lib/faqieh/models/get_playlist200_response.rb +164 -0
- data/lib/faqieh/models/get_speaker200_response.rb +164 -0
- data/lib/faqieh/models/get_transcript200_response.rb +173 -0
- data/lib/faqieh/models/list_channels200_response.rb +192 -0
- data/lib/faqieh/models/list_media200_response.rb +192 -0
- data/lib/faqieh/models/list_playlists200_response.rb +192 -0
- data/lib/faqieh/models/list_speakers200_response.rb +192 -0
- data/lib/faqieh/models/list_transcripts200_response.rb +166 -0
- data/lib/faqieh/models/medium.rb +412 -0
- data/lib/faqieh/models/pagination.rb +195 -0
- data/lib/faqieh/models/platform.rb +40 -0
- data/lib/faqieh/models/playlist.rb +361 -0
- data/lib/faqieh/models/search200_response.rb +192 -0
- data/lib/faqieh/models/search_section.rb +187 -0
- data/lib/faqieh/models/search_section_facets.rb +243 -0
- data/lib/faqieh/models/speaker.rb +275 -0
- data/lib/faqieh/models/speaker_countries_inner.rb +202 -0
- data/lib/faqieh/models/transcript_detail.rb +297 -0
- data/lib/faqieh/models/transcript_search_result.rb +396 -0
- data/lib/faqieh/models/transcript_segment.rb +222 -0
- data/lib/faqieh/models/transcript_summary.rb +226 -0
- data/lib/faqieh/version.rb +15 -0
- data/lib/faqieh.rb +75 -0
- data/spec/spec_helper.rb +111 -0
- metadata +191 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Faqieh Public API
|
|
3
|
+
|
|
4
|
+
#Public, read-only JSON API for browsing Faqieh's catalog of speakers, channels, playlists, media, and transcripts. Resource responses are JSON wrapped in a `{ \"data\": ... }` envelope. Collections additionally include a `pagination` object and RFC 5988 `Link` headers. Transcript downloads return files, errors use an `{ \"error\": ... }` envelope, and a PDF that is still being prepared returns a JSON `status` object. No authentication is required. Requests are rate limited per IP address: 300 per minute per controller (list/detail share an allowance), with these additional operation limits: - 60 searches per minute, shared across `/search`, catalog `q` searches, transcript searches and the equivalent MCP tools. - 60 paginated transcript reads per minute, shared with MCP `get_transcript`. - 10 exports per minute, shared across `full=true` and TXT/SRT/PDF downloads, regardless of media ID, language or format. With `q`, transcript search takes precedence over `full=true` and uses the search/read allowances. Rate-limit responses include `Retry-After: 60`. ## Conventions - **Pagination:** `?page=` and `?per_page=` (max 100). Search-mode requests (any request with `q`) serve at most 100 pages: deeper `page` values are clamped to 100, and `next_page` / `Link rel=\"next\"` stop at that boundary. Iterate with `next_page` or the `Link` header rather than a self-incremented counter. - **Search:** `?q=` (minimum 3 characters) on each collection, plus the cross-type `/search` endpoint. - **Partial response:** `?fields=a,b` returns only the listed attributes (`id` is always included). - **Embedding:** `?embed=speakers,channels` inlines related resources. - **Resource URLs:** `url` links to the localized Faqieh webpage for speakers, channels, playlists, and media. Channels, playlists, and media also expose `source_url` for the original source; it equals `url` when `platform` is `faqieh`. Clients that used `url` for the source should use `source_url`. Transcript summaries and details include the recording's webpage `url`; transcript segments and transcript search hits include a timestamped `url` pointing to the recording at the segment's start time. - **Localization:** `?locale=ar|en` or the `Accept-Language` header (default `ar`); affects labels and webpage URLs, not search relevance.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Faqieh
|
|
17
|
+
class TranscriptDetail < ApiModelBase
|
|
18
|
+
attr_accessor :language
|
|
19
|
+
|
|
20
|
+
attr_accessor :medium_id
|
|
21
|
+
|
|
22
|
+
# Localized Faqieh webpage URL for the recording containing this transcript.
|
|
23
|
+
attr_accessor :url
|
|
24
|
+
|
|
25
|
+
attr_accessor :segments_count
|
|
26
|
+
|
|
27
|
+
attr_accessor :download_urls
|
|
28
|
+
|
|
29
|
+
attr_accessor :segments
|
|
30
|
+
|
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
|
+
def self.attribute_map
|
|
33
|
+
{
|
|
34
|
+
:'language' => :'language',
|
|
35
|
+
:'medium_id' => :'medium_id',
|
|
36
|
+
:'url' => :'url',
|
|
37
|
+
:'segments_count' => :'segments_count',
|
|
38
|
+
:'download_urls' => :'download_urls',
|
|
39
|
+
:'segments' => :'segments'
|
|
40
|
+
}
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Returns attribute mapping this model knows about
|
|
44
|
+
def self.acceptable_attribute_map
|
|
45
|
+
attribute_map
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Returns all the JSON keys this model knows about
|
|
49
|
+
def self.acceptable_attributes
|
|
50
|
+
acceptable_attribute_map.values
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Attribute type mapping.
|
|
54
|
+
def self.openapi_types
|
|
55
|
+
{
|
|
56
|
+
:'language' => :'String',
|
|
57
|
+
:'medium_id' => :'Integer',
|
|
58
|
+
:'url' => :'String',
|
|
59
|
+
:'segments_count' => :'Integer',
|
|
60
|
+
:'download_urls' => :'DownloadUrls',
|
|
61
|
+
:'segments' => :'Array<TranscriptSegment>'
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# List of attributes with nullable: true
|
|
66
|
+
def self.openapi_nullable
|
|
67
|
+
Set.new([
|
|
68
|
+
])
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Initializes the object
|
|
72
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
73
|
+
def initialize(attributes = {})
|
|
74
|
+
if (!attributes.is_a?(Hash))
|
|
75
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Faqieh::TranscriptDetail` initialize method"
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
79
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
80
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
81
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
82
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Faqieh::TranscriptDetail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
83
|
+
end
|
|
84
|
+
h[k.to_sym] = v
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'language')
|
|
88
|
+
self.language = attributes[:'language']
|
|
89
|
+
else
|
|
90
|
+
self.language = nil
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:'medium_id')
|
|
94
|
+
self.medium_id = attributes[:'medium_id']
|
|
95
|
+
else
|
|
96
|
+
self.medium_id = nil
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'url')
|
|
100
|
+
self.url = attributes[:'url']
|
|
101
|
+
else
|
|
102
|
+
self.url = nil
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'segments_count')
|
|
106
|
+
self.segments_count = attributes[:'segments_count']
|
|
107
|
+
else
|
|
108
|
+
self.segments_count = nil
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'download_urls')
|
|
112
|
+
self.download_urls = attributes[:'download_urls']
|
|
113
|
+
else
|
|
114
|
+
self.download_urls = nil
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if attributes.key?(:'segments')
|
|
118
|
+
if (value = attributes[:'segments']).is_a?(Array)
|
|
119
|
+
self.segments = value
|
|
120
|
+
end
|
|
121
|
+
else
|
|
122
|
+
self.segments = nil
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
127
|
+
# @return Array for valid properties with the reasons
|
|
128
|
+
def list_invalid_properties
|
|
129
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
130
|
+
invalid_properties = Array.new
|
|
131
|
+
if @language.nil?
|
|
132
|
+
invalid_properties.push('invalid value for "language", language cannot be nil.')
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if @medium_id.nil?
|
|
136
|
+
invalid_properties.push('invalid value for "medium_id", medium_id cannot be nil.')
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if @url.nil?
|
|
140
|
+
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if @segments_count.nil?
|
|
144
|
+
invalid_properties.push('invalid value for "segments_count", segments_count cannot be nil.')
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if @download_urls.nil?
|
|
148
|
+
invalid_properties.push('invalid value for "download_urls", download_urls cannot be nil.')
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if @segments.nil?
|
|
152
|
+
invalid_properties.push('invalid value for "segments", segments cannot be nil.')
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
invalid_properties
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Check to see if the all the properties in the model are valid
|
|
159
|
+
# @return true if the model is valid
|
|
160
|
+
def valid?
|
|
161
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
162
|
+
return false if @language.nil?
|
|
163
|
+
return false if @medium_id.nil?
|
|
164
|
+
return false if @url.nil?
|
|
165
|
+
return false if @segments_count.nil?
|
|
166
|
+
return false if @download_urls.nil?
|
|
167
|
+
return false if @segments.nil?
|
|
168
|
+
true
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Custom attribute writer method with validation
|
|
172
|
+
# @param [Object] language Value to be assigned
|
|
173
|
+
def language=(language)
|
|
174
|
+
if language.nil?
|
|
175
|
+
fail ArgumentError, 'language cannot be nil'
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
@language = language
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Custom attribute writer method with validation
|
|
182
|
+
# @param [Object] medium_id Value to be assigned
|
|
183
|
+
def medium_id=(medium_id)
|
|
184
|
+
if medium_id.nil?
|
|
185
|
+
fail ArgumentError, 'medium_id cannot be nil'
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
@medium_id = medium_id
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Custom attribute writer method with validation
|
|
192
|
+
# @param [Object] url Value to be assigned
|
|
193
|
+
def url=(url)
|
|
194
|
+
if url.nil?
|
|
195
|
+
fail ArgumentError, 'url cannot be nil'
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
@url = url
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Custom attribute writer method with validation
|
|
202
|
+
# @param [Object] segments_count Value to be assigned
|
|
203
|
+
def segments_count=(segments_count)
|
|
204
|
+
if segments_count.nil?
|
|
205
|
+
fail ArgumentError, 'segments_count cannot be nil'
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
@segments_count = segments_count
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Custom attribute writer method with validation
|
|
212
|
+
# @param [Object] download_urls Value to be assigned
|
|
213
|
+
def download_urls=(download_urls)
|
|
214
|
+
if download_urls.nil?
|
|
215
|
+
fail ArgumentError, 'download_urls cannot be nil'
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
@download_urls = download_urls
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Custom attribute writer method with validation
|
|
222
|
+
# @param [Object] segments Value to be assigned
|
|
223
|
+
def segments=(segments)
|
|
224
|
+
if segments.nil?
|
|
225
|
+
fail ArgumentError, 'segments cannot be nil'
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
@segments = segments
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Checks equality by comparing each attribute.
|
|
232
|
+
# @param [Object] Object to be compared
|
|
233
|
+
def ==(o)
|
|
234
|
+
return true if self.equal?(o)
|
|
235
|
+
self.class == o.class &&
|
|
236
|
+
language == o.language &&
|
|
237
|
+
medium_id == o.medium_id &&
|
|
238
|
+
url == o.url &&
|
|
239
|
+
segments_count == o.segments_count &&
|
|
240
|
+
download_urls == o.download_urls &&
|
|
241
|
+
segments == o.segments
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
# @see the `==` method
|
|
245
|
+
# @param [Object] Object to be compared
|
|
246
|
+
def eql?(o)
|
|
247
|
+
self == o
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Calculates hash code according to all attributes.
|
|
251
|
+
# @return [Integer] Hash code
|
|
252
|
+
def hash
|
|
253
|
+
[language, medium_id, url, segments_count, download_urls, segments].hash
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
# Builds the object from hash
|
|
257
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
258
|
+
# @return [Object] Returns the model itself
|
|
259
|
+
def self.build_from_hash(attributes)
|
|
260
|
+
return nil unless attributes.is_a?(Hash)
|
|
261
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
262
|
+
transformed_hash = {}
|
|
263
|
+
openapi_types.each_pair do |key, type|
|
|
264
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
265
|
+
transformed_hash["#{key}"] = nil
|
|
266
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
267
|
+
# check to ensure the input is an array given that the attribute
|
|
268
|
+
# is documented as an array but the input is not
|
|
269
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
270
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
271
|
+
end
|
|
272
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
273
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
274
|
+
end
|
|
275
|
+
end
|
|
276
|
+
new(transformed_hash)
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
# Returns the object in the form of hash
|
|
280
|
+
# @return [Hash] Returns the object in the form of hash
|
|
281
|
+
def to_hash
|
|
282
|
+
hash = {}
|
|
283
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
284
|
+
value = self.send(attr)
|
|
285
|
+
if value.nil?
|
|
286
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
287
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
hash[param] = _to_hash(value)
|
|
291
|
+
end
|
|
292
|
+
hash
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
end
|
|
296
|
+
|
|
297
|
+
end
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Faqieh Public API
|
|
3
|
+
|
|
4
|
+
#Public, read-only JSON API for browsing Faqieh's catalog of speakers, channels, playlists, media, and transcripts. Resource responses are JSON wrapped in a `{ \"data\": ... }` envelope. Collections additionally include a `pagination` object and RFC 5988 `Link` headers. Transcript downloads return files, errors use an `{ \"error\": ... }` envelope, and a PDF that is still being prepared returns a JSON `status` object. No authentication is required. Requests are rate limited per IP address: 300 per minute per controller (list/detail share an allowance), with these additional operation limits: - 60 searches per minute, shared across `/search`, catalog `q` searches, transcript searches and the equivalent MCP tools. - 60 paginated transcript reads per minute, shared with MCP `get_transcript`. - 10 exports per minute, shared across `full=true` and TXT/SRT/PDF downloads, regardless of media ID, language or format. With `q`, transcript search takes precedence over `full=true` and uses the search/read allowances. Rate-limit responses include `Retry-After: 60`. ## Conventions - **Pagination:** `?page=` and `?per_page=` (max 100). Search-mode requests (any request with `q`) serve at most 100 pages: deeper `page` values are clamped to 100, and `next_page` / `Link rel=\"next\"` stop at that boundary. Iterate with `next_page` or the `Link` header rather than a self-incremented counter. - **Search:** `?q=` (minimum 3 characters) on each collection, plus the cross-type `/search` endpoint. - **Partial response:** `?fields=a,b` returns only the listed attributes (`id` is always included). - **Embedding:** `?embed=speakers,channels` inlines related resources. - **Resource URLs:** `url` links to the localized Faqieh webpage for speakers, channels, playlists, and media. Channels, playlists, and media also expose `source_url` for the original source; it equals `url` when `platform` is `faqieh`. Clients that used `url` for the source should use `source_url`. Transcript summaries and details include the recording's webpage `url`; transcript segments and transcript search hits include a timestamped `url` pointing to the recording at the segment's start time. - **Localization:** `?locale=ar|en` or the `Accept-Language` header (default `ar`); affects labels and webpage URLs, not search relevance.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Faqieh
|
|
17
|
+
# Segment hit returned by the global /search endpoint when types includes `transcripts`. Carries enough context (`medium_id`, `medium_title`, `medium_url`, `transcript_id`, `language`, `transcript_url`) for a client to navigate back to the medium or fetch the surrounding transcript. Use `url` for a timestamped Faqieh webpage link; `medium_url` and `transcript_url` are API endpoints.
|
|
18
|
+
class TranscriptSearchResult < ApiModelBase
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# Localized Faqieh webpage URL with t set to the segment's start time in seconds.
|
|
22
|
+
attr_accessor :url
|
|
23
|
+
|
|
24
|
+
attr_accessor :content
|
|
25
|
+
|
|
26
|
+
# Content with `<mark>` tags around query matches, as rendered by the web UI. Null when the segment is not part of a search result (for example plain transcript listings).
|
|
27
|
+
attr_accessor :highlighted_content
|
|
28
|
+
|
|
29
|
+
attr_accessor :start_time
|
|
30
|
+
|
|
31
|
+
attr_accessor :end_time
|
|
32
|
+
|
|
33
|
+
attr_accessor :formatted_timestamp
|
|
34
|
+
|
|
35
|
+
attr_accessor :transcript_id
|
|
36
|
+
|
|
37
|
+
attr_accessor :language
|
|
38
|
+
|
|
39
|
+
attr_accessor :medium_id
|
|
40
|
+
|
|
41
|
+
attr_accessor :medium_title
|
|
42
|
+
|
|
43
|
+
attr_accessor :medium_url
|
|
44
|
+
|
|
45
|
+
attr_accessor :transcript_url
|
|
46
|
+
|
|
47
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
48
|
+
def self.attribute_map
|
|
49
|
+
{
|
|
50
|
+
:'id' => :'id',
|
|
51
|
+
:'url' => :'url',
|
|
52
|
+
:'content' => :'content',
|
|
53
|
+
:'highlighted_content' => :'highlighted_content',
|
|
54
|
+
:'start_time' => :'start_time',
|
|
55
|
+
:'end_time' => :'end_time',
|
|
56
|
+
:'formatted_timestamp' => :'formatted_timestamp',
|
|
57
|
+
:'transcript_id' => :'transcript_id',
|
|
58
|
+
:'language' => :'language',
|
|
59
|
+
:'medium_id' => :'medium_id',
|
|
60
|
+
:'medium_title' => :'medium_title',
|
|
61
|
+
:'medium_url' => :'medium_url',
|
|
62
|
+
:'transcript_url' => :'transcript_url'
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Returns attribute mapping this model knows about
|
|
67
|
+
def self.acceptable_attribute_map
|
|
68
|
+
attribute_map
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Returns all the JSON keys this model knows about
|
|
72
|
+
def self.acceptable_attributes
|
|
73
|
+
acceptable_attribute_map.values
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Attribute type mapping.
|
|
77
|
+
def self.openapi_types
|
|
78
|
+
{
|
|
79
|
+
:'id' => :'Integer',
|
|
80
|
+
:'url' => :'String',
|
|
81
|
+
:'content' => :'String',
|
|
82
|
+
:'highlighted_content' => :'String',
|
|
83
|
+
:'start_time' => :'Float',
|
|
84
|
+
:'end_time' => :'Float',
|
|
85
|
+
:'formatted_timestamp' => :'String',
|
|
86
|
+
:'transcript_id' => :'Integer',
|
|
87
|
+
:'language' => :'String',
|
|
88
|
+
:'medium_id' => :'Integer',
|
|
89
|
+
:'medium_title' => :'String',
|
|
90
|
+
:'medium_url' => :'String',
|
|
91
|
+
:'transcript_url' => :'String'
|
|
92
|
+
}
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# List of attributes with nullable: true
|
|
96
|
+
def self.openapi_nullable
|
|
97
|
+
Set.new([
|
|
98
|
+
:'content',
|
|
99
|
+
:'highlighted_content',
|
|
100
|
+
])
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Initializes the object
|
|
104
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
105
|
+
def initialize(attributes = {})
|
|
106
|
+
if (!attributes.is_a?(Hash))
|
|
107
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Faqieh::TranscriptSearchResult` initialize method"
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
111
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
112
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
113
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
114
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Faqieh::TranscriptSearchResult`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
115
|
+
end
|
|
116
|
+
h[k.to_sym] = v
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if attributes.key?(:'id')
|
|
120
|
+
self.id = attributes[:'id']
|
|
121
|
+
else
|
|
122
|
+
self.id = nil
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if attributes.key?(:'url')
|
|
126
|
+
self.url = attributes[:'url']
|
|
127
|
+
else
|
|
128
|
+
self.url = nil
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if attributes.key?(:'content')
|
|
132
|
+
self.content = attributes[:'content']
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if attributes.key?(:'highlighted_content')
|
|
136
|
+
self.highlighted_content = attributes[:'highlighted_content']
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
if attributes.key?(:'start_time')
|
|
140
|
+
self.start_time = attributes[:'start_time']
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if attributes.key?(:'end_time')
|
|
144
|
+
self.end_time = attributes[:'end_time']
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.key?(:'formatted_timestamp')
|
|
148
|
+
self.formatted_timestamp = attributes[:'formatted_timestamp']
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if attributes.key?(:'transcript_id')
|
|
152
|
+
self.transcript_id = attributes[:'transcript_id']
|
|
153
|
+
else
|
|
154
|
+
self.transcript_id = nil
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
if attributes.key?(:'language')
|
|
158
|
+
self.language = attributes[:'language']
|
|
159
|
+
else
|
|
160
|
+
self.language = nil
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
if attributes.key?(:'medium_id')
|
|
164
|
+
self.medium_id = attributes[:'medium_id']
|
|
165
|
+
else
|
|
166
|
+
self.medium_id = nil
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if attributes.key?(:'medium_title')
|
|
170
|
+
self.medium_title = attributes[:'medium_title']
|
|
171
|
+
else
|
|
172
|
+
self.medium_title = nil
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
if attributes.key?(:'medium_url')
|
|
176
|
+
self.medium_url = attributes[:'medium_url']
|
|
177
|
+
else
|
|
178
|
+
self.medium_url = nil
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
if attributes.key?(:'transcript_url')
|
|
182
|
+
self.transcript_url = attributes[:'transcript_url']
|
|
183
|
+
else
|
|
184
|
+
self.transcript_url = nil
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
189
|
+
# @return Array for valid properties with the reasons
|
|
190
|
+
def list_invalid_properties
|
|
191
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
192
|
+
invalid_properties = Array.new
|
|
193
|
+
if @id.nil?
|
|
194
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
if @url.nil?
|
|
198
|
+
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
if @transcript_id.nil?
|
|
202
|
+
invalid_properties.push('invalid value for "transcript_id", transcript_id cannot be nil.')
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
if @language.nil?
|
|
206
|
+
invalid_properties.push('invalid value for "language", language cannot be nil.')
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
if @medium_id.nil?
|
|
210
|
+
invalid_properties.push('invalid value for "medium_id", medium_id cannot be nil.')
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
if @medium_title.nil?
|
|
214
|
+
invalid_properties.push('invalid value for "medium_title", medium_title cannot be nil.')
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
if @medium_url.nil?
|
|
218
|
+
invalid_properties.push('invalid value for "medium_url", medium_url cannot be nil.')
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
if @transcript_url.nil?
|
|
222
|
+
invalid_properties.push('invalid value for "transcript_url", transcript_url cannot be nil.')
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
invalid_properties
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Check to see if the all the properties in the model are valid
|
|
229
|
+
# @return true if the model is valid
|
|
230
|
+
def valid?
|
|
231
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
232
|
+
return false if @id.nil?
|
|
233
|
+
return false if @url.nil?
|
|
234
|
+
return false if @transcript_id.nil?
|
|
235
|
+
return false if @language.nil?
|
|
236
|
+
return false if @medium_id.nil?
|
|
237
|
+
return false if @medium_title.nil?
|
|
238
|
+
return false if @medium_url.nil?
|
|
239
|
+
return false if @transcript_url.nil?
|
|
240
|
+
true
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# Custom attribute writer method with validation
|
|
244
|
+
# @param [Object] id Value to be assigned
|
|
245
|
+
def id=(id)
|
|
246
|
+
if id.nil?
|
|
247
|
+
fail ArgumentError, 'id cannot be nil'
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
@id = id
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
# Custom attribute writer method with validation
|
|
254
|
+
# @param [Object] url Value to be assigned
|
|
255
|
+
def url=(url)
|
|
256
|
+
if url.nil?
|
|
257
|
+
fail ArgumentError, 'url cannot be nil'
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
@url = url
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
# Custom attribute writer method with validation
|
|
264
|
+
# @param [Object] transcript_id Value to be assigned
|
|
265
|
+
def transcript_id=(transcript_id)
|
|
266
|
+
if transcript_id.nil?
|
|
267
|
+
fail ArgumentError, 'transcript_id cannot be nil'
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
@transcript_id = transcript_id
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
# Custom attribute writer method with validation
|
|
274
|
+
# @param [Object] language Value to be assigned
|
|
275
|
+
def language=(language)
|
|
276
|
+
if language.nil?
|
|
277
|
+
fail ArgumentError, 'language cannot be nil'
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
@language = language
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
# Custom attribute writer method with validation
|
|
284
|
+
# @param [Object] medium_id Value to be assigned
|
|
285
|
+
def medium_id=(medium_id)
|
|
286
|
+
if medium_id.nil?
|
|
287
|
+
fail ArgumentError, 'medium_id cannot be nil'
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
@medium_id = medium_id
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# Custom attribute writer method with validation
|
|
294
|
+
# @param [Object] medium_title Value to be assigned
|
|
295
|
+
def medium_title=(medium_title)
|
|
296
|
+
if medium_title.nil?
|
|
297
|
+
fail ArgumentError, 'medium_title cannot be nil'
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
@medium_title = medium_title
|
|
301
|
+
end
|
|
302
|
+
|
|
303
|
+
# Custom attribute writer method with validation
|
|
304
|
+
# @param [Object] medium_url Value to be assigned
|
|
305
|
+
def medium_url=(medium_url)
|
|
306
|
+
if medium_url.nil?
|
|
307
|
+
fail ArgumentError, 'medium_url cannot be nil'
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
@medium_url = medium_url
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
# Custom attribute writer method with validation
|
|
314
|
+
# @param [Object] transcript_url Value to be assigned
|
|
315
|
+
def transcript_url=(transcript_url)
|
|
316
|
+
if transcript_url.nil?
|
|
317
|
+
fail ArgumentError, 'transcript_url cannot be nil'
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
@transcript_url = transcript_url
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
# Checks equality by comparing each attribute.
|
|
324
|
+
# @param [Object] Object to be compared
|
|
325
|
+
def ==(o)
|
|
326
|
+
return true if self.equal?(o)
|
|
327
|
+
self.class == o.class &&
|
|
328
|
+
id == o.id &&
|
|
329
|
+
url == o.url &&
|
|
330
|
+
content == o.content &&
|
|
331
|
+
highlighted_content == o.highlighted_content &&
|
|
332
|
+
start_time == o.start_time &&
|
|
333
|
+
end_time == o.end_time &&
|
|
334
|
+
formatted_timestamp == o.formatted_timestamp &&
|
|
335
|
+
transcript_id == o.transcript_id &&
|
|
336
|
+
language == o.language &&
|
|
337
|
+
medium_id == o.medium_id &&
|
|
338
|
+
medium_title == o.medium_title &&
|
|
339
|
+
medium_url == o.medium_url &&
|
|
340
|
+
transcript_url == o.transcript_url
|
|
341
|
+
end
|
|
342
|
+
|
|
343
|
+
# @see the `==` method
|
|
344
|
+
# @param [Object] Object to be compared
|
|
345
|
+
def eql?(o)
|
|
346
|
+
self == o
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
# Calculates hash code according to all attributes.
|
|
350
|
+
# @return [Integer] Hash code
|
|
351
|
+
def hash
|
|
352
|
+
[id, url, content, highlighted_content, start_time, end_time, formatted_timestamp, transcript_id, language, medium_id, medium_title, medium_url, transcript_url].hash
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
# Builds the object from hash
|
|
356
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
357
|
+
# @return [Object] Returns the model itself
|
|
358
|
+
def self.build_from_hash(attributes)
|
|
359
|
+
return nil unless attributes.is_a?(Hash)
|
|
360
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
361
|
+
transformed_hash = {}
|
|
362
|
+
openapi_types.each_pair do |key, type|
|
|
363
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
364
|
+
transformed_hash["#{key}"] = nil
|
|
365
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
366
|
+
# check to ensure the input is an array given that the attribute
|
|
367
|
+
# is documented as an array but the input is not
|
|
368
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
369
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
370
|
+
end
|
|
371
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
372
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
373
|
+
end
|
|
374
|
+
end
|
|
375
|
+
new(transformed_hash)
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
# Returns the object in the form of hash
|
|
379
|
+
# @return [Hash] Returns the object in the form of hash
|
|
380
|
+
def to_hash
|
|
381
|
+
hash = {}
|
|
382
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
383
|
+
value = self.send(attr)
|
|
384
|
+
if value.nil?
|
|
385
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
386
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
387
|
+
end
|
|
388
|
+
|
|
389
|
+
hash[param] = _to_hash(value)
|
|
390
|
+
end
|
|
391
|
+
hash
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
end
|