fastpixapi 1.1.2 → 1.1.4

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 (112) hide show
  1. checksums.yaml +4 -4
  2. data/lib/crystalline/metadata_fields.rb +56 -48
  3. data/lib/crystalline/types.rb +3 -3
  4. data/lib/crystalline.rb +4 -5
  5. data/lib/fastpix_client/dimensions.rb +54 -61
  6. data/lib/fastpix_client/drm_configurations.rb +49 -56
  7. data/lib/fastpix_client/errors.rb +36 -25
  8. data/lib/fastpix_client/fastpixapi.rb +2 -4
  9. data/lib/fastpix_client/in_video_ai_features.rb +108 -168
  10. data/lib/fastpix_client/input_video.rb +70 -77
  11. data/lib/fastpix_client/live_playback.rb +82 -99
  12. data/lib/fastpix_client/manage_live_stream.rb +149 -264
  13. data/lib/fastpix_client/manage_videos.rb +249 -566
  14. data/lib/fastpix_client/metrics.rb +79 -123
  15. data/lib/fastpix_client/models/components/addtrackrequest.rb +6 -2
  16. data/lib/fastpix_client/models/components/addtrackrequest.rbi +2 -0
  17. data/lib/fastpix_client/models/components/addtrackresponse.rb +6 -2
  18. data/lib/fastpix_client/models/components/addtrackresponse.rbi +2 -0
  19. data/lib/fastpix_client/models/components/audiotrack.rb +6 -2
  20. data/lib/fastpix_client/models/components/audiotrack.rbi +2 -0
  21. data/lib/fastpix_client/models/components/createlivestreamresponsedto.rb +10 -18
  22. data/lib/fastpix_client/models/components/createmediarequest.rb +9 -18
  23. data/lib/fastpix_client/models/components/generatetrackresponse.rb +6 -2
  24. data/lib/fastpix_client/models/components/generatetrackresponse.rbi +2 -0
  25. data/lib/fastpix_client/models/components/getallmediaresponse.rb +20 -38
  26. data/lib/fastpix_client/models/components/getallmediaresponse.rbi +2 -0
  27. data/lib/fastpix_client/models/components/getallmediaresponse_mp4support.rb +32 -12
  28. data/lib/fastpix_client/models/components/getallmediaresponse_mp4support.rbi +11 -1
  29. data/lib/fastpix_client/models/components/getallmediaresponse_sourceresolution.rb +2 -0
  30. data/lib/fastpix_client/models/components/getcreatelivestreamresponsedto.rb +9 -20
  31. data/lib/fastpix_client/models/components/{getmediaresponse.rb → getmediadetailresponse.rb} +25 -43
  32. data/lib/fastpix_client/models/components/{getmediaresponse.rbi → getmediadetailresponse.rbi} +4 -2
  33. data/lib/fastpix_client/models/components/{getmediaresponse_maxresolution.rb → getmediadetailresponse_maxresolution.rb} +2 -2
  34. data/lib/fastpix_client/models/components/getmediadetailresponse_maxresolution.rbi +11 -0
  35. data/lib/fastpix_client/models/components/{getmediaresponse_mediaquality.rb → getmediadetailresponse_mediaquality.rb} +2 -2
  36. data/lib/fastpix_client/models/components/getmediadetailresponse_mediaquality.rbi +11 -0
  37. data/lib/fastpix_client/models/components/getmediadetailresponse_mp4support.rb +48 -0
  38. data/lib/fastpix_client/models/components/getmediadetailresponse_mp4support.rbi +21 -0
  39. data/lib/fastpix_client/models/components/{getmediaresponse_sourceresolution.rb → getmediadetailresponse_sourceresolution.rb} +4 -2
  40. data/lib/fastpix_client/models/components/getmediadetailresponse_sourceresolution.rbi +11 -0
  41. data/lib/fastpix_client/models/components/{getmediaresponse_status.rb → getmediadetailresponse_status.rb} +2 -2
  42. data/lib/fastpix_client/models/components/getmediadetailresponse_status.rbi +11 -0
  43. data/lib/fastpix_client/models/components/{getmediaresponse_track.rb → getmediadetailresponse_track.rb} +1 -1
  44. data/lib/fastpix_client/models/components/getmediadetailresponse_track.rbi +11 -0
  45. data/lib/fastpix_client/models/components/live_media_clips.rb +16 -30
  46. data/lib/fastpix_client/models/components/live_media_clips.rbi +2 -0
  47. data/lib/fastpix_client/models/components/live_media_clips_mp4support.rb +32 -12
  48. data/lib/fastpix_client/models/components/live_media_clips_mp4support.rbi +11 -1
  49. data/lib/fastpix_client/models/components/live_media_clips_sourceresolution.rb +2 -0
  50. data/lib/fastpix_client/models/components/media.rb +18 -35
  51. data/lib/fastpix_client/models/components/media.rbi +2 -0
  52. data/lib/fastpix_client/models/components/media_mp4support.rb +32 -12
  53. data/lib/fastpix_client/models/components/media_mp4support.rbi +11 -1
  54. data/lib/fastpix_client/models/components/media_sourceresolution.rb +2 -0
  55. data/lib/fastpix_client/models/components/patchresponsedata.rb +9 -18
  56. data/lib/fastpix_client/models/components/sourceaccessmedia.rb +18 -35
  57. data/lib/fastpix_client/models/components/sourceaccessmedia.rbi +2 -0
  58. data/lib/fastpix_client/models/components/sourceaccessmedia_mp4support.rb +32 -12
  59. data/lib/fastpix_client/models/components/sourceaccessmedia_mp4support.rbi +11 -1
  60. data/lib/fastpix_client/models/components/sourceaccessmedia_sourceresolution.rb +2 -0
  61. data/lib/fastpix_client/models/components/subtitletrack.rb +6 -2
  62. data/lib/fastpix_client/models/components/subtitletrack.rbi +2 -0
  63. data/lib/fastpix_client/models/components/tracksubtitlesgeneraterequest.rb +6 -2
  64. data/lib/fastpix_client/models/components/tracksubtitlesgeneraterequest.rbi +2 -0
  65. data/lib/fastpix_client/models/components/update_media.rb +18 -35
  66. data/lib/fastpix_client/models/components/update_media.rbi +2 -0
  67. data/lib/fastpix_client/models/components/update_media_maxresolution.rb +0 -1
  68. data/lib/fastpix_client/models/components/update_media_mp4support.rb +32 -12
  69. data/lib/fastpix_client/models/components/update_media_mp4support.rbi +11 -1
  70. data/lib/fastpix_client/models/components/updatetrackrequest.rb +7 -7
  71. data/lib/fastpix_client/models/components/updatetrackrequest.rbi +2 -2
  72. data/lib/fastpix_client/models/components/updatetrackresponse.rb +6 -2
  73. data/lib/fastpix_client/models/components/updatetrackresponse.rbi +2 -0
  74. data/lib/fastpix_client/models/components/videotrack.rb +6 -2
  75. data/lib/fastpix_client/models/components/videotrack.rbi +2 -0
  76. data/lib/fastpix_client/models/components/videotrackforgetall.rb +6 -2
  77. data/lib/fastpix_client/models/components/videotrackforgetall.rbi +2 -0
  78. data/lib/fastpix_client/models/components/views.rb +51 -124
  79. data/lib/fastpix_client/models/components.rb +7 -7
  80. data/lib/fastpix_client/models/errors/empty_response_error.rb +15 -0
  81. data/lib/fastpix_client/models/errors.rb +1 -0
  82. data/lib/fastpix_client/models/operations/get_media_response.rb +1 -1
  83. data/lib/fastpix_client/models/operations/get_media_responsebody.rb +2 -2
  84. data/lib/fastpix_client/models/operations/push_media_settings.rb +9 -20
  85. data/lib/fastpix_client/playback.rb +122 -213
  86. data/lib/fastpix_client/playlist.rb +152 -297
  87. data/lib/fastpix_client/sdk_hooks/registration.rb +2 -2
  88. data/lib/fastpix_client/sdk_hooks/types.rb +4 -0
  89. data/lib/fastpix_client/sdkconfiguration.rb +3 -3
  90. data/lib/fastpix_client/signing_keys.rb +76 -120
  91. data/lib/fastpix_client/simulcast_stream.rb +100 -144
  92. data/lib/fastpix_client/start_live_stream.rb +55 -37
  93. data/lib/fastpix_client/utils/forms.rb +97 -101
  94. data/lib/fastpix_client/utils/headers.rb +44 -34
  95. data/lib/fastpix_client/utils/query_params.rb +39 -29
  96. data/lib/fastpix_client/utils/request_bodies.rb +4 -8
  97. data/lib/fastpix_client/utils/security.rb +30 -18
  98. data/lib/fastpix_client/utils/url.rb +83 -60
  99. data/lib/fastpix_client/utils/utils.rb +19 -37
  100. data/lib/fastpix_client/views.rb +69 -93
  101. data/lib/fastpixapi.rb +10 -10
  102. data/lib/openssl_patch.rb +24 -24
  103. metadata +17 -18
  104. data/lib/fastpix_client/models/components/getmediaresponse_maxresolution.rbi +0 -11
  105. data/lib/fastpix_client/models/components/getmediaresponse_mediaquality.rbi +0 -11
  106. data/lib/fastpix_client/models/components/getmediaresponse_mp4support.rb +0 -28
  107. data/lib/fastpix_client/models/components/getmediaresponse_mp4support.rbi +0 -11
  108. data/lib/fastpix_client/models/components/getmediaresponse_sourceresolution.rbi +0 -11
  109. data/lib/fastpix_client/models/components/getmediaresponse_status.rbi +0 -11
  110. data/lib/fastpix_client/models/components/getmediaresponse_track.rbi +0 -11
  111. data/test/sdk_examples_test.rb +0 -20
  112. data/test/test_helper.rb +0 -29
