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,340 @@
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 Channel < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :description
23
+
24
+ attr_accessor :platform
25
+
26
+ attr_accessor :platform_id
27
+
28
+ attr_accessor :source_available
29
+
30
+ attr_accessor :source_unavailable_at
31
+
32
+ attr_accessor :media_count
33
+
34
+ attr_accessor :hours_count
35
+
36
+ attr_accessor :playlists_count
37
+
38
+ attr_accessor :speakers_count
39
+
40
+ attr_accessor :platform_label
41
+
42
+ # Localized Faqieh webpage URL for this channel.
43
+ attr_accessor :url
44
+
45
+ # Original source URL; equals url when platform is faqieh.
46
+ attr_accessor :source_url
47
+
48
+ attr_accessor :profile_urls
49
+
50
+ attr_accessor :cover_url
51
+
52
+ attr_accessor :speakers
53
+
54
+ class EnumAttributeValidator
55
+ attr_reader :datatype
56
+ attr_reader :allowable_values
57
+
58
+ def initialize(datatype, allowable_values)
59
+ @allowable_values = allowable_values.map do |value|
60
+ case datatype.to_s
61
+ when /Integer/i
62
+ value.to_i
63
+ when /Float/i
64
+ value.to_f
65
+ else
66
+ value
67
+ end
68
+ end
69
+ end
70
+
71
+ def valid?(value)
72
+ !value || allowable_values.include?(value)
73
+ end
74
+ end
75
+
76
+ # Attribute mapping from ruby-style variable name to JSON key.
77
+ def self.attribute_map
78
+ {
79
+ :'id' => :'id',
80
+ :'name' => :'name',
81
+ :'description' => :'description',
82
+ :'platform' => :'platform',
83
+ :'platform_id' => :'platform_id',
84
+ :'source_available' => :'source_available',
85
+ :'source_unavailable_at' => :'source_unavailable_at',
86
+ :'media_count' => :'media_count',
87
+ :'hours_count' => :'hours_count',
88
+ :'playlists_count' => :'playlists_count',
89
+ :'speakers_count' => :'speakers_count',
90
+ :'platform_label' => :'platform_label',
91
+ :'url' => :'url',
92
+ :'source_url' => :'source_url',
93
+ :'profile_urls' => :'profile_urls',
94
+ :'cover_url' => :'cover_url',
95
+ :'speakers' => :'speakers'
96
+ }
97
+ end
98
+
99
+ # Returns attribute mapping this model knows about
100
+ def self.acceptable_attribute_map
101
+ attribute_map
102
+ end
103
+
104
+ # Returns all the JSON keys this model knows about
105
+ def self.acceptable_attributes
106
+ acceptable_attribute_map.values
107
+ end
108
+
109
+ # Attribute type mapping.
110
+ def self.openapi_types
111
+ {
112
+ :'id' => :'Integer',
113
+ :'name' => :'String',
114
+ :'description' => :'String',
115
+ :'platform' => :'Platform',
116
+ :'platform_id' => :'String',
117
+ :'source_available' => :'Boolean',
118
+ :'source_unavailable_at' => :'Time',
119
+ :'media_count' => :'Integer',
120
+ :'hours_count' => :'Integer',
121
+ :'playlists_count' => :'Integer',
122
+ :'speakers_count' => :'Integer',
123
+ :'platform_label' => :'String',
124
+ :'url' => :'String',
125
+ :'source_url' => :'String',
126
+ :'profile_urls' => :'Hash<String, String>',
127
+ :'cover_url' => :'String',
128
+ :'speakers' => :'Array<Speaker>'
129
+ }
130
+ end
131
+
132
+ # List of attributes with nullable: true
133
+ def self.openapi_nullable
134
+ Set.new([
135
+ :'description',
136
+ :'source_unavailable_at',
137
+ :'profile_urls',
138
+ :'cover_url',
139
+ ])
140
+ end
141
+
142
+ # Initializes the object
143
+ # @param [Hash] attributes Model attributes in the form of hash
144
+ def initialize(attributes = {})
145
+ if (!attributes.is_a?(Hash))
146
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Faqieh::Channel` initialize method"
147
+ end
148
+
149
+ # check to see if the attribute exists and convert string to symbol for hash key
150
+ acceptable_attribute_map = self.class.acceptable_attribute_map
151
+ attributes = attributes.each_with_object({}) { |(k, v), h|
152
+ if (!acceptable_attribute_map.key?(k.to_sym))
153
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Faqieh::Channel`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
154
+ end
155
+ h[k.to_sym] = v
156
+ }
157
+
158
+ if attributes.key?(:'id')
159
+ self.id = attributes[:'id']
160
+ else
161
+ self.id = nil
162
+ end
163
+
164
+ if attributes.key?(:'name')
165
+ self.name = attributes[:'name']
166
+ end
167
+
168
+ if attributes.key?(:'description')
169
+ self.description = attributes[:'description']
170
+ end
171
+
172
+ if attributes.key?(:'platform')
173
+ self.platform = attributes[:'platform']
174
+ end
175
+
176
+ if attributes.key?(:'platform_id')
177
+ self.platform_id = attributes[:'platform_id']
178
+ end
179
+
180
+ if attributes.key?(:'source_available')
181
+ self.source_available = attributes[:'source_available']
182
+ end
183
+
184
+ if attributes.key?(:'source_unavailable_at')
185
+ self.source_unavailable_at = attributes[:'source_unavailable_at']
186
+ end
187
+
188
+ if attributes.key?(:'media_count')
189
+ self.media_count = attributes[:'media_count']
190
+ end
191
+
192
+ if attributes.key?(:'hours_count')
193
+ self.hours_count = attributes[:'hours_count']
194
+ end
195
+
196
+ if attributes.key?(:'playlists_count')
197
+ self.playlists_count = attributes[:'playlists_count']
198
+ end
199
+
200
+ if attributes.key?(:'speakers_count')
201
+ self.speakers_count = attributes[:'speakers_count']
202
+ end
203
+
204
+ if attributes.key?(:'platform_label')
205
+ self.platform_label = attributes[:'platform_label']
206
+ end
207
+
208
+ if attributes.key?(:'url')
209
+ self.url = attributes[:'url']
210
+ end
211
+
212
+ if attributes.key?(:'source_url')
213
+ self.source_url = attributes[:'source_url']
214
+ end
215
+
216
+ if attributes.key?(:'profile_urls')
217
+ if (value = attributes[:'profile_urls']).is_a?(Hash)
218
+ self.profile_urls = value
219
+ end
220
+ end
221
+
222
+ if attributes.key?(:'cover_url')
223
+ self.cover_url = attributes[:'cover_url']
224
+ end
225
+
226
+ if attributes.key?(:'speakers')
227
+ if (value = attributes[:'speakers']).is_a?(Array)
228
+ self.speakers = value
229
+ end
230
+ end
231
+ end
232
+
233
+ # Show invalid properties with the reasons. Usually used together with valid?
234
+ # @return Array for valid properties with the reasons
235
+ def list_invalid_properties
236
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
237
+ invalid_properties = Array.new
238
+ if @id.nil?
239
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
240
+ end
241
+
242
+ invalid_properties
243
+ end
244
+
245
+ # Check to see if the all the properties in the model are valid
246
+ # @return true if the model is valid
247
+ def valid?
248
+ warn '[DEPRECATED] the `valid?` method is obsolete'
249
+ return false if @id.nil?
250
+ true
251
+ end
252
+
253
+ # Custom attribute writer method with validation
254
+ # @param [Object] id Value to be assigned
255
+ def id=(id)
256
+ if id.nil?
257
+ fail ArgumentError, 'id cannot be nil'
258
+ end
259
+
260
+ @id = id
261
+ end
262
+
263
+ # Checks equality by comparing each attribute.
264
+ # @param [Object] Object to be compared
265
+ def ==(o)
266
+ return true if self.equal?(o)
267
+ self.class == o.class &&
268
+ id == o.id &&
269
+ name == o.name &&
270
+ description == o.description &&
271
+ platform == o.platform &&
272
+ platform_id == o.platform_id &&
273
+ source_available == o.source_available &&
274
+ source_unavailable_at == o.source_unavailable_at &&
275
+ media_count == o.media_count &&
276
+ hours_count == o.hours_count &&
277
+ playlists_count == o.playlists_count &&
278
+ speakers_count == o.speakers_count &&
279
+ platform_label == o.platform_label &&
280
+ url == o.url &&
281
+ source_url == o.source_url &&
282
+ profile_urls == o.profile_urls &&
283
+ cover_url == o.cover_url &&
284
+ speakers == o.speakers
285
+ end
286
+
287
+ # @see the `==` method
288
+ # @param [Object] Object to be compared
289
+ def eql?(o)
290
+ self == o
291
+ end
292
+
293
+ # Calculates hash code according to all attributes.
294
+ # @return [Integer] Hash code
295
+ def hash
296
+ [id, name, description, platform, platform_id, source_available, source_unavailable_at, media_count, hours_count, playlists_count, speakers_count, platform_label, url, source_url, profile_urls, cover_url, speakers].hash
297
+ end
298
+
299
+ # Builds the object from hash
300
+ # @param [Hash] attributes Model attributes in the form of hash
301
+ # @return [Object] Returns the model itself
302
+ def self.build_from_hash(attributes)
303
+ return nil unless attributes.is_a?(Hash)
304
+ attributes = attributes.transform_keys(&:to_sym)
305
+ transformed_hash = {}
306
+ openapi_types.each_pair do |key, type|
307
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
308
+ transformed_hash["#{key}"] = nil
309
+ elsif type =~ /\AArray<(.*)>/i
310
+ # check to ensure the input is an array given that the attribute
311
+ # is documented as an array but the input is not
312
+ if attributes[attribute_map[key]].is_a?(Array)
313
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
314
+ end
315
+ elsif !attributes[attribute_map[key]].nil?
316
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
317
+ end
318
+ end
319
+ new(transformed_hash)
320
+ end
321
+
322
+ # Returns the object in the form of hash
323
+ # @return [Hash] Returns the object in the form of hash
324
+ def to_hash
325
+ hash = {}
326
+ self.class.attribute_map.each_pair do |attr, param|
327
+ value = self.send(attr)
328
+ if value.nil?
329
+ is_nullable = self.class.openapi_nullable.include?(attr)
330
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
331
+ end
332
+
333
+ hash[param] = _to_hash(value)
334
+ end
335
+ hash
336
+ end
337
+
338
+ end
339
+
340
+ end
@@ -0,0 +1,188 @@
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 DownloadTranscript202Response < ApiModelBase
18
+ attr_accessor :status
19
+
20
+ class EnumAttributeValidator
21
+ attr_reader :datatype
22
+ attr_reader :allowable_values
23
+
24
+ def initialize(datatype, allowable_values)
25
+ @allowable_values = allowable_values.map do |value|
26
+ case datatype.to_s
27
+ when /Integer/i
28
+ value.to_i
29
+ when /Float/i
30
+ value.to_f
31
+ else
32
+ value
33
+ end
34
+ end
35
+ end
36
+
37
+ def valid?(value)
38
+ !value || allowable_values.include?(value)
39
+ end
40
+ end
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'status' => :'status'
46
+ }
47
+ end
48
+
49
+ # Returns attribute mapping this model knows about
50
+ def self.acceptable_attribute_map
51
+ attribute_map
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ acceptable_attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'status' => :'String'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
69
+ ])
70
+ end
71
+
72
+ # Initializes the object
73
+ # @param [Hash] attributes Model attributes in the form of hash
74
+ def initialize(attributes = {})
75
+ if (!attributes.is_a?(Hash))
76
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Faqieh::DownloadTranscript202Response` initialize method"
77
+ end
78
+
79
+ # check to see if the attribute exists and convert string to symbol for hash key
80
+ acceptable_attribute_map = self.class.acceptable_attribute_map
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!acceptable_attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Faqieh::DownloadTranscript202Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'status')
89
+ self.status = attributes[:'status']
90
+ else
91
+ self.status = nil
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
99
+ invalid_properties = Array.new
100
+ if @status.nil?
101
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
102
+ end
103
+
104
+ invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ warn '[DEPRECATED] the `valid?` method is obsolete'
111
+ return false if @status.nil?
112
+ status_validator = EnumAttributeValidator.new('String', ["preparing"])
113
+ return false unless status_validator.valid?(@status)
114
+ true
115
+ end
116
+
117
+ # Custom attribute writer method checking allowed values (enum).
118
+ # @param [Object] status Object to be assigned
119
+ def status=(status)
120
+ validator = EnumAttributeValidator.new('String', ["preparing"])
121
+ unless validator.valid?(status)
122
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
123
+ end
124
+ @status = status
125
+ end
126
+
127
+ # Checks equality by comparing each attribute.
128
+ # @param [Object] Object to be compared
129
+ def ==(o)
130
+ return true if self.equal?(o)
131
+ self.class == o.class &&
132
+ status == o.status
133
+ end
134
+
135
+ # @see the `==` method
136
+ # @param [Object] Object to be compared
137
+ def eql?(o)
138
+ self == o
139
+ end
140
+
141
+ # Calculates hash code according to all attributes.
142
+ # @return [Integer] Hash code
143
+ def hash
144
+ [status].hash
145
+ end
146
+
147
+ # Builds the object from hash
148
+ # @param [Hash] attributes Model attributes in the form of hash
149
+ # @return [Object] Returns the model itself
150
+ def self.build_from_hash(attributes)
151
+ return nil unless attributes.is_a?(Hash)
152
+ attributes = attributes.transform_keys(&:to_sym)
153
+ transformed_hash = {}
154
+ openapi_types.each_pair do |key, type|
155
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
156
+ transformed_hash["#{key}"] = nil
157
+ elsif type =~ /\AArray<(.*)>/i
158
+ # check to ensure the input is an array given that the attribute
159
+ # is documented as an array but the input is not
160
+ if attributes[attribute_map[key]].is_a?(Array)
161
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
162
+ end
163
+ elsif !attributes[attribute_map[key]].nil?
164
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
165
+ end
166
+ end
167
+ new(transformed_hash)
168
+ end
169
+
170
+ # Returns the object in the form of hash
171
+ # @return [Hash] Returns the object in the form of hash
172
+ def to_hash
173
+ hash = {}
174
+ self.class.attribute_map.each_pair do |attr, param|
175
+ value = self.send(attr)
176
+ if value.nil?
177
+ is_nullable = self.class.openapi_nullable.include?(attr)
178
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
179
+ end
180
+
181
+ hash[param] = _to_hash(value)
182
+ end
183
+ hash
184
+ end
185
+
186
+ end
187
+
188
+ end