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,222 @@
|
|
|
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 TranscriptSegment < ApiModelBase
|
|
18
|
+
attr_accessor :id
|
|
19
|
+
|
|
20
|
+
# Localized Faqieh webpage URL with t set to the segment's start time in seconds.
|
|
21
|
+
attr_accessor :url
|
|
22
|
+
|
|
23
|
+
attr_accessor :content
|
|
24
|
+
|
|
25
|
+
# 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).
|
|
26
|
+
attr_accessor :highlighted_content
|
|
27
|
+
|
|
28
|
+
attr_accessor :start_time
|
|
29
|
+
|
|
30
|
+
attr_accessor :end_time
|
|
31
|
+
|
|
32
|
+
attr_accessor :formatted_timestamp
|
|
33
|
+
|
|
34
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
35
|
+
def self.attribute_map
|
|
36
|
+
{
|
|
37
|
+
:'id' => :'id',
|
|
38
|
+
:'url' => :'url',
|
|
39
|
+
:'content' => :'content',
|
|
40
|
+
:'highlighted_content' => :'highlighted_content',
|
|
41
|
+
:'start_time' => :'start_time',
|
|
42
|
+
:'end_time' => :'end_time',
|
|
43
|
+
:'formatted_timestamp' => :'formatted_timestamp'
|
|
44
|
+
}
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Returns attribute mapping this model knows about
|
|
48
|
+
def self.acceptable_attribute_map
|
|
49
|
+
attribute_map
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Returns all the JSON keys this model knows about
|
|
53
|
+
def self.acceptable_attributes
|
|
54
|
+
acceptable_attribute_map.values
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Attribute type mapping.
|
|
58
|
+
def self.openapi_types
|
|
59
|
+
{
|
|
60
|
+
:'id' => :'Integer',
|
|
61
|
+
:'url' => :'String',
|
|
62
|
+
:'content' => :'String',
|
|
63
|
+
:'highlighted_content' => :'String',
|
|
64
|
+
:'start_time' => :'Float',
|
|
65
|
+
:'end_time' => :'Float',
|
|
66
|
+
:'formatted_timestamp' => :'String'
|
|
67
|
+
}
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# List of attributes with nullable: true
|
|
71
|
+
def self.openapi_nullable
|
|
72
|
+
Set.new([
|
|
73
|
+
:'content',
|
|
74
|
+
:'highlighted_content',
|
|
75
|
+
])
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Initializes the object
|
|
79
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
80
|
+
def initialize(attributes = {})
|
|
81
|
+
if (!attributes.is_a?(Hash))
|
|
82
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Faqieh::TranscriptSegment` initialize method"
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
86
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
87
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
88
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
89
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Faqieh::TranscriptSegment`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
90
|
+
end
|
|
91
|
+
h[k.to_sym] = v
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'id')
|
|
95
|
+
self.id = attributes[:'id']
|
|
96
|
+
else
|
|
97
|
+
self.id = nil
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'url')
|
|
101
|
+
self.url = attributes[:'url']
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'content')
|
|
105
|
+
self.content = attributes[:'content']
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'highlighted_content')
|
|
109
|
+
self.highlighted_content = attributes[:'highlighted_content']
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'start_time')
|
|
113
|
+
self.start_time = attributes[:'start_time']
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'end_time')
|
|
117
|
+
self.end_time = attributes[:'end_time']
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes.key?(:'formatted_timestamp')
|
|
121
|
+
self.formatted_timestamp = attributes[:'formatted_timestamp']
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
126
|
+
# @return Array for valid properties with the reasons
|
|
127
|
+
def list_invalid_properties
|
|
128
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
129
|
+
invalid_properties = Array.new
|
|
130
|
+
if @id.nil?
|
|
131
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
invalid_properties
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
# Check to see if the all the properties in the model are valid
|
|
138
|
+
# @return true if the model is valid
|
|
139
|
+
def valid?
|
|
140
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
141
|
+
return false if @id.nil?
|
|
142
|
+
true
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Custom attribute writer method with validation
|
|
146
|
+
# @param [Object] id Value to be assigned
|
|
147
|
+
def id=(id)
|
|
148
|
+
if id.nil?
|
|
149
|
+
fail ArgumentError, 'id cannot be nil'
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
@id = id
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Checks equality by comparing each attribute.
|
|
156
|
+
# @param [Object] Object to be compared
|
|
157
|
+
def ==(o)
|
|
158
|
+
return true if self.equal?(o)
|
|
159
|
+
self.class == o.class &&
|
|
160
|
+
id == o.id &&
|
|
161
|
+
url == o.url &&
|
|
162
|
+
content == o.content &&
|
|
163
|
+
highlighted_content == o.highlighted_content &&
|
|
164
|
+
start_time == o.start_time &&
|
|
165
|
+
end_time == o.end_time &&
|
|
166
|
+
formatted_timestamp == o.formatted_timestamp
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# @see the `==` method
|
|
170
|
+
# @param [Object] Object to be compared
|
|
171
|
+
def eql?(o)
|
|
172
|
+
self == o
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Calculates hash code according to all attributes.
|
|
176
|
+
# @return [Integer] Hash code
|
|
177
|
+
def hash
|
|
178
|
+
[id, url, content, highlighted_content, start_time, end_time, formatted_timestamp].hash
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Builds the object from hash
|
|
182
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
183
|
+
# @return [Object] Returns the model itself
|
|
184
|
+
def self.build_from_hash(attributes)
|
|
185
|
+
return nil unless attributes.is_a?(Hash)
|
|
186
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
187
|
+
transformed_hash = {}
|
|
188
|
+
openapi_types.each_pair do |key, type|
|
|
189
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
190
|
+
transformed_hash["#{key}"] = nil
|
|
191
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
192
|
+
# check to ensure the input is an array given that the attribute
|
|
193
|
+
# is documented as an array but the input is not
|
|
194
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
195
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
196
|
+
end
|
|
197
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
198
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
new(transformed_hash)
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Returns the object in the form of hash
|
|
205
|
+
# @return [Hash] Returns the object in the form of hash
|
|
206
|
+
def to_hash
|
|
207
|
+
hash = {}
|
|
208
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
209
|
+
value = self.send(attr)
|
|
210
|
+
if value.nil?
|
|
211
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
212
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
hash[param] = _to_hash(value)
|
|
216
|
+
end
|
|
217
|
+
hash
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
end
|
|
@@ -0,0 +1,226 @@
|
|
|
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 TranscriptSummary < ApiModelBase
|
|
18
|
+
attr_accessor :language
|
|
19
|
+
|
|
20
|
+
# Localized Faqieh webpage URL for the recording containing this transcript.
|
|
21
|
+
attr_accessor :url
|
|
22
|
+
|
|
23
|
+
attr_accessor :segments_count
|
|
24
|
+
|
|
25
|
+
attr_accessor :download_urls
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'language' => :'language',
|
|
31
|
+
:'url' => :'url',
|
|
32
|
+
:'segments_count' => :'segments_count',
|
|
33
|
+
:'download_urls' => :'download_urls'
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns attribute mapping this model knows about
|
|
38
|
+
def self.acceptable_attribute_map
|
|
39
|
+
attribute_map
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Returns all the JSON keys this model knows about
|
|
43
|
+
def self.acceptable_attributes
|
|
44
|
+
acceptable_attribute_map.values
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Attribute type mapping.
|
|
48
|
+
def self.openapi_types
|
|
49
|
+
{
|
|
50
|
+
:'language' => :'String',
|
|
51
|
+
:'url' => :'String',
|
|
52
|
+
:'segments_count' => :'Integer',
|
|
53
|
+
:'download_urls' => :'DownloadUrls'
|
|
54
|
+
}
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# List of attributes with nullable: true
|
|
58
|
+
def self.openapi_nullable
|
|
59
|
+
Set.new([
|
|
60
|
+
])
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Initializes the object
|
|
64
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
65
|
+
def initialize(attributes = {})
|
|
66
|
+
if (!attributes.is_a?(Hash))
|
|
67
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Faqieh::TranscriptSummary` initialize method"
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
71
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
72
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
73
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
74
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Faqieh::TranscriptSummary`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
75
|
+
end
|
|
76
|
+
h[k.to_sym] = v
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if attributes.key?(:'language')
|
|
80
|
+
self.language = attributes[:'language']
|
|
81
|
+
else
|
|
82
|
+
self.language = nil
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if attributes.key?(:'url')
|
|
86
|
+
self.url = attributes[:'url']
|
|
87
|
+
else
|
|
88
|
+
self.url = nil
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
if attributes.key?(:'segments_count')
|
|
92
|
+
self.segments_count = attributes[:'segments_count']
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'download_urls')
|
|
96
|
+
self.download_urls = attributes[:'download_urls']
|
|
97
|
+
else
|
|
98
|
+
self.download_urls = nil
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
103
|
+
# @return Array for valid properties with the reasons
|
|
104
|
+
def list_invalid_properties
|
|
105
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
106
|
+
invalid_properties = Array.new
|
|
107
|
+
if @language.nil?
|
|
108
|
+
invalid_properties.push('invalid value for "language", language cannot be nil.')
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if @url.nil?
|
|
112
|
+
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if @download_urls.nil?
|
|
116
|
+
invalid_properties.push('invalid value for "download_urls", download_urls cannot be nil.')
|
|
117
|
+
end
|
|
118
|
+
|
|
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
|
+
return false if @language.nil?
|
|
127
|
+
return false if @url.nil?
|
|
128
|
+
return false if @download_urls.nil?
|
|
129
|
+
true
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# Custom attribute writer method with validation
|
|
133
|
+
# @param [Object] language Value to be assigned
|
|
134
|
+
def language=(language)
|
|
135
|
+
if language.nil?
|
|
136
|
+
fail ArgumentError, 'language cannot be nil'
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
@language = language
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Custom attribute writer method with validation
|
|
143
|
+
# @param [Object] url Value to be assigned
|
|
144
|
+
def url=(url)
|
|
145
|
+
if url.nil?
|
|
146
|
+
fail ArgumentError, 'url cannot be nil'
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
@url = url
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Custom attribute writer method with validation
|
|
153
|
+
# @param [Object] download_urls Value to be assigned
|
|
154
|
+
def download_urls=(download_urls)
|
|
155
|
+
if download_urls.nil?
|
|
156
|
+
fail ArgumentError, 'download_urls cannot be nil'
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
@download_urls = download_urls
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Checks equality by comparing each attribute.
|
|
163
|
+
# @param [Object] Object to be compared
|
|
164
|
+
def ==(o)
|
|
165
|
+
return true if self.equal?(o)
|
|
166
|
+
self.class == o.class &&
|
|
167
|
+
language == o.language &&
|
|
168
|
+
url == o.url &&
|
|
169
|
+
segments_count == o.segments_count &&
|
|
170
|
+
download_urls == o.download_urls
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# @see the `==` method
|
|
174
|
+
# @param [Object] Object to be compared
|
|
175
|
+
def eql?(o)
|
|
176
|
+
self == o
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Calculates hash code according to all attributes.
|
|
180
|
+
# @return [Integer] Hash code
|
|
181
|
+
def hash
|
|
182
|
+
[language, url, segments_count, download_urls].hash
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Builds the object from hash
|
|
186
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
187
|
+
# @return [Object] Returns the model itself
|
|
188
|
+
def self.build_from_hash(attributes)
|
|
189
|
+
return nil unless attributes.is_a?(Hash)
|
|
190
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
191
|
+
transformed_hash = {}
|
|
192
|
+
openapi_types.each_pair do |key, type|
|
|
193
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
194
|
+
transformed_hash["#{key}"] = nil
|
|
195
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
196
|
+
# check to ensure the input is an array given that the attribute
|
|
197
|
+
# is documented as an array but the input is not
|
|
198
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
199
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
200
|
+
end
|
|
201
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
202
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
new(transformed_hash)
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Returns the object in the form of hash
|
|
209
|
+
# @return [Hash] Returns the object in the form of hash
|
|
210
|
+
def to_hash
|
|
211
|
+
hash = {}
|
|
212
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
213
|
+
value = self.send(attr)
|
|
214
|
+
if value.nil?
|
|
215
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
216
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
hash[param] = _to_hash(value)
|
|
220
|
+
end
|
|
221
|
+
hash
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
module Faqieh
|
|
14
|
+
VERSION = '0.0.1'
|
|
15
|
+
end
|
data/lib/faqieh.rb
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
# Common files
|
|
14
|
+
require 'faqieh/api_client'
|
|
15
|
+
require 'faqieh/api_error'
|
|
16
|
+
require 'faqieh/api_model_base'
|
|
17
|
+
require 'faqieh/version'
|
|
18
|
+
require 'faqieh/configuration'
|
|
19
|
+
|
|
20
|
+
# Models
|
|
21
|
+
require 'faqieh/models/channel'
|
|
22
|
+
require 'faqieh/models/download_transcript202_response'
|
|
23
|
+
require 'faqieh/models/download_urls'
|
|
24
|
+
require 'faqieh/models/error'
|
|
25
|
+
require 'faqieh/models/error_error'
|
|
26
|
+
require 'faqieh/models/facet_option'
|
|
27
|
+
require 'faqieh/models/get_channel200_response'
|
|
28
|
+
require 'faqieh/models/get_medium200_response'
|
|
29
|
+
require 'faqieh/models/get_playlist200_response'
|
|
30
|
+
require 'faqieh/models/get_speaker200_response'
|
|
31
|
+
require 'faqieh/models/get_transcript200_response'
|
|
32
|
+
require 'faqieh/models/list_channels200_response'
|
|
33
|
+
require 'faqieh/models/list_media200_response'
|
|
34
|
+
require 'faqieh/models/list_playlists200_response'
|
|
35
|
+
require 'faqieh/models/list_speakers200_response'
|
|
36
|
+
require 'faqieh/models/list_transcripts200_response'
|
|
37
|
+
require 'faqieh/models/medium'
|
|
38
|
+
require 'faqieh/models/pagination'
|
|
39
|
+
require 'faqieh/models/platform'
|
|
40
|
+
require 'faqieh/models/playlist'
|
|
41
|
+
require 'faqieh/models/search200_response'
|
|
42
|
+
require 'faqieh/models/search_section'
|
|
43
|
+
require 'faqieh/models/search_section_facets'
|
|
44
|
+
require 'faqieh/models/speaker'
|
|
45
|
+
require 'faqieh/models/speaker_countries_inner'
|
|
46
|
+
require 'faqieh/models/transcript_detail'
|
|
47
|
+
require 'faqieh/models/transcript_search_result'
|
|
48
|
+
require 'faqieh/models/transcript_segment'
|
|
49
|
+
require 'faqieh/models/transcript_summary'
|
|
50
|
+
|
|
51
|
+
# APIs
|
|
52
|
+
require 'faqieh/api/channels_api'
|
|
53
|
+
require 'faqieh/api/media_api'
|
|
54
|
+
require 'faqieh/api/playlists_api'
|
|
55
|
+
require 'faqieh/api/search_api'
|
|
56
|
+
require 'faqieh/api/speakers_api'
|
|
57
|
+
require 'faqieh/api/transcripts_api'
|
|
58
|
+
|
|
59
|
+
module Faqieh
|
|
60
|
+
class << self
|
|
61
|
+
# Customize default settings for the SDK using block.
|
|
62
|
+
# Faqieh.configure do |config|
|
|
63
|
+
# config.username = "xxx"
|
|
64
|
+
# config.password = "xxx"
|
|
65
|
+
# end
|
|
66
|
+
# If no block given, return the default Configuration object.
|
|
67
|
+
def configure
|
|
68
|
+
if block_given?
|
|
69
|
+
yield(Configuration.default)
|
|
70
|
+
else
|
|
71
|
+
Configuration.default
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
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
|
+
# load the gem
|
|
14
|
+
require 'faqieh'
|
|
15
|
+
|
|
16
|
+
# The following was generated by the `rspec --init` command. Conventionally, all
|
|
17
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
|
18
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
|
19
|
+
# this file to always be loaded, without a need to explicitly require it in any
|
|
20
|
+
# files.
|
|
21
|
+
#
|
|
22
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
|
23
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
|
24
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
|
25
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
|
26
|
+
# a separate helper file that requires the additional dependencies and performs
|
|
27
|
+
# the additional setup, and require it from the spec files that actually need
|
|
28
|
+
# it.
|
|
29
|
+
#
|
|
30
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
|
31
|
+
# users commonly want.
|
|
32
|
+
#
|
|
33
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
|
34
|
+
RSpec.configure do |config|
|
|
35
|
+
# rspec-expectations config goes here. You can use an alternate
|
|
36
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
|
37
|
+
# assertions if you prefer.
|
|
38
|
+
config.expect_with :rspec do |expectations|
|
|
39
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
|
40
|
+
# and `failure_message` of custom matchers include text for helper methods
|
|
41
|
+
# defined using `chain`, e.g.:
|
|
42
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
|
43
|
+
# # => "be bigger than 2 and smaller than 4"
|
|
44
|
+
# ...rather than:
|
|
45
|
+
# # => "be bigger than 2"
|
|
46
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
|
50
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
|
51
|
+
config.mock_with :rspec do |mocks|
|
|
52
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
|
53
|
+
# a real object. This is generally recommended, and will default to
|
|
54
|
+
# `true` in RSpec 4.
|
|
55
|
+
mocks.verify_partial_doubles = true
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# The settings below are suggested to provide a good initial experience
|
|
59
|
+
# with RSpec, but feel free to customize to your heart's content.
|
|
60
|
+
=begin
|
|
61
|
+
# These two settings work together to allow you to limit a spec run
|
|
62
|
+
# to individual examples or groups you care about by tagging them with
|
|
63
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
|
64
|
+
# get run.
|
|
65
|
+
config.filter_run :focus
|
|
66
|
+
config.run_all_when_everything_filtered = true
|
|
67
|
+
|
|
68
|
+
# Allows RSpec to persist some state between runs in order to support
|
|
69
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
|
70
|
+
# you configure your source control system to ignore this file.
|
|
71
|
+
config.example_status_persistence_file_path = "spec/examples.txt"
|
|
72
|
+
|
|
73
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
|
74
|
+
# recommended. For more details, see:
|
|
75
|
+
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
|
76
|
+
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
|
77
|
+
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
|
78
|
+
config.disable_monkey_patching!
|
|
79
|
+
|
|
80
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
|
81
|
+
# be too noisy due to issues in dependencies.
|
|
82
|
+
config.warnings = true
|
|
83
|
+
|
|
84
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
|
85
|
+
# file, and it's useful to allow more verbose output when running an
|
|
86
|
+
# individual spec file.
|
|
87
|
+
if config.files_to_run.one?
|
|
88
|
+
# Use the documentation formatter for detailed output,
|
|
89
|
+
# unless a formatter has already been configured
|
|
90
|
+
# (e.g. via a command-line flag).
|
|
91
|
+
config.default_formatter = 'doc'
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Print the 10 slowest examples and example groups at the
|
|
95
|
+
# end of the spec run, to help surface which specs are running
|
|
96
|
+
# particularly slow.
|
|
97
|
+
config.profile_examples = 10
|
|
98
|
+
|
|
99
|
+
# Run specs in random order to surface order dependencies. If you find an
|
|
100
|
+
# order dependency and want to debug it, you can fix the order by providing
|
|
101
|
+
# the seed, which is printed after each run.
|
|
102
|
+
# --seed 1234
|
|
103
|
+
config.order = :random
|
|
104
|
+
|
|
105
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
|
106
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
|
107
|
+
# test failures related to randomization by passing the same `--seed` value
|
|
108
|
+
# as the one that triggered the failure.
|
|
109
|
+
Kernel.srand config.seed
|
|
110
|
+
=end
|
|
111
|
+
end
|