@@ -14,6 +14,42 @@ module FastpixClient
14
14
  extend T::Sig
15
15
  class Metrics
16
16
  extend T::Sig
17
+
18
+ API_ERROR_OCCURRED = 'API error occurred'
19
+ CONTENT_TYPE_HEADER = 'Content-Type'
20
+ CONTENT_TYPE_JSON = 'application/json'
21
+ DEFAULT_CONTENT_TYPE = 'application/octet-stream'
22
+ UNKNOWN_CONTENT_TYPE_ERROR = 'Unknown content type received'
23
+ USER_AGENT_HEADER = 'user-agent'
24
+
25
+ # Applies the SDK after-request hooks and ensures a usable response is present.
26
+ sig { params(http_response: T.nilable(Faraday::Response), error: T.nilable(StandardError), hook_ctx: SDKHooks::HookContext).returns(Faraday::Response) }
27
+ def apply_after_request_hooks(http_response, error, hook_ctx)
28
+ if http_response.nil? || Utils.error_status?(http_response.status)
29
+ http_response = @sdk_configuration.hooks.after_error(
30
+ error: error,
31
+ hook_ctx: SDKHooks::AfterErrorHookContext.new(
32
+ hook_ctx: hook_ctx
33
+ ),
34
+ response: http_response
35
+ )
36
+ else
37
+ http_response = @sdk_configuration.hooks.after_success(
38
+ hook_ctx: SDKHooks::AfterSuccessHookContext.new(
39
+ hook_ctx: hook_ctx
40
+ ),
41
+ response: http_response
42
+ )
43
+ end
44
+
45
+ if http_response.nil?
46
+ raise error unless error.nil?
47
+ raise ::FastpixClient::Models::Errors::EmptyResponseError, 'no response'
48
+ end
49
+
50
+ http_response
51
+ end
52
+ private :apply_after_request_hooks
17
53
 
