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.
Files changed (84) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/LICENSE +21 -0
  4. data/README.md +173 -0
  5. data/Rakefile +10 -0
  6. data/docs/Channel.md +50 -0
  7. data/docs/ChannelsApi.md +155 -0
  8. data/docs/DownloadTranscript202Response.md +18 -0
  9. data/docs/DownloadUrls.md +22 -0
  10. data/docs/Error.md +18 -0
  11. data/docs/ErrorError.md +24 -0
  12. data/docs/FacetOption.md +22 -0
  13. data/docs/GetChannel200Response.md +18 -0
  14. data/docs/GetMedium200Response.md +18 -0
  15. data/docs/GetPlaylist200Response.md +18 -0
  16. data/docs/GetSpeaker200Response.md +18 -0
  17. data/docs/GetTranscript200Response.md +20 -0
  18. data/docs/ListChannels200Response.md +20 -0
  19. data/docs/ListMedia200Response.md +20 -0
  20. data/docs/ListPlaylists200Response.md +20 -0
  21. data/docs/ListSpeakers200Response.md +20 -0
  22. data/docs/ListTranscripts200Response.md +18 -0
  23. data/docs/MediaApi.md +161 -0
  24. data/docs/Medium.md +64 -0
  25. data/docs/Pagination.md +28 -0
  26. data/docs/Platform.md +15 -0
  27. data/docs/Playlist.md +54 -0
  28. data/docs/PlaylistsApi.md +159 -0
  29. data/docs/Search200Response.md +20 -0
  30. data/docs/SearchApi.md +96 -0
  31. data/docs/SearchSection.md +22 -0
  32. data/docs/SearchSectionFacets.md +22 -0
  33. data/docs/Speaker.md +40 -0
  34. data/docs/SpeakerCountriesInner.md +20 -0
  35. data/docs/SpeakersApi.md +155 -0
  36. data/docs/TranscriptDetail.md +28 -0
  37. data/docs/TranscriptSearchResult.md +42 -0
  38. data/docs/TranscriptSegment.md +30 -0
  39. data/docs/TranscriptSummary.md +24 -0
  40. data/docs/TranscriptsApi.md +222 -0
  41. data/faqieh.gemspec +41 -0
  42. data/lib/faqieh/api/channels_api.rb +192 -0
  43. data/lib/faqieh/api/media_api.rb +200 -0
  44. data/lib/faqieh/api/playlists_api.rb +198 -0
  45. data/lib/faqieh/api/search_api.rb +159 -0
  46. data/lib/faqieh/api/speakers_api.rb +192 -0
  47. data/lib/faqieh/api/transcripts_api.rb +280 -0
  48. data/lib/faqieh/api_client.rb +441 -0
  49. data/lib/faqieh/api_error.rb +58 -0
  50. data/lib/faqieh/api_model_base.rb +88 -0
  51. data/lib/faqieh/configuration.rb +385 -0
  52. data/lib/faqieh/models/channel.rb +340 -0
  53. data/lib/faqieh/models/download_transcript202_response.rb +188 -0
  54. data/lib/faqieh/models/download_urls.rb +216 -0
  55. data/lib/faqieh/models/error.rb +164 -0
  56. data/lib/faqieh/models/error_error.rb +243 -0
  57. data/lib/faqieh/models/facet_option.rb +216 -0
  58. data/lib/faqieh/models/get_channel200_response.rb +164 -0
  59. data/lib/faqieh/models/get_medium200_response.rb +164 -0
  60. data/lib/faqieh/models/get_playlist200_response.rb +164 -0
  61. data/lib/faqieh/models/get_speaker200_response.rb +164 -0
  62. data/lib/faqieh/models/get_transcript200_response.rb +173 -0
  63. data/lib/faqieh/models/list_channels200_response.rb +192 -0
  64. data/lib/faqieh/models/list_media200_response.rb +192 -0
  65. data/lib/faqieh/models/list_playlists200_response.rb +192 -0
  66. data/lib/faqieh/models/list_speakers200_response.rb +192 -0
  67. data/lib/faqieh/models/list_transcripts200_response.rb +166 -0
  68. data/lib/faqieh/models/medium.rb +412 -0
  69. data/lib/faqieh/models/pagination.rb +195 -0
  70. data/lib/faqieh/models/platform.rb +40 -0
  71. data/lib/faqieh/models/playlist.rb +361 -0
  72. data/lib/faqieh/models/search200_response.rb +192 -0
  73. data/lib/faqieh/models/search_section.rb +187 -0
  74. data/lib/faqieh/models/search_section_facets.rb +243 -0
  75. data/lib/faqieh/models/speaker.rb +275 -0
  76. data/lib/faqieh/models/speaker_countries_inner.rb +202 -0
  77. data/lib/faqieh/models/transcript_detail.rb +297 -0
  78. data/lib/faqieh/models/transcript_search_result.rb +396 -0
  79. data/lib/faqieh/models/transcript_segment.rb +222 -0
  80. data/lib/faqieh/models/transcript_summary.rb +226 -0
  81. data/lib/faqieh/version.rb +15 -0
  82. data/lib/faqieh.rb +75 -0
  83. data/spec/spec_helper.rb +111 -0
  84. metadata +191 -0
