fastpixapi 1.1.1 → 1.1.3

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 (122) 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 +55 -62
  6. data/lib/fastpix_client/drm_configurations.rb +51 -58
  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 +75 -83
  11. data/lib/fastpix_client/live_playback.rb +82 -99
  12. data/lib/fastpix_client/manage_live_stream.rb +145 -261
  13. data/lib/fastpix_client/manage_videos.rb +252 -567
  14. data/lib/fastpix_client/metrics.rb +82 -126
  15. data/lib/fastpix_client/models/components/addtrackrequest.rb +1 -1
  16. data/lib/fastpix_client/models/components/createlivestreamresponsedto.rb +10 -18
  17. data/lib/fastpix_client/models/components/createmediarequest.rb +10 -19
  18. data/lib/fastpix_client/models/components/deletesigningkeyresponse.rb +6 -2
  19. data/lib/fastpix_client/models/components/deletesigningkeyresponsedata.rb +33 -0
  20. data/lib/fastpix_client/models/components/getallmediaresponse.rb +13 -29
  21. data/lib/fastpix_client/models/components/getcreatelivestreamresponsedto.rb +9 -20
  22. data/lib/fastpix_client/models/components/getmediaresponse.rb +13 -29
  23. data/lib/fastpix_client/models/components/live_media_clips.rb +9 -21
  24. data/lib/fastpix_client/models/components/media.rb +11 -26
  25. data/lib/fastpix_client/models/components/patchresponsedata.rb +9 -18
  26. data/lib/fastpix_client/models/components/pullvideoinput.rb +1 -1
  27. data/lib/fastpix_client/models/components/sourceaccessmedia.rb +11 -26
  28. data/lib/fastpix_client/models/components/update_media.rb +11 -26
  29. data/lib/fastpix_client/models/components/views.rb +52 -125
  30. data/lib/fastpix_client/models/components/watermarkinput.rb +1 -1
  31. data/lib/fastpix_client/models/components.rb +1 -0
  32. data/lib/fastpix_client/models/errors/empty_response_error.rb +15 -0
  33. data/lib/fastpix_client/models/errors.rb +1 -0
  34. data/lib/fastpix_client/models/operations/add_media_to_playlist_response.rb +1 -1
  35. data/lib/fastpix_client/models/operations/add_media_track_response.rb +1 -1
  36. data/lib/fastpix_client/models/operations/cancel_upload_response.rb +1 -1
  37. data/lib/fastpix_client/models/operations/change_media_order_in_playlist_response.rb +1 -1
  38. data/lib/fastpix_client/models/operations/complete_live_stream_response.rb +1 -1
  39. data/lib/fastpix_client/models/operations/create_a_playlist_response.rb +1 -1
  40. data/lib/fastpix_client/models/operations/create_media_playback_id_response.rb +1 -1
  41. data/lib/fastpix_client/models/operations/create_media_response.rb +1 -1
  42. data/lib/fastpix_client/models/operations/create_new_stream_response.rb +1 -1
  43. data/lib/fastpix_client/models/operations/create_playbackid_of_stream_response.rb +1 -1
  44. data/lib/fastpix_client/models/operations/create_signing_key_response.rb +1 -1
  45. data/lib/fastpix_client/models/operations/create_simulcast_of_stream_response.rb +1 -1
  46. data/lib/fastpix_client/models/operations/delete_a_playlist_response.rb +1 -1
  47. data/lib/fastpix_client/models/operations/delete_live_stream_response.rb +1 -1
  48. data/lib/fastpix_client/models/operations/delete_media_from_playlist_response.rb +1 -1
  49. data/lib/fastpix_client/models/operations/delete_media_playback_id_response.rb +1 -1
  50. data/lib/fastpix_client/models/operations/delete_media_response.rb +1 -1
  51. data/lib/fastpix_client/models/operations/delete_media_track_response.rb +1 -1
  52. data/lib/fastpix_client/models/operations/delete_playbackid_of_stream_response.rb +1 -1
  53. data/lib/fastpix_client/models/operations/delete_signing_key_response.rb +1 -1
  54. data/lib/fastpix_client/models/operations/delete_simulcast_of_stream_response.rb +1 -1
  55. data/lib/fastpix_client/models/operations/direct_upload_video_media_request.rb +1 -1
  56. data/lib/fastpix_client/models/operations/direct_upload_video_media_response.rb +1 -1
  57. data/lib/fastpix_client/models/operations/disable_live_stream_response.rb +1 -1
  58. data/lib/fastpix_client/models/operations/enable_live_stream_response.rb +1 -1
  59. data/lib/fastpix_client/models/operations/generate_subtitle_track_response.rb +1 -1
  60. data/lib/fastpix_client/models/operations/get_all_playlists_response.rb +1 -1
  61. data/lib/fastpix_client/models/operations/get_all_streams_response.rb +1 -1
  62. data/lib/fastpix_client/models/operations/get_live_stream_by_id_response.rb +1 -1
  63. data/lib/fastpix_client/models/operations/get_live_stream_playback_id_response.rb +1 -1
  64. data/lib/fastpix_client/models/operations/get_live_stream_viewer_count_by_id_response.rb +1 -1
  65. data/lib/fastpix_client/models/operations/get_media_clips_response.rb +1 -1
  66. data/lib/fastpix_client/models/operations/get_media_response.rb +1 -1
  67. data/lib/fastpix_client/models/operations/get_media_summary_response.rb +1 -1
  68. data/lib/fastpix_client/models/operations/get_playback_id_response.rb +1 -1
  69. data/lib/fastpix_client/models/operations/get_playlist_by_id_response.rb +1 -1
  70. data/lib/fastpix_client/models/operations/get_signing_key_by_id_response.rb +1 -1
  71. data/lib/fastpix_client/models/operations/get_specific_simulcast_of_stream_response.rb +1 -1
  72. data/lib/fastpix_client/models/operations/get_timeseries_data_response.rb +1 -1
  73. data/lib/fastpix_client/models/operations/get_video_view_details_response.rb +1 -1
  74. data/lib/fastpix_client/models/operations/getdrmconfiguration_response.rb +1 -1
  75. data/lib/fastpix_client/models/operations/getdrmconfigurationbyid_response.rb +1 -1
  76. data/lib/fastpix_client/models/operations/list_breakdown_values_response.rb +1 -1
  77. data/lib/fastpix_client/models/operations/list_by_top_content_response.rb +1 -1
  78. data/lib/fastpix_client/models/operations/list_comparison_values_response.rb +1 -1
  79. data/lib/fastpix_client/models/operations/list_dimensions_response.rb +1 -1
  80. data/lib/fastpix_client/models/operations/list_errors_response.rb +1 -1
  81. data/lib/fastpix_client/models/operations/list_filter_values_for_dimension_response.rb +1 -1
  82. data/lib/fastpix_client/models/operations/list_live_clips_response.rb +1 -1
  83. data/lib/fastpix_client/models/operations/list_media_response.rb +1 -1
  84. data/lib/fastpix_client/models/operations/list_overall_values_response.rb +1 -1
  85. data/lib/fastpix_client/models/operations/list_playback_ids_response.rb +1 -1
  86. data/lib/fastpix_client/models/operations/list_signing_keys_response.rb +1 -1
  87. data/lib/fastpix_client/models/operations/list_uploads_response.rb +1 -1
  88. data/lib/fastpix_client/models/operations/list_video_views_response.rb +1 -1
  89. data/lib/fastpix_client/models/operations/push_media_settings.rb +10 -21
  90. data/lib/fastpix_client/models/operations/retrievemediainputinfo_response.rb +1 -1
  91. data/lib/fastpix_client/models/operations/update_a_playlist_response.rb +1 -1
  92. data/lib/fastpix_client/models/operations/update_domain_restrictions_response.rb +1 -1
  93. data/lib/fastpix_client/models/operations/update_live_stream_response.rb +1 -1
  94. data/lib/fastpix_client/models/operations/update_media_chapters_response.rb +1 -1
  95. data/lib/fastpix_client/models/operations/update_media_moderation_response.rb +1 -1
  96. data/lib/fastpix_client/models/operations/update_media_named_entities_response.rb +1 -1
  97. data/lib/fastpix_client/models/operations/update_media_summary_response.rb +1 -1
  98. data/lib/fastpix_client/models/operations/update_media_track_response.rb +1 -1
  99. data/lib/fastpix_client/models/operations/update_specific_simulcast_of_stream_response.rb +1 -1
  100. data/lib/fastpix_client/models/operations/update_user_agent_restrictions_response.rb +1 -1
  101. data/lib/fastpix_client/models/operations/updated_media_response.rb +1 -1
  102. data/lib/fastpix_client/models/operations/updated_mp4support_response.rb +1 -1
  103. data/lib/fastpix_client/models/operations/updated_source_access_response.rb +1 -1
  104. data/lib/fastpix_client/playback.rb +123 -214
  105. data/lib/fastpix_client/playlist.rb +151 -297
  106. data/lib/fastpix_client/sdk_hooks/registration.rb +2 -2
  107. data/lib/fastpix_client/sdk_hooks/types.rb +4 -0
  108. data/lib/fastpix_client/sdkconfiguration.rb +4 -4
  109. data/lib/fastpix_client/signing_keys.rb +79 -123
  110. data/lib/fastpix_client/simulcast_stream.rb +101 -145
  111. data/lib/fastpix_client/start_live_stream.rb +54 -36
  112. data/lib/fastpix_client/utils/forms.rb +97 -101
  113. data/lib/fastpix_client/utils/headers.rb +44 -34
  114. data/lib/fastpix_client/utils/query_params.rb +39 -29
  115. data/lib/fastpix_client/utils/request_bodies.rb +4 -8
  116. data/lib/fastpix_client/utils/security.rb +30 -18
  117. data/lib/fastpix_client/utils/url.rb +83 -55
  118. data/lib/fastpix_client/utils/utils.rb +19 -37
  119. data/lib/fastpix_client/views.rb +71 -95
  120. data/lib/fastpixapi.rb +10 -10
  121. data/lib/openssl_patch.rb +24 -24
  122. metadata +20 -4