18
54
  # Operations involving metrics
19
55
 
@@ -72,7 +108,7 @@ module FastpixClient
72
108
  # * **field:** The grouping field value based on the groupBy parameter.
73
109
  #
74
110
  #
75
- # Related guide: <a href="https://fastpix.com/docs/concepts/what-video-data-do-we-capture">Understand data definitions</a>
111
+ # Related guide: <a href="https://fastpix.com/docs/video-data/understand-data-definitions">Understand data definitions</a>
76
112
  #
77
113
  url, params = @sdk_configuration.get_server_details
78
114
  base_url = Utils.template_url(url, params)
@@ -85,8 +121,8 @@ module FastpixClient
85
121
  headers = {}
86
122
  headers = T.cast(headers, T::Hash[String, String])
87
123
  query_params = Utils.get_query_params(Models::Operations::ListBreakdownValuesRequest, request, nil)
88
- headers['Accept'] = 'application/json'
89
- headers['user-agent'] = @sdk_configuration.user_agent
124
+ headers['Accept'] = CONTENT_TYPE_JSON
125
+ headers[USER_AGENT_HEADER] = @sdk_configuration.user_agent
90
126
 
91
127
  security = @sdk_configuration.security_source&.call
92
128
 
@@ -125,32 +161,12 @@ module FastpixClient
125
161
  rescue StandardError => e
126
162
  error = e
127
163
  ensure
128
- if http_response.nil? || Utils.error_status?(http_response.status)
129
- http_response = @sdk_configuration.hooks.after_error(
130
- error: error,
131
- hook_ctx: SDKHooks::AfterErrorHookContext.new(
132
- hook_ctx: hook_ctx
133
- ),
134
- response: http_response
135
- )
136
- else
137
- http_response = @sdk_configuration.hooks.after_success(
138
- hook_ctx: SDKHooks::AfterSuccessHookContext.new(
139
- hook_ctx: hook_ctx
140
- ),
141
- response: http_response
142
- )
143
- end
144
-
145
- if http_response.nil?
146
- raise error if !error.nil?
147
- raise 'no response'
148
- end
164
+ http_response = apply_after_request_hooks(http_response, error, hook_ctx)
149
165
  end
150
166
 
151
- content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
167
+ content_type = http_response.headers.fetch(CONTENT_TYPE_HEADER, DEFAULT_CONTENT_TYPE)
152
168
  if Utils.match_status_code(http_response.status, ['200'])
153
- if Utils.match_content_type(content_type, 'application/json')
169
+ if Utils.match_content_type(content_type, CONTENT_TYPE_JSON)
154
170
  http_response = @sdk_configuration.hooks.after_success(
155
171
  hook_ctx: SDKHooks::AfterSuccessHookContext.new(
156
172
  hook_ctx: hook_ctx
@@ -168,14 +184,14 @@ module FastpixClient
168
184
 
169
185
  return response
170
186
  else
171
- raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
187
+ raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), UNKNOWN_CONTENT_TYPE_ERROR
172
188
  end
173
189
  elsif Utils.match_status_code(http_response.status, ['4XX'])
174
- raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
190
+ raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), API_ERROR_OCCURRED
175
191
  elsif Utils.match_status_code(http_response.status, ['5XX'])