@@ -0,0 +1,412 @@
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 Medium < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :title
21
+
22
+ attr_accessor :description
23
+
24
+ attr_accessor :platform
25
+
26
+ attr_accessor :platform_id
27
+
28
+ attr_accessor :audio_url
29
+
30
+ attr_accessor :duration
31
+
32
+ attr_accessor :published_at
33
+
34
+ attr_accessor :source_available
35
+
36
+ attr_accessor :source_unavailable_at
37
+
38
+ attr_accessor :speakers_count
39
+
40
+ attr_accessor :channels_count
41
+
42
+ attr_accessor :playlists_count
43
+
44
+ attr_accessor :platform_label
45
+
46
+ # Localized Faqieh webpage URL for this recording.
47
+ attr_accessor :url
48
+
49
+ # Original source URL; equals url when platform is faqieh.
50
+ attr_accessor :source_url
51
+
52
+ attr_accessor :duration_label
53
+
54
+ attr_accessor :has_audio
55
+
56
+ attr_accessor :has_transcript
57
+
58
+ attr_accessor :thumbnail_urls
59
+
60
+ attr_accessor :transcripts
61
+
62
+ attr_accessor :speakers
63
+
64
+ attr_accessor :channels
65
+
66
+ attr_accessor :playlists
67
+
68
+ class EnumAttributeValidator
69
+ attr_reader :datatype
70
+ attr_reader :allowable_values
71
+
72
+ def initialize(datatype, allowable_values)
73
+ @allowable_values = allowable_values.map do |value|
74
+ case datatype.to_s
75
+ when /Integer/i
76
+ value.to_i
77
+ when /Float/i
78
+ value.to_f
79
+ else
80
+ value
81
+ end
82
+ end
83
+ end
84
+
85
+ def valid?(value)
86
+ !value || allowable_values.include?(value)
87
+ end
88
+ end
89
+
90
+ # Attribute mapping from ruby-style variable name to JSON key.
91
+ def self.attribute_map
92
+ {
93
+ :'id' => :'id',
94
+ :'title' => :'title',
95
+ :'description' => :'description',
96
+ :'platform' => :'platform',
97
+ :'platform_id' => :'platform_id',
98
+ :'audio_url' => :'audio_url',
99
+ :'duration' => :'duration',
100
+ :'published_at' => :'published_at',
101
+ :'source_available' => :'source_available',
102
+ :'source_unavailable_at' => :'source_unavailable_at',
103
+ :'speakers_count' => :'speakers_count',
104
+ :'channels_count' => :'channels_count',
105
+ :'playlists_count' => :'playlists_count',
106
+ :'platform_label' => :'platform_label',
107
+ :'url' => :'url',
108
+ :'source_url' => :'source_url',
109
+ :'duration_label' => :'duration_label',
110
+ :'has_audio' => :'has_audio',
111
+ :'has_transcript' => :'has_transcript',
112
+ :'thumbnail_urls' => :'thumbnail_urls',
113
+ :'transcripts' => :'transcripts',
114
+ :'speakers' => :'speakers',
115
+ :'channels' => :'channels',
116
+ :'playlists' => :'playlists'
117
+ }
118
+ end
119
+
120
+ # Returns attribute mapping this model knows about
121
+ def self.acceptable_attribute_map
122
+ attribute_map
123
+ end
124
+
125
+ # Returns all the JSON keys this model knows about
126
+ def self.acceptable_attributes
127
+ acceptable_attribute_map.values
128
+ end
129
+
130
+ # Attribute type mapping.
131
+ def self.openapi_types
132
+ {
133
+ :'id' => :'Integer',
134
+ :'title' => :'String',
135
+ :'description' => :'String',
136
+ :'platform' => :'Platform',
137
+ :'platform_id' => :'String',
138
+ :'audio_url' => :'String',
139
+ :'duration' => :'Integer',
140
+ :'published_at' => :'Time',
141
+ :'source_available' => :'Boolean',
142
+ :'source_unavailable_at' => :'Time',
143
+ :'speakers_count' => :'Integer',
144
+ :'channels_count' => :'Integer',
145
+ :'playlists_count' => :'Integer',
146
+ :'platform_label' => :'String',
147
+ :'url' => :'String',
148
+ :'source_url' => :'String',
149
+ :'duration_label' => :'String',
150
+ :'has_audio' => :'Boolean',
151
+ :'has_transcript' => :'Boolean',
152
+ :'thumbnail_urls' => :'Hash<String, String>',
153
+ :'transcripts' => :'Array<TranscriptSummary>',
154
+ :'speakers' => :'Array<Speaker>',
155
+ :'channels' => :'Array<Channel>',
156
+ :'playlists' => :'Array<Playlist>'
157
+ }
158
+ end
159
+
160
+ # List of attributes with nullable: true
161
+ def self.openapi_nullable
162
+ Set.new([
163
+ :'description',
164
+ :'audio_url',
165
+ :'duration',
166
+ :'published_at',
167
+ :'source_unavailable_at',
168
+ :'duration_label',
169
+ :'thumbnail_urls',
170
+ ])
171
+ end
172
+
173
+ # Initializes the object
174
+ # @param [Hash] attributes Model attributes in the form of hash
175
+ def initialize(attributes = {})
176
+ if (!attributes.is_a?(Hash))
177
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Faqieh::Medium` initialize method"
178
+ end
179
+
180
+ # check to see if the attribute exists and convert string to symbol for hash key
181
+ acceptable_attribute_map = self.class.acceptable_attribute_map
182
+ attributes = attributes.each_with_object({}) { |(k, v), h|
183
+ if (!acceptable_attribute_map.key?(k.to_sym))
184
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Faqieh::Medium`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
185
+ end
186
+ h[k.to_sym] = v
187
+ }
188
+
189
+ if attributes.key?(:'id')
190
+ self.id = attributes[:'id']
191
+ else
192
+ self.id = nil
193
+ end
194
+
195
+ if attributes.key?(:'title')
196
+ self.title = attributes[:'title']
197
+ end
198
+
199
+ if attributes.key?(:'description')
200
+ self.description = attributes[:'description']
201
+ end
202
+
203
+ if attributes.key?(:'platform')
204
+ self.platform = attributes[:'platform']
205
+ end
206
+
207
+ if attributes.key?(:'platform_id')
208
+ self.platform_id = attributes[:'platform_id']
209
+ end
210
+
211
+ if attributes.key?(:'audio_url')
212
+ self.audio_url = attributes[:'audio_url']
213
+ end
214
+
215
+ if attributes.key?(:'duration')
216
+ self.duration = attributes[:'duration']
217
+ end
218
+
219
+ if attributes.key?(:'published_at')
220
+ self.published_at = attributes[:'published_at']
221
+ end
222
+
223
+ if attributes.key?(:'source_available')
224
+ self.source_available = attributes[:'source_available']
225
+ end
226
+
227
+ if attributes.key?(:'source_unavailable_at')
228
+ self.source_unavailable_at = attributes[:'source_unavailable_at']
229
+ end
230
+
231
+ if attributes.key?(:'speakers_count')
232
+ self.speakers_count = attributes[:'speakers_count']
233
+ end
234
+
235
+ if attributes.key?(:'channels_count')
236
+ self.channels_count = attributes[:'channels_count']
237
+ end
238
+
239
+ if attributes.key?(:'playlists_count')
240
+ self.playlists_count = attributes[:'playlists_count']
241
+ end
242
+
243
+ if attributes.key?(:'platform_label')
244
+ self.platform_label = attributes[:'platform_label']
245
+ end
246
+
247
+ if attributes.key?(:'url')
248
+ self.url = attributes[:'url']
249
+ end
250
+
251
+ if attributes.key?(:'source_url')
252
+ self.source_url = attributes[:'source_url']
253
+ end
254
+
255
+ if attributes.key?(:'duration_label')
256
+ self.duration_label = attributes[:'duration_label']
257
+ end
258
+
259
+ if attributes.key?(:'has_audio')
260
+ self.has_audio = attributes[:'has_audio']
261
+ end
262
+
263
+ if attributes.key?(:'has_transcript')
264
+ self.has_transcript = attributes[:'has_transcript']
265
+ end
266
+
267
+ if attributes.key?(:'thumbnail_urls')
268
+ if (value = attributes[:'thumbnail_urls']).is_a?(Hash)
269
+ self.thumbnail_urls = value
270
+ end
271
+ end
272
+
273
+ if attributes.key?(:'transcripts')
274
+ if (value = attributes[:'transcripts']).is_a?(Array)
275
+ self.transcripts = value
276
+ end
277
+ end
278
+
279
+ if attributes.key?(:'speakers')
280
+ if (value = attributes[:'speakers']).is_a?(Array)
281
+ self.speakers = value
282
+ end
283
+ end
284
+
285
+ if attributes.key?(:'channels')
286
+ if (value = attributes[:'channels']).is_a?(Array)
287
+ self.channels = value
288
+ end
289
+ end
290
+
291
+ if attributes.key?(:'playlists')
292
+ if (value = attributes[:'playlists']).is_a?(Array)
293
+ self.playlists = value
294
+ end
295
+ end
296
+ end
297
+
298
+ # Show invalid properties with the reasons. Usually used together with valid?
299
+ # @return Array for valid properties with the reasons
300
+ def list_invalid_properties
301
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
302
+ invalid_properties = Array.new
303
+ if @id.nil?
304
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
305
+ end
306
+
307
+ invalid_properties
308
+ end
309
+
310
+ # Check to see if the all the properties in the model are valid
311
+ # @return true if the model is valid
312
+ def valid?
313
+ warn '[DEPRECATED] the `valid?` method is obsolete'
314
+ return false if @id.nil?
315
+ true
316
+ end
317
+
318
+ # Custom attribute writer method with validation
319
+ # @param [Object] id Value to be assigned
320
+ def id=(id)
321
+ if id.nil?
322
+ fail ArgumentError, 'id cannot be nil'
323
+ end
324
+
325
+ @id = id
326
+ end
327
+
328
+ # Checks equality by comparing each attribute.
329
+ # @param [Object] Object to be compared
330
+ def ==(o)
331
+ return true if self.equal?(o)
332
+ self.class == o.class &&
333
+ id == o.id &&
334
+ title == o.title &&
335
+ description == o.description &&
336
+ platform == o.platform &&
337
+ platform_id == o.platform_id &&
338
+ audio_url == o.audio_url &&
339
+ duration == o.duration &&
340
+ published_at == o.published_at &&
341
+ source_available == o.source_available &&
342
+ source_unavailable_at == o.source_unavailable_at &&
343
+ speakers_count == o.speakers_count &&
344
+ channels_count == o.channels_count &&
345
+ playlists_count == o.playlists_count &&
346
+ platform_label == o.platform_label &&
347
+ url == o.url &&
348
+ source_url == o.source_url &&
349
+ duration_label == o.duration_label &&
350
+ has_audio == o.has_audio &&
351
+ has_transcript == o.has_transcript &&
352
+ thumbnail_urls == o.thumbnail_urls &&
353
+ transcripts == o.transcripts &&
354
+ speakers == o.speakers &&
355
+ channels == o.channels &&
356
+ playlists == o.playlists
357
+ end
358
+
359
+ # @see the `==` method
360
+ # @param [Object] Object to be compared
361
+ def eql?(o)
362
+ self == o
363
+ end
364
+
365
+ # Calculates hash code according to all attributes.
366
+ # @return [Integer] Hash code
367
+ def hash
368
+ [id, title, description, platform, platform_id, audio_url, duration, published_at, source_available, source_unavailable_at, speakers_count, channels_count, playlists_count, platform_label, url, source_url, duration_label, has_audio, has_transcript, thumbnail_urls, transcripts, speakers, channels, playlists].hash
369
+ end
370
+
371
+ # Builds the object from hash
372
+ # @param [Hash] attributes Model attributes in the form of hash
373
+ # @return [Object] Returns the model itself
374
+ def self.build_from_hash(attributes)
375
+ return nil unless attributes.is_a?(Hash)
376
+ attributes = attributes.transform_keys(&:to_sym)
377
+ transformed_hash = {}
378
+ openapi_types.each_pair do |key, type|
379
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
380
+ transformed_hash["#{key}"] = nil
381
+ elsif type =~ /\AArray<(.*)>/i
382
+ # check to ensure the input is an array given that the attribute
383
+ # is documented as an array but the input is not
384
+ if attributes[attribute_map[key]].is_a?(Array)
385
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
386
+ end
387
+ elsif !attributes[attribute_map[key]].nil?
388
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
389
+ end
390
+ end
391
+ new(transformed_hash)
392
+ end
393
+
394
+ # Returns the object in the form of hash
395
+ # @return [Hash] Returns the object in the form of hash
396
+ def to_hash
397
+ hash = {}
398
+ self.class.attribute_map.each_pair do |attr, param|
399
+ value = self.send(attr)
400
+ if value.nil?
401
+ is_nullable = self.class.openapi_nullable.include?(attr)
402
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
403
+ end
404
+
405
+ hash[param] = _to_hash(value)
406
+ end
407
+ hash
408
+ end
409
+
410
+ end
411
+
412
+ end
@@ -0,0 +1,195 @@
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
+ # Page metadata. Collection and default transcript responses include the full set; transcript search responses include only `next_page`. In search mode `total_pages` is capped at 100 and `next_page` is null on the last served page, while `total_count` (and the `X-Total-Count` header) keep the full hit count — so `total_pages` can be smaller than `ceil(total_count / per_page)` on deep result sets.
18
+ class Pagination < ApiModelBase
19
+ attr_accessor :current_page
20
+
21
+ attr_accessor :per_page
22
+
23
+ attr_accessor :total_count
24
+
25
+ attr_accessor :total_pages
26
+
27
+ attr_accessor :next_page
28
+
29
+ attr_accessor :prev_page
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'current_page' => :'current_page',
35
+ :'per_page' => :'per_page',
36
+ :'total_count' => :'total_count',
37
+ :'total_pages' => :'total_pages',
38
+ :'next_page' => :'next_page',
39
+ :'prev_page' => :'prev_page'
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
+ :'current_page' => :'Integer',
57
+ :'per_page' => :'Integer',
58
+ :'total_count' => :'Integer',
59
+ :'total_pages' => :'Integer',
60
+ :'next_page' => :'Integer',
61
+ :'prev_page' => :'Integer'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ :'next_page',
69
+ :'prev_page'
70
+ ])
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ if (!attributes.is_a?(Hash))
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Faqieh::Pagination` initialize method"
78
+ end
79
+
80
+ # check to see if the attribute exists and convert string to symbol for hash key
81
+ acceptable_attribute_map = self.class.acceptable_attribute_map
82
+ attributes = attributes.each_with_object({}) { |(k, v), h|
83
+ if (!acceptable_attribute_map.key?(k.to_sym))
84
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Faqieh::Pagination`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
85
+ end
86
+ h[k.to_sym] = v
87
+ }
88
+
89
+ if attributes.key?(:'current_page')
90
+ self.current_page = attributes[:'current_page']
91
+ end
92
+
93
+ if attributes.key?(:'per_page')
94
+ self.per_page = attributes[:'per_page']
95
+ end
96
+
97
+ if attributes.key?(:'total_count')
98
+ self.total_count = attributes[:'total_count']
99
+ end
100
+
101
+ if attributes.key?(:'total_pages')
102
+ self.total_pages = attributes[:'total_pages']
103
+ end
104
+
105
+ if attributes.key?(:'next_page')
106
+ self.next_page = attributes[:'next_page']
107
+ end
108
+
109
+ if attributes.key?(:'prev_page')
110
+ self.prev_page = attributes[:'prev_page']
111
+ end
112
+ end
113
+
114
+ # Show invalid properties with the reasons. Usually used together with valid?
115
+ # @return Array for valid properties with the reasons
116
+ def list_invalid_properties
117
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
118
+ invalid_properties = Array.new
119
+ invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+ warn '[DEPRECATED] the `valid?` method is obsolete'
126
+ true
127
+ end
128
+
129
+ # Checks equality by comparing each attribute.
130
+ # @param [Object] Object to be compared
131
+ def ==(o)
132
+ return true if self.equal?(o)
133
+ self.class == o.class &&
134
+ current_page == o.current_page &&
135
+ per_page == o.per_page &&
136
+ total_count == o.total_count &&
137
+ total_pages == o.total_pages &&
138
+ next_page == o.next_page &&
139
+ prev_page == o.prev_page
140
+ end
141
+
142
+ # @see the `==` method
143
+ # @param [Object] Object to be compared
144
+ def eql?(o)
145
+ self == o
146
+ end
147
+
148
+ # Calculates hash code according to all attributes.
149
+ # @return [Integer] Hash code
150
+ def hash
151
+ [current_page, per_page, total_count, total_pages, next_page, prev_page].hash
152
+ end
153
+
154
+ # Builds the object from hash
155
+ # @param [Hash] attributes Model attributes in the form of hash
156
+ # @return [Object] Returns the model itself
157
+ def self.build_from_hash(attributes)
158
+ return nil unless attributes.is_a?(Hash)
159
+ attributes = attributes.transform_keys(&:to_sym)
160
+ transformed_hash = {}
161
+ openapi_types.each_pair do |key, type|
162
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
163
+ transformed_hash["#{key}"] = nil
164
+ elsif type =~ /\AArray<(.*)>/i
165
+ # check to ensure the input is an array given that the attribute
166
+ # is documented as an array but the input is not
167
+ if attributes[attribute_map[key]].is_a?(Array)
168
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
169
+ end
170
+ elsif !attributes[attribute_map[key]].nil?
171
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
172
+ end
173
+ end
174
+ new(transformed_hash)
175
+ end
176
+
177
+ # Returns the object in the form of hash
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = self.send(attr)
183
+ if value.nil?
184
+ is_nullable = self.class.openapi_nullable.include?(attr)
185
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
186
+ end
187
+
188
+ hash[param] = _to_hash(value)
189
+ end
190
+ hash
191
+ end
192
+
193
+ end
194
+
195
+ end
@@ -0,0 +1,40 @@
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 Platform
18
+ YOUTUBE = "youtube".freeze
19
+ FAQIEH = "faqieh".freeze
20
+
21
+ def self.all_vars
22
+ @all_vars ||= [YOUTUBE, FAQIEH].freeze
23
+ end
24
+
25
+ # Builds the enum from string
26
+ # @param [String] The enum value in the form of the string
27
+ # @return [String] The enum value
28
+ def self.build_from_hash(value)
29
+ new.build_from_hash(value)
30
+ end
31
+
32
+ # Builds the enum from string
33
+ # @param [String] The enum value in the form of the string
34
+ # @return [String] The enum value
35
+ def build_from_hash(value)
36
+ return value if Platform.all_vars.include?(value)
37
+ raise "Invalid ENUM value #{value} for class #Platform"
38
+ end
39
+ end
40
+ end