@@ -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
 
@@ -46,7 +82,7 @@ module FastpixClient
46
82
  #
47
83
  # #### How it works
48
84
  #
49
- # 1. Before using this endpoint, you can call the <a href="https://docs.fastpix.io/reference/list_dimensions">List Dimensions</a> endpoint to retrieve all available dimensions that can be used in your query.
85
+ # 1. Before using this endpoint, you can call the <a href="https://fastpix.com/docs/video-data-api/dimensions/list-dimensions">List Dimensions</a> endpoint to retrieve all available dimensions that can be used in your query.
50
86
  #
51
87
  # 2. Send a `GET` request to this endpoint with the required `metricId` and other query parameters.
52
88
  #
@@ -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://docs.fastpix.io/docs/metrics-overview">Understand data definitions</a>
111
+ # Related guide: <a href="https://fastpix.com/docs/concepts/what-video-data-do-we-capture">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
@@ -206,7 +222,7 @@ module FastpixClient
206
222
  #
207
223
  # #### How it works
208
224
  #
209
- # 1. Before using this endpoint, you can call the <a href="https://docs.fastpix.io/reference/list_dimensions">list dimensions</a> endpoint to retrieve all available dimensions that can be used in your query.
225
+ # 1. Before using this endpoint, you can call the <a href="https://fastpix.com/docs/video-data-api/dimensions/list-dimensions">list dimensions</a> endpoint to retrieve all available dimensions that can be used in your query.
210
226
  #