176
- raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
192
+ raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), API_ERROR_OCCURRED
177
193
  else
178
- if Utils.match_content_type(content_type, 'application/json')
194
+ if Utils.match_content_type(content_type, CONTENT_TYPE_JSON)
179
195
  http_response = @sdk_configuration.hooks.after_success(
180
196
  hook_ctx: SDKHooks::AfterSuccessHookContext.new(
181
197
  hook_ctx: hook_ctx
@@ -193,7 +209,7 @@ module FastpixClient
193
209
 
194
210
  return response
195
211
  else
196
- raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
212
+ raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), UNKNOWN_CONTENT_TYPE_ERROR
197
213
  end
198
214
  end
199
215
  end
@@ -228,7 +244,7 @@ module FastpixClient
228
244
  # * **globalValue:** A global metric value that reflects the overall performance of the specified metric across the entire dataset for the given timespan. This value is not affected by specific filters.
229
245
  #
230
246
  #
231
- # Related guide: <a href="https://fastpix.com/docs/concepts/what-video-data-do-we-capture">Understand data definitions</a>
247
+ # Related guide: <a href="https://fastpix.com/docs/video-data/understand-data-definitions">Understand data definitions</a>
232
248
  #
233
249
  request = Models::Operations::ListOverallValuesRequest.new(
234
250
  metric_id: metric_id,
@@ -247,8 +263,8 @@ module FastpixClient
247
263
  headers = {}
248
264
  headers = T.cast(headers, T::Hash[String, String])
249
265
  query_params = Utils.get_query_params(Models::Operations::ListOverallValuesRequest, request, nil)
250
- headers['Accept'] = 'application/json'
251
- headers['user-agent'] = @sdk_configuration.user_agent
266
+ headers['Accept'] = CONTENT_TYPE_JSON
267
+ headers[USER_AGENT_HEADER] = @sdk_configuration.user_agent
252
268
 
253
269
  security = @sdk_configuration.security_source&.call
254
270
 
@@ -287,32 +303,12 @@ module FastpixClient
287
303
  rescue StandardError => e
288
304
  error = e
289
305
  ensure
290
- if http_response.nil? || Utils.error_status?(http_response.status)
291
- http_response = @sdk_configuration.hooks.after_error(
292
- error: error,
293
- hook_ctx: SDKHooks::AfterErrorHookContext.new(
294
- hook_ctx: hook_ctx
295
- ),
296
- response: http_response
297
- )
298
- else
299
- http_response = @sdk_configuration.hooks.after_success(
300
- hook_ctx: SDKHooks::AfterSuccessHookContext.new(
301
- hook_ctx: hook_ctx
302
- ),
303
- response: http_response
304
- )
305
- end
306
-
307
- if http_response.nil?
308
- raise error if !error.nil?
309
- raise 'no response'
310
- end
306
+ http_response = apply_after_request_hooks(http_response, error, hook_ctx)
311
307
  end
312
308
 
313
- content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
309
+ content_type = http_response.headers.fetch(CONTENT_TYPE_HEADER, DEFAULT_CONTENT_TYPE)
314
310
  if Utils.match_status_code(http_response.status, ['200'])
315
- if Utils.match_content_type(content_type, 'application/json')
311
+ if Utils.match_content_type(content_type, CONTENT_TYPE_JSON)
316
312
  http_response = @sdk_configuration.hooks.after_success(
317
313
  hook_ctx: SDKHooks::AfterSuccessHookContext.new(
318
314
  hook_ctx: hook_ctx
@@ -330,14 +326,14 @@ module FastpixClient
330
326
 
331
327
  return response
332
328
  else
333
- raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
329
+ raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), UNKNOWN_CONTENT_TYPE_ERROR
334
330
  end
335
331
  elsif Utils.match_status_code(http_response.status, ['4XX'])
336
- raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
332
+ raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), API_ERROR_OCCURRED
337
333
  elsif Utils.match_status_code(http_response.status, ['5XX'])
338
- raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
334
+ raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), API_ERROR_OCCURRED
339
335
  else
340
- if Utils.match_content_type(content_type, 'application/json')
336
+ if Utils.match_content_type(content_type, CONTENT_TYPE_JSON)
341
337
  http_response = @sdk_configuration.hooks.after_success(
342
338
  hook_ctx: SDKHooks::AfterSuccessHookContext.new(
343
339
  hook_ctx: hook_ctx
@@ -355,7 +351,7 @@ module FastpixClient
355
351
 
356
352
  return response
357
353
  else
358
- raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
354
+ raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), UNKNOWN_CONTENT_TYPE_ERROR
359
355
  end
360
356
  end
361
357
  end
@@ -383,8 +379,8 @@ module FastpixClient
383
379
  headers = {}
384
380
  headers = T.cast(headers, T::Hash[String, String])
385
381
  query_params = Utils.get_query_params(Models::Operations::GetTimeseriesDataRequest, request, nil)
386
- headers['Accept'] = 'application/json'
387
- headers['user-agent'] = @sdk_configuration.user_agent
382
+ headers['Accept'] = CONTENT_TYPE_JSON
383
+ headers[USER_AGENT_HEADER] = @sdk_configuration.user_agent
388
384
 
389
385
  security = @sdk_configuration.security_source&.call
390
386
 
@@ -423,32 +419,12 @@ module FastpixClient
423
419
  rescue StandardError => e
424
420
  error = e
425
421
  ensure
426
- if http_response.nil? || Utils.error_status?(http_response.status)
427
- http_response = @sdk_configuration.hooks.after_error(
428
- error: error,
429
- hook_ctx: SDKHooks::AfterErrorHookContext.new(
430
- hook_ctx: hook_ctx
431
- ),
432
- response: http_response
433
- )
434
- else
435
- http_response = @sdk_configuration.hooks.after_success(
436
- hook_ctx: SDKHooks::AfterSuccessHookContext.new(
437
- hook_ctx: hook_ctx
438
- ),
439
- response: http_response
440
- )
441
- end
442
-
443
- if http_response.nil?
444
- raise error if !error.nil?
445
- raise 'no response'
446
- end
422
+ http_response = apply_after_request_hooks(http_response, error, hook_ctx)
447
423
  end
448
424
 
449
- content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
425
+ content_type = http_response.headers.fetch(CONTENT_TYPE_HEADER, DEFAULT_CONTENT_TYPE)
450
426
  if Utils.match_status_code(http_response.status, ['200'])
451
- if Utils.match_content_type(content_type, 'application/json')
427
+ if Utils.match_content_type(content_type, CONTENT_TYPE_JSON)
452
428
  http_response = @sdk_configuration.hooks.after_success(
453
429
  hook_ctx: SDKHooks::AfterSuccessHookContext.new(
454
430
  hook_ctx: hook_ctx
@@ -466,14 +442,14 @@ module FastpixClient
466
442
 
467
443
  return response
468
444
  else
469
- raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
445
+ raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), UNKNOWN_CONTENT_TYPE_ERROR
470
446
  end
471
447
  elsif Utils.match_status_code(http_response.status, ['4XX'])
472
- raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
448
+ raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), API_ERROR_OCCURRED
473
449
  elsif Utils.match_status_code(http_response.status, ['5XX'])
474
- raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
450
+ raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), API_ERROR_OCCURRED
475
451
  else
476
- if Utils.match_content_type(content_type, 'application/json')
452
+ if Utils.match_content_type(content_type, CONTENT_TYPE_JSON)
477
453
  http_response = @sdk_configuration.hooks.after_success(
478
454
  hook_ctx: SDKHooks::AfterSuccessHookContext.new(
479
455
  hook_ctx: hook_ctx
@@ -491,7 +467,7 @@ module FastpixClient
491
467
 
492
468
  return response
493
469
  else
494
- raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
470
+ raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), UNKNOWN_CONTENT_TYPE_ERROR
495
471
  end
496
472
  end
497
473
  end
@@ -520,7 +496,7 @@ module FastpixClient
520
496
  # 3. You Receive a response containing the comparison values for the specified metrics across the selected dimensions.
521
497
  #
522
498
  #
523
- # Related guide: <a href="https://fastpix.com/docs/working-with-video-data/explore-the-dashboard#compare-metrics">Compare metrics in dashboard</a>
499
+ # Related guide: <a href="https://fastpix.com/docs/video-data/explore-the-dashboard#compare-metrics">Compare metrics in dashboard</a>
524
500
  #
525
501
  request = Models::Operations::ListComparisonValuesRequest.new(
526
502
  timespan: timespan,
@@ -534,8 +510,8 @@ module FastpixClient
534
510
  headers = {}
535
511
  headers = T.cast(headers, T::Hash[String, String])
536
512
  query_params = Utils.get_query_params(Models::Operations::ListComparisonValuesRequest, request, nil)
537
- headers['Accept'] = 'application/json'
538
- headers['user-agent'] = @sdk_configuration.user_agent
513
+ headers['Accept'] = CONTENT_TYPE_JSON
514
+ headers[USER_AGENT_HEADER] = @sdk_configuration.user_agent
539
515
 
540
516
  security = @sdk_configuration.security_source&.call
541
517
 
@@ -574,32 +550,12 @@ module FastpixClient
574
550
  rescue StandardError => e
575
551
  error = e
576
552
  ensure
577
- if http_response.nil? || Utils.error_status?(http_response.status)
578
- http_response = @sdk_configuration.hooks.after_error(
579
- error: error,
580
- hook_ctx: SDKHooks::AfterErrorHookContext.new(
581
- hook_ctx: hook_ctx
582
- ),
583
- response: http_response
584
- )
585
- else
586
- http_response = @sdk_configuration.hooks.after_success(
587
- hook_ctx: SDKHooks::AfterSuccessHookContext.new(
588
- hook_ctx: hook_ctx
589
- ),
590
- response: http_response
591
- )
592
- end
593
-
594
- if http_response.nil?
595
- raise error if !error.nil?
596
- raise 'no response'
597
- end
553
+ http_response = apply_after_request_hooks(http_response, error, hook_ctx)
598
554
  end
599
555
 
600
- content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
556
+ content_type = http_response.headers.fetch(CONTENT_TYPE_HEADER, DEFAULT_CONTENT_TYPE)
601
557
  if Utils.match_status_code(http_response.status, ['200'])
602
- if Utils.match_content_type(content_type, 'application/json')
558
+ if Utils.match_content_type(content_type, CONTENT_TYPE_JSON)
603
559
  http_response = @sdk_configuration.hooks.after_success(
604
560
  hook_ctx: SDKHooks::AfterSuccessHookContext.new(
605
561
  hook_ctx: hook_ctx
@@ -617,14 +573,14 @@ module FastpixClient
617
573
 
618
574
  return response
619
575
  else
620
- raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
576
+ raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), UNKNOWN_CONTENT_TYPE_ERROR
621
577
  end
622
578
  elsif Utils.match_status_code(http_response.status, ['4XX'])
623
- raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
579
+ raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), API_ERROR_OCCURRED
624
580
  elsif Utils.match_status_code(http_response.status, ['5XX'])
625
- raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
581
+ raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), API_ERROR_OCCURRED
626
582
  else
627
- if Utils.match_content_type(content_type, 'application/json')
583
+ if Utils.match_content_type(content_type, CONTENT_TYPE_JSON)
628
584
  http_response = @sdk_configuration.hooks.after_success(
629
585
  hook_ctx: SDKHooks::AfterSuccessHookContext.new(
630
586
  hook_ctx: hook_ctx
@@ -642,7 +598,7 @@ module FastpixClient
642
598
 
643
599
  return response
644
600
  else
645
- raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
601
+ raise ::FastpixClient::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), UNKNOWN_CONTENT_TYPE_ERROR
646
602
  end
647
603
  end
648
604
  end
@@ -20,13 +20,16 @@ module FastpixClient
20
20
  field :language_code, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::FastpixClient::Utils.field_name('languageCode') } }
21
21
  # The full name of the language corresponding to the `languageCode`.
22
22
  field :language_name, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::FastpixClient::Utils.field_name('languageName') } }
23
+ # Title of the track.
24
+ field :title, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::FastpixClient::Utils.field_name('title') } }
23
25
 
24
- sig { params(url: T.nilable(::String), type: T.nilable(Models::Components::AddTrackRequestType), language_code: T.nilable(::String), language_name: T.nilable(::String)).void }
25
- def initialize(url: 'https://static.fastpix.com/music-1.mp3', type: Models::Components::AddTrackRequestType::AUDIO, language_code: 'it', language_name: 'Italian')
26
+ sig { params(url: T.nilable(::String), type: T.nilable(Models::Components::AddTrackRequestType), language_code: T.nilable(::String), language_name: T.nilable(::String), title: T.nilable(::String)).void }
27
+ def initialize(url: 'https://static.fastpix.com/music-1.mp3', type: Models::Components::AddTrackRequestType::AUDIO, language_code: 'it', language_name: 'Italian', title: nil)
26
28
  @url = url
27
29
  @type = type
28
30
  @language_code = language_code
29
31
  @language_name = language_name
32
+ @title = title
30
33
  end
31
34
 
32
35
  sig { params(other: T.untyped).returns(T::Boolean) }
@@ -36,6 +39,7 @@ module FastpixClient
36
39
  return false unless @type == other.type
37
40
  return false unless @language_code == other.language_code