211
227
  # 2. Send a `GET` request to this endpoint with the required `metricId` and other query parameters.
212
228
  #
@@ -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://docs.fastpix.io/docs/metrics-overview">Understand data definitions</a>
247
+ # Related guide: <a href="https://fastpix.com/docs/concepts/what-video-data-do-we-capture">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
@@ -513,14 +489,14 @@ module FastpixClient
513
489
  #
514
490
  # #### How it works
515
491
  #
516
- # 1. Before making a request to this endpoint, call the <a href="https://docs.fastpix.io/reference/list_dimensions">list dimensions</a> endpoint to obtain all available dimensions that can be used for comparison.
492
+ # 1. Before making a request to this endpoint, call the <a href="https://fastpix.com/docs/video-data-api/dimensions/list-dimensions">list dimensions</a> endpoint to obtain all available dimensions that can be used for comparison.
517
493
  #
518
494
  # 2. Send a `GET` request to this endpoint with the desired metrics specified in the query parameters.
519
495
  #
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://docs.fastpix.io/docs/understand-dashboard-ui#compare-metrics">Compare metrics in dashboard</a>
499
+ # Related guide: <a href="https://fastpix.com/docs/working-with-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
@@ -22,7 +22,7 @@ module FastpixClient
22
22
  field :language_name, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::FastpixClient::Utils.field_name('languageName') } }