38
41
  return false unless @language_name == other.language_name
42
+ return false unless @title == other.title
39
43
  true
40
44
  end
41
45
  end
@@ -16,4 +16,6 @@ class FastpixClient::Models::Components::AddTrackRequest
16
16
  def language_code=(str_); end
17
17
  def language_name(); end
18
18
  def language_name=(str_); end
19
+ def title(); end
20
+ def title=(str_); end
19
21
  end
@@ -22,14 +22,17 @@ module FastpixClient
22
22
  field :language_code, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::FastpixClient::Utils.field_name('languageCode') } }
23
23
  # The full name of the language corresponding to the `languageCode`.
24
24
  field :language_name, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::FastpixClient::Utils.field_name('languageName') } }
25
+ # Title of the track.
26
+ field :title, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::FastpixClient::Utils.field_name('title') } }
25
27
 
26
- sig { params(id: T.nilable(::String), type: T.nilable(Models::Components::AddTrackResponseType), url: T.nilable(::String), language_code: T.nilable(::String), language_name: T.nilable(::String)).void }
27
- def initialize(id: nil, type: nil, url: nil, language_code: nil, language_name: nil)
28
+ sig { params(id: T.nilable(::String), type: T.nilable(Models::Components::AddTrackResponseType), url: T.nilable(::String), language_code: T.nilable(::String), language_name: T.nilable(::String), title: T.nilable(::String)).void }
29
+ def initialize(id: nil, type: nil, url: nil, language_code: nil, language_name: nil, title: nil)
28
30
  @id = id