23
23
 
24
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.io/music-1.mp3', type: Models::Components::AddTrackRequestType::AUDIO, language_code: 'it', language_name: 'Italian')
25
+ def initialize(url: 'https://static.fastpix.com/music-1.mp3', type: Models::Components::AddTrackRequestType::AUDIO, language_code: 'it', language_name: 'Italian')
26
26
  @url = url
27
27
  @type = type
28
28
  @language_code = language_code
@@ -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
@@ -13,7 +13,7 @@ module FastpixClient
13
13
  include Crystalline::MetadataFields
14
14
 
15
15
  # Add one input object at a time. For example, first add a **VideoInput** object. If you also need a watermark, click **Add item** again and select **WatermarkInput**. Repeat this process for **AudioInput** or **SubtitleInput** as needed. For a complete explanation of how media uploads from URL and processing work, refer to the
16
- # <a href="https://docs.fastpix.io/docs/video-on-demand-overview" target="_blank">FastPix Video on Demand Overview</a>.
16
+ # <a href="https://fastpix.com/docs/get-started/overview" target="_blank">FastPix Video on Demand Overview</a>.
17
17
  #
18
18
  field :inputs, Crystalline::Array.new(Crystalline::Union.new(Models::Components::PullVideoInput, Models::Components::WatermarkInput, Models::Components::AudioInput, Models::Components::SubtitleInput)), { 'format_json': { 'letter_case': ::FastpixClient::Utils.field_name('inputs'), required: true } }
19
19
  # 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.
@@ -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
@@ -14,16 +14,20 @@ module FastpixClient
14
14
 
15
15
  # Shows the request status. Returns true for success and false for failure.
16
16
  field :success, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::FastpixClient::Utils.field_name('success') } }
17
+ # Contains details about the deleted signing key.
18
+ field :data, Crystalline::Nilable.new(Models::Components::DeleteSigningKeyResponseData), { 'format_json': { 'letter_case': ::FastpixClient::Utils.field_name('data') } }
17
19
 
18
- sig { params(success: T.nilable(T::Boolean)).void }
19
- def initialize(success: nil)
20
+ sig { params(success: T.nilable(T::Boolean), data: T.nilable(Models::Components::DeleteSigningKeyResponseData)).void }
21
+ def initialize(success: nil, data: nil)
20
22
  @success = success
23
+ @data = data
21
24
  end
22
25
 
23
26
  sig { params(other: T.untyped).returns(T::Boolean) }
24
27
  def ==(other)
25
28
  return false unless other.is_a? self.class
26
29
  return false unless @success == other.success
30
+ return false unless @data == other.data
27
31
  true
28
32
  end
29
33
  end
@@ -0,0 +1,33 @@
1
+ # Generated code for FastPix API SDK.
2
+
3
+ # typed: true
4
+ # frozen_string_literal: true
5
+
6
+
7
+ module FastpixClient
8
+ module Models
9
+ module Components
10
+
11
+ # DeleteSigningKeyResponseData - Contains details about the deleted signing key.
12
+ class DeleteSigningKeyResponseData
13
+ extend T::Sig
14
+ include Crystalline::MetadataFields
15
+
16
+ # A human-readable confirmation message.
17
+ field :message, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::FastpixClient::Utils.field_name('message') } }
18
+
19
+ sig { params(message: T.nilable(::String)).void }
20
+ def initialize(message: nil)
21
+ @message = message
22
+ end
23
+
24
+ sig { params(other: T.untyped).returns(T::Boolean) }
25
+ def ==(other)
26
+ return false unless other.is_a? self.class
27
+ return false unless @message == other.message
28
+ true
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -110,35 +110,19 @@ module FastpixClient
110
110
  sig { params(other: T.untyped).returns(T::Boolean) }
111
111
  def ==(other)
112
112
  return false unless other.is_a? self.class
113
- return false unless @id == other.id
114
- return false unless @source_media_id == other.source_media_id
115
- return false unless @workspace_id == other.workspace_id
116
- return false unless @stream_id == other.stream_id
117
- return false unless @media_quality == other.media_quality
118
- return false unless @creator_id == other.creator_id
119
- return false unless @status == other.status
120
- return false unless @mp4_support == other.mp4_support
121
- return false unless @playback_ids == other.playback_ids
122
- return false unless @tracks == other.tracks
123
- return false unless @summary == other.summary
124
- return false unless @chapters == other.chapters
125
- return false unless @named_entities == other.named_entities
126
- return false unless @moderation == other.moderation
127
- return false unless @duration == other.duration
128
- return false unless @frame_rate == other.frame_rate
129
- return false unless @created_at == other.created_at
130
- return false unless @updated_at == other.updated_at
131
- return false unless @thumbnail == other.thumbnail
132
- return false unless @metadata == other.metadata
133
- return false unless @title == other.title
134
- return false unless @max_resolution == other.max_resolution
135
- return false unless @source_resolution == other.source_resolution
136
- return false unless @source_access == other.source_access
137
- return false unless @generated_subtitles == other.generated_subtitles
138
- return false unless @is_audio_only == other.is_audio_only
139
- return false unless @subtitle_available == other.subtitle_available
140
- return false unless @aspect_ratio == other.aspect_ratio
141
- true
113
+
114
+ [@id, @source_media_id, @workspace_id, @stream_id, @media_quality,
115
+ @creator_id, @status, @mp4_support, @playback_ids, @tracks,
116
+ @summary, @chapters, @named_entities, @moderation, @duration,
117
+ @frame_rate, @created_at, @updated_at, @thumbnail, @metadata,
118
+ @title, @max_resolution, @source_resolution, @source_access, @generated_subtitles,
119
+ @is_audio_only, @subtitle_available, @aspect_ratio] ==
120
+ [other.id, other.source_media_id, other.workspace_id, other.stream_id, other.media_quality,
121
+ other.creator_id, other.status, other.mp4_support, other.playback_ids, other.tracks,
122
+ other.summary, other.chapters, other.named_entities, other.moderation, other.duration,
123
+ other.frame_rate, other.created_at, other.updated_at, other.thumbnail, other.metadata,
124
+ other.title, other.max_resolution, other.source_resolution, other.source_access, other.generated_subtitles,
125
+ other.is_audio_only, other.subtitle_available, other.aspect_ratio]
142
126
  end
143
127
  end
144
128
  end
@@ -77,26 +77,15 @@ module FastpixClient
77
77
  sig { params(other: T.untyped).returns(T::Boolean) }
78
78
  def ==(other)
79
79
  return false unless other.is_a? self.class
80
- return false unless @stream_id == other.stream_id
81
- return false unless @stream_key == other.stream_key
82
- return false unless @srt_secret == other.srt_secret
83
- return false unless @trial == other.trial
84
- return false unless @status == other.status
85
- return false unless @max_resolution == other.max_resolution
86
- return false unless @max_duration == other.max_duration
87
- return false unless @created_at == other.created_at
88
- return false unless @enable_recording == other.enable_recording
89
- return false unless @enable_dvr_mode == other.enable_dvr_mode
90
- return false unless @media_policy == other.media_policy
91
- return false unless @metadata == other.metadata
92
- return false unless @low_latency == other.low_latency
93
- return false unless @closed_captions == other.closed_captions
94
- return false unless @playback_ids == other.playback_ids
95
- return false unless @simulcast_responses == other.simulcast_responses
96
- return false unless @media_ids == other.media_ids
97
- return false unless @srt_playback_response == other.srt_playback_response
98
- return false unless @reconnect_window == other.reconnect_window
99
- true
80
+
81
+ [@stream_id, @stream_key, @srt_secret, @trial, @status,
82
+ @max_resolution, @max_duration, @created_at, @enable_recording, @enable_dvr_mode,
83
+ @media_policy, @metadata, @low_latency, @closed_captions, @playback_ids,
84
+ @simulcast_responses, @media_ids, @srt_playback_response, @reconnect_window] ==
85
+ [other.stream_id, other.stream_key, other.srt_secret, other.trial, other.status,
86
+ other.max_resolution, other.max_duration, other.created_at, other.enable_recording, other.enable_dvr_mode,
87
+ other.media_policy, other.metadata, other.low_latency, other.closed_captions, other.playback_ids,
88
+ other.simulcast_responses, other.media_ids, other.srt_playback_response, other.reconnect_window]
100
89
  end
101
90
  end
102
91
  end