29
31
  @type = type
30
32
  @url = url
31
33
  @language_code = language_code
32
34
  @language_name = language_name
35
+ @title = title
33
36
  end
34
37
 
35
38
  sig { params(other: T.untyped).returns(T::Boolean) }
@@ -40,6 +43,7 @@ module FastpixClient
40
43
  return false unless @url == other.url
41
44
  return false unless @language_code == other.language_code
42
45
  return false unless @language_name == other.language_name
46
+ return false unless @title == other.title
43
47
  true
44
48
  end
45
49
  end
@@ -18,4 +18,6 @@ class FastpixClient::Models::Components::AddTrackResponse
18
18
  def language_code=(str_); end
19
19
  def language_name(); end
20
20
  def language_name=(str_); end
21
+ def title(); end
22
+ def title=(str_); end
21
23
  end
@@ -18,6 +18,8 @@ module FastpixClient
18
18
  field :type, Crystalline::Nilable.new(Models::Components::AudioTrackType), { 'format_json': { 'letter_case': ::FastpixClient::Utils.field_name('type'), 'decoder': Utils.enum_from_string(Models::Components::AudioTrackType, true) } }
19
19
  # Indicates the current state of the track. 'available' means the track has been processed successfully and is ready to be used or played.
20
20
  field :status, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::FastpixClient::Utils.field_name('status') } }
21
+ # Title of the track.
22
+ field :title, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::FastpixClient::Utils.field_name('title') } }
21
23
  # Name of the language in which the subtitles will be generated.
22
24
  #
23
25
  field :language_name, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::FastpixClient::Utils.field_name('languageName') } }
@@ -25,11 +27,12 @@ module FastpixClient
25
27
  #
26
28
  field :language_code, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::FastpixClient::Utils.field_name('languageCode') } }
27
29
 
28
- sig { params(id: T.nilable(::String), type: T.nilable(Models::Components::AudioTrackType), status: T.nilable(::String), language_name: T.nilable(::String), language_code: T.nilable(::String)).void }
29
- def initialize(id: nil, type: nil, status: nil, language_name: nil, language_code: nil)
30
+ sig { params(id: T.nilable(::String), type: T.nilable(Models::Components::AudioTrackType), status: T.nilable(::String), title: T.nilable(::String), language_name: T.nilable(::String), language_code: T.nilable(::String)).void }
31
+ def initialize(id: nil, type: nil, status: nil, title: nil, language_name: nil, language_code: nil)
30
32
  @id = id
31
33
  @type = type
32
34
  @status = status
35
+ @title = title
33
36
  @language_name = language_name
34
37
  @language_code = language_code
35
38
  end
@@ -40,6 +43,7 @@ module FastpixClient
40
43
  return false unless @id == other.id
41
44
  return false unless @type == other.type
42
45
  return false unless @status == other.status
46
+ return false unless @title == other.title
43
47
  return false unless @language_name == other.language_name
44
48
  return false unless @language_code == other.language_code
45
49
  true
@@ -14,6 +14,8 @@ class FastpixClient::Models::Components::AudioTrack
14
14
  def type=(str_); end
15
15
  def status(); end
16
16
  def status=(str_); end
17
+ def title(); end
18
+ def title=(str_); end
17
19
  def language_name(); end
18
20
  def language_name=(str_); end
19
21
  def language_code(); end
@@ -71,24 +71,16 @@ module FastpixClient
71
71
  sig { params(other: T.untyped).returns(T::Boolean) }
72
72
  def ==(other)
73
73
  return false unless other.is_a? self.class
74
- return false unless @stream_id == other.stream_id
75
- return false unless @stream_key == other.stream_key
76
- return false unless @srt_secret == other.srt_secret
77
- return false unless @trial == other.trial
78
- return false unless @status == other.status
79
- return false unless @max_resolution == other.max_resolution
80
- return false unless @max_duration == other.max_duration
81
- return false unless @created_at == other.created_at
82
- return false unless @enable_recording == other.enable_recording
83
- return false unless @enable_dvr_mode == other.enable_dvr_mode
84
- return false unless @media_policy == other.media_policy
85
- return false unless @metadata == other.metadata
86
- return false unless @low_latency == other.low_latency
87
- return false unless @closed_captions == other.closed_captions
88
- return false unless @playback_ids == other.playback_ids
89
- return false unless @srt_playback_response == other.srt_playback_response
90
- return false unless @reconnect_window == other.reconnect_window
91
- true
74
+
75
+ [@stream_id, @stream_key, @srt_secret, @trial, @status, @max_resolution,
76
+ @max_duration, @created_at, @enable_recording, @enable_dvr_mode, @media_policy,
77
+ @metadata, @low_latency, @closed_captions, @playback_ids, @srt_playback_response,
78
+ @reconnect_window] ==
79
+ [other.stream_id, other.stream_key, other.srt_secret, other.trial, other.status,
80
+ other.max_resolution, other.max_duration, other.created_at, other.enable_recording,
81
+ other.enable_dvr_mode, other.media_policy, other.metadata, other.low_latency,
82
+ other.closed_captions, other.playback_ids, other.srt_playback_response,
83
+ other.reconnect_window]
92
84
  end
93
85
  end
94
86
  end
@@ -81,24 +81,15 @@ module FastpixClient
81
81
  sig { params(other: T.untyped).returns(T::Boolean) }
82
82
  def ==(other)
83
83
  return false unless other.is_a? self.class
84
- return false unless @inputs == other.inputs
85
- return false unless @metadata == other.metadata
86
- return false unless @drm_configuration_id == other.drm_configuration_id
87
- return false unless @title == other.title
88
- return false unless @creator_id == other.creator_id
89
- return false unless @subtitles == other.subtitles
90
- return false unless @mp4_support == other.mp4_support
91
- return false unless @source_access == other.source_access
92
- return false unless @optimize_audio == other.optimize_audio
93
- return false unless @summary == other.summary
94
- return false unless @chapters == other.chapters
95
- return false unless @named_entities == other.named_entities
96
- return false unless @moderation == other.moderation
97
- return false unless @access_restrictions == other.access_restrictions
98
- return false unless @access_policy == other.access_policy
99
- return false unless @max_resolution == other.max_resolution
100
- return false unless @media_quality == other.media_quality
101
- true
84
+
85
+ [@inputs, @metadata, @drm_configuration_id, @title, @creator_id,
86
+ @subtitles, @mp4_support, @source_access, @optimize_audio, @summary,
87
+ @chapters, @named_entities, @moderation, @access_restrictions, @access_policy,
88
+ @max_resolution, @media_quality] ==
89
+ [other.inputs, other.metadata, other.drm_configuration_id, other.title, other.creator_id,
90
+ other.subtitles, other.mp4_support, other.source_access, other.optimize_audio, other.summary,
91
+ other.chapters, other.named_entities, other.moderation, other.access_restrictions, other.access_policy,
92
+ other.max_resolution, other.media_quality]
102
93
  end
103
94
  end
104
95
  end
@@ -24,14 +24,17 @@ module FastpixClient
24
24
  # You can search for videos with specific key value pairs using metadata, when you tag a video in "key" : "value" pairs. Dynamic metadata allows you to define a key that allows any value pair. You can have maximum of 255 characters and upto 10 entries are allowed.
25
25
  #
26
26
  field :metadata, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::String)), { 'format_json': { 'letter_case': ::FastpixClient::Utils.field_name('metadata') } }
27
+ # Title of the track.
28
+ field :title, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::FastpixClient::Utils.field_name('title') } }
27
29
 
28
- sig { params(id: T.nilable(::String), type: T.nilable(Models::Components::GenerateTrackResponseType), language_code: T.nilable(Models::Components::GenerateTrackResponseLanguageCode), language_name: T.nilable(::String), metadata: T.nilable(T::Hash[Symbol, ::String])).void }
29
- def initialize(id: nil, type: nil, language_code: nil, language_name: nil, metadata: nil)
30
+ sig { params(id: T.nilable(::String), type: T.nilable(Models::Components::GenerateTrackResponseType), language_code: T.nilable(Models::Components::GenerateTrackResponseLanguageCode), language_name: T.nilable(::String), metadata: T.nilable(T::Hash[Symbol, ::String]), title: T.nilable(::String)).void }
31
+ def initialize(id: nil, type: nil, language_code: nil, language_name: nil, metadata: nil, title: nil)
30
32
  @id = id
31
33
  @type = type
32
34
  @language_code = language_code
33
35
  @language_name = language_name
34
36
  @metadata = metadata
37
+ @title = title
35
38
  end
36
39
 
37
40
  sig { params(other: T.untyped).returns(T::Boolean) }
@@ -42,6 +45,7 @@ module FastpixClient
42
45
  return false unless @language_code == other.language_code
43
46
  return false unless @language_name == other.language_name
44
47
  return false unless @metadata == other.metadata
48
+ return false unless @title == other.title
45
49
  true
46
50
  end
47
51
  end
@@ -18,4 +18,6 @@ class FastpixClient::Models::Components::GenerateTrackResponse
18
18
  def language_name=(str_); end
19
19
  def metadata(); end
20
20
  def metadata=(str_); end
21
+ def title(); end
22
+ def title=(str_); end
21
23
  end