fastpixapi 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/lib/crystalline/metadata_fields.rb +210 -0
- data/lib/crystalline/t.rb +78 -0
- data/lib/crystalline/utils.rb +95 -0
- data/lib/crystalline.rb +12 -0
- data/lib/fastpix_api_sdk/input_video.rb +454 -0
- data/lib/fastpix_api_sdk/manage_live_stream.rb +717 -0
- data/lib/fastpix_api_sdk/manage_videos.rb +960 -0
- data/lib/fastpix_api_sdk/models/components/audioinput.rb +41 -0
- data/lib/fastpix_api_sdk/models/components/audioinput_type.rb +19 -0
- data/lib/fastpix_api_sdk/models/components/createlivestreamrequest.rb +37 -0
- data/lib/fastpix_api_sdk/models/components/createlivestreamrequest_maxresolution.rb +21 -0
- data/lib/fastpix_api_sdk/models/components/createlivestreamrequest_metadata.rb +28 -0
- data/lib/fastpix_api_sdk/models/components/createmediarequest.rb +89 -0
- data/lib/fastpix_api_sdk/models/components/createmediarequest_accesspolicy.rb +22 -0
- data/lib/fastpix_api_sdk/models/components/createmediarequest_accessrestrictions.rb +37 -0
- data/lib/fastpix_api_sdk/models/components/createmediarequest_domains.rb +48 -0
- data/lib/fastpix_api_sdk/models/components/createmediarequest_domains_defaultpolicy.rb +23 -0
- data/lib/fastpix_api_sdk/models/components/createmediarequest_languagecode.rb +26 -0
- data/lib/fastpix_api_sdk/models/components/createmediarequest_maxresolution.rb +25 -0
- data/lib/fastpix_api_sdk/models/components/createmediarequest_metadata.rb +29 -0
- data/lib/fastpix_api_sdk/models/components/createmediarequest_mp4support.rb +22 -0
- data/lib/fastpix_api_sdk/models/components/createmediarequest_type.rb +22 -0
- data/lib/fastpix_api_sdk/models/components/createmediarequest_useragents.rb +48 -0
- data/lib/fastpix_api_sdk/models/components/createmediarequest_useragents_defaultpolicy.rb +23 -0
- data/lib/fastpix_api_sdk/models/components/createmediaresponse.rb +62 -0
- data/lib/fastpix_api_sdk/models/components/createmediaresponse_maxresolution.rb +24 -0
- data/lib/fastpix_api_sdk/models/components/createmediaresponse_metadata.rb +28 -0
- data/lib/fastpix_api_sdk/models/components/directupload.rb +58 -0
- data/lib/fastpix_api_sdk/models/components/directuploadresponse.rb +37 -0
- data/lib/fastpix_api_sdk/models/components/directuploadresponse_metadata.rb +28 -0
- data/lib/fastpix_api_sdk/models/components/getcreatelivestreamresponsedto.rb +85 -0
- data/lib/fastpix_api_sdk/models/components/getcreatelivestreamresponsedto_metadata.rb +28 -0
- data/lib/fastpix_api_sdk/models/components/getcreatelivestreamresponsedto_srtplaybackresponse.rb +37 -0
- data/lib/fastpix_api_sdk/models/components/getstreamsresponse.rb +41 -0
- data/lib/fastpix_api_sdk/models/components/imposetrack.rb +49 -0
- data/lib/fastpix_api_sdk/models/components/input.rb +28 -0
- data/lib/fastpix_api_sdk/models/components/inputmediasettings.rb +45 -0
- data/lib/fastpix_api_sdk/models/components/livestreamdeleteresponse.rb +33 -0
- data/lib/fastpix_api_sdk/models/components/livestreamgetresponse.rb +37 -0
- data/lib/fastpix_api_sdk/models/components/livestreamresponsedto.rb +37 -0
- data/lib/fastpix_api_sdk/models/components/media.rb +93 -0
- data/lib/fastpix_api_sdk/models/components/media_maxresolution.rb +24 -0
- data/lib/fastpix_api_sdk/models/components/media_metadata.rb +28 -0
- data/lib/fastpix_api_sdk/models/components/media_mp4support.rb +22 -0
- data/lib/fastpix_api_sdk/models/components/mediapolicy.rb +20 -0
- data/lib/fastpix_api_sdk/models/components/moderation.rb +34 -0
- data/lib/fastpix_api_sdk/models/components/pagination.rb +41 -0
- data/lib/fastpix_api_sdk/models/components/patchlivestreamrequest.rb +37 -0
- data/lib/fastpix_api_sdk/models/components/patchlivestreamrequest_metadata.rb +28 -0
- data/lib/fastpix_api_sdk/models/components/patchresponsedata.rb +85 -0
- data/lib/fastpix_api_sdk/models/components/patchresponsedata_metadata.rb +28 -0
- data/lib/fastpix_api_sdk/models/components/patchresponsedata_srtplaybackresponse.rb +37 -0
- data/lib/fastpix_api_sdk/models/components/patchresponsedto.rb +37 -0
- data/lib/fastpix_api_sdk/models/components/placement.rb +45 -0
- data/lib/fastpix_api_sdk/models/components/playbackid.rb +41 -0
- data/lib/fastpix_api_sdk/models/components/playbackid_accesspolicy.rb +21 -0
- data/lib/fastpix_api_sdk/models/components/playbackid_accessrestrictions.rb +37 -0
- data/lib/fastpix_api_sdk/models/components/playbackid_domains.rb +41 -0
- data/lib/fastpix_api_sdk/models/components/playbackid_domains_defaultpolicy.rb +20 -0
- data/lib/fastpix_api_sdk/models/components/playbackid_useragents.rb +41 -0
- data/lib/fastpix_api_sdk/models/components/playbackid_useragents_defaultpolicy.rb +20 -0
- data/lib/fastpix_api_sdk/models/components/playbackidrequest.rb +33 -0
- data/lib/fastpix_api_sdk/models/components/playbackidrequest_accesspolicy.rb +20 -0
- data/lib/fastpix_api_sdk/models/components/playbackidresponse.rb +37 -0
- data/lib/fastpix_api_sdk/models/components/playbackidresponse_data.rb +37 -0
- data/lib/fastpix_api_sdk/models/components/playbackids.rb +37 -0
- data/lib/fastpix_api_sdk/models/components/playbacksettings.rb +33 -0
- data/lib/fastpix_api_sdk/models/components/playbacksettings_accesspolicy.rb +20 -0
- data/lib/fastpix_api_sdk/models/components/security.rb +37 -0
- data/lib/fastpix_api_sdk/models/components/segment_1.rb +37 -0
- data/lib/fastpix_api_sdk/models/components/segment_2.rb +37 -0
- data/lib/fastpix_api_sdk/models/components/segment_union.rb +28 -0
- data/lib/fastpix_api_sdk/models/components/simulcastdeleteresponse.rb +33 -0
- data/lib/fastpix_api_sdk/models/components/simulcastrequest.rb +37 -0
- data/lib/fastpix_api_sdk/models/components/simulcastresponse.rb +37 -0
- data/lib/fastpix_api_sdk/models/components/simulcastresponse_data.rb +49 -0
- data/lib/fastpix_api_sdk/models/components/simulcastresponse_metadata.rb +28 -0
- data/lib/fastpix_api_sdk/models/components/simulcastupdaterequest.rb +37 -0
- data/lib/fastpix_api_sdk/models/components/simulcastupdaterequest_metadata.rb +28 -0
- data/lib/fastpix_api_sdk/models/components/simulcastupdateresponse.rb +37 -0
- data/lib/fastpix_api_sdk/models/components/simulcastupdateresponse_data.rb +49 -0
- data/lib/fastpix_api_sdk/models/components/simulcastupdateresponse_metadata.rb +28 -0
- data/lib/fastpix_api_sdk/models/components/sourceresolution.rb +24 -0
- data/lib/fastpix_api_sdk/models/components/subtitle.rb +45 -0
- data/lib/fastpix_api_sdk/models/components/subtitle_metadata.rb +29 -0
- data/lib/fastpix_api_sdk/models/components/subtitleinput.rb +47 -0
- data/lib/fastpix_api_sdk/models/components/subtitleinput_languagecode.rb +76 -0
- data/lib/fastpix_api_sdk/models/components/summary.rb +40 -0
- data/lib/fastpix_api_sdk/models/components/track.rb +53 -0
- data/lib/fastpix_api_sdk/models/components/videoinput.rb +68 -0
- data/lib/fastpix_api_sdk/models/components/watermarkinput.rb +53 -0
- data/lib/fastpix_api_sdk/models/components/watermarkinput_type.rb +19 -0
- data/lib/fastpix_api_sdk/models/components/xalign.rb +21 -0
- data/lib/fastpix_api_sdk/models/components/yalign.rb +21 -0
- data/lib/fastpix_api_sdk/models/components.rb +98 -0
- data/lib/fastpix_api_sdk/models/errors/apierror.rb +38 -0
- data/lib/fastpix_api_sdk/models/errors/badrequest_error.rb +37 -0
- data/lib/fastpix_api_sdk/models/errors/badrequest_error_error.rb +42 -0
- data/lib/fastpix_api_sdk/models/errors/field.rb +37 -0
- data/lib/fastpix_api_sdk/models/errors/forbidden_error.rb +37 -0
- data/lib/fastpix_api_sdk/models/errors/forbidden_error_error.rb +42 -0
- data/lib/fastpix_api_sdk/models/errors/invalidpermission_error.rb +37 -0
- data/lib/fastpix_api_sdk/models/errors/invalidpermission_error_error.rb +42 -0
- data/lib/fastpix_api_sdk/models/errors/medianotfound_error.rb +37 -0
- data/lib/fastpix_api_sdk/models/errors/medianotfound_error_error.rb +42 -0
- data/lib/fastpix_api_sdk/models/errors/mediaorplaybacknotfound_error.rb +37 -0
- data/lib/fastpix_api_sdk/models/errors/mediaorplaybacknotfound_error_error.rb +42 -0
- data/lib/fastpix_api_sdk/models/errors/notfounderror.rb +37 -0
- data/lib/fastpix_api_sdk/models/errors/notfounderror_error.rb +42 -0
- data/lib/fastpix_api_sdk/models/errors/notfounderrorplaybackid.rb +37 -0
- data/lib/fastpix_api_sdk/models/errors/notfounderrorplaybackid_error.rb +42 -0
- data/lib/fastpix_api_sdk/models/errors/notfounderrorsimulcast.rb +37 -0
- data/lib/fastpix_api_sdk/models/errors/notfounderrorsimulcast_error.rb +42 -0
- data/lib/fastpix_api_sdk/models/errors/simulcastunavailable_error.rb +38 -0
- data/lib/fastpix_api_sdk/models/errors/simulcastunavailable_error_error.rb +45 -0
- data/lib/fastpix_api_sdk/models/errors/unauthorized_error.rb +37 -0
- data/lib/fastpix_api_sdk/models/errors/unauthorized_error_error.rb +42 -0
- data/lib/fastpix_api_sdk/models/errors/validationerrorresponse.rb +37 -0
- data/lib/fastpix_api_sdk/models/errors/validationerrorresponse_error.rb +41 -0
- data/lib/fastpix_api_sdk/models/errors.rb +35 -0
- data/lib/fastpix_api_sdk/models/operations/create_media_playback_id_accesspolicy.rb +21 -0
- data/lib/fastpix_api_sdk/models/operations/create_media_playback_id_accessrestrictions.rb +37 -0
- data/lib/fastpix_api_sdk/models/operations/create_media_playback_id_domains.rb +48 -0
- data/lib/fastpix_api_sdk/models/operations/create_media_playback_id_domains_defaultpolicy.rb +23 -0
- data/lib/fastpix_api_sdk/models/operations/create_media_playback_id_request.rb +37 -0
- data/lib/fastpix_api_sdk/models/operations/create_media_playback_id_requestbody.rb +37 -0
- data/lib/fastpix_api_sdk/models/operations/create_media_playback_id_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/create_media_playback_id_responsebody.rb +37 -0
- data/lib/fastpix_api_sdk/models/operations/create_media_playback_id_useragents.rb +48 -0
- data/lib/fastpix_api_sdk/models/operations/create_media_playback_id_useragents_defaultpolicy.rb +23 -0
- data/lib/fastpix_api_sdk/models/operations/create_media_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/create_media_responsebody.rb +37 -0
- data/lib/fastpix_api_sdk/models/operations/create_new_stream_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/create_playbackid_of_stream_request.rb +37 -0
- data/lib/fastpix_api_sdk/models/operations/create_playbackid_of_stream_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/create_simulcast_of_stream_request.rb +37 -0
- data/lib/fastpix_api_sdk/models/operations/create_simulcast_of_stream_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/data.rb +33 -0
- data/lib/fastpix_api_sdk/models/operations/delete_live_stream_request.rb +33 -0
- data/lib/fastpix_api_sdk/models/operations/delete_live_stream_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/delete_media_playback_id_request.rb +37 -0
- data/lib/fastpix_api_sdk/models/operations/delete_media_playback_id_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/delete_media_playback_id_responsebody.rb +33 -0
- data/lib/fastpix_api_sdk/models/operations/delete_media_request.rb +33 -0
- data/lib/fastpix_api_sdk/models/operations/delete_media_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/delete_media_responsebody.rb +33 -0
- data/lib/fastpix_api_sdk/models/operations/delete_playbackid_of_stream_request.rb +37 -0
- data/lib/fastpix_api_sdk/models/operations/delete_playbackid_of_stream_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/delete_simulcast_of_stream_request.rb +37 -0
- data/lib/fastpix_api_sdk/models/operations/delete_simulcast_of_stream_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/direct_upload_video_media_accesspolicy.rb +20 -0
- data/lib/fastpix_api_sdk/models/operations/direct_upload_video_media_accessrestrictions.rb +37 -0
- data/lib/fastpix_api_sdk/models/operations/direct_upload_video_media_domains.rb +48 -0
- data/lib/fastpix_api_sdk/models/operations/direct_upload_video_media_domains_defaultpolicy.rb +23 -0
- data/lib/fastpix_api_sdk/models/operations/direct_upload_video_media_metadata.rb +28 -0
- data/lib/fastpix_api_sdk/models/operations/direct_upload_video_media_request.rb +37 -0
- data/lib/fastpix_api_sdk/models/operations/direct_upload_video_media_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/direct_upload_video_media_responsebody.rb +37 -0
- data/lib/fastpix_api_sdk/models/operations/direct_upload_video_media_useragents.rb +48 -0
- data/lib/fastpix_api_sdk/models/operations/direct_upload_video_media_useragents_defaultpolicy.rb +23 -0
- data/lib/fastpix_api_sdk/models/operations/get_all_streams_orderby.rb +20 -0
- data/lib/fastpix_api_sdk/models/operations/get_all_streams_request.rb +41 -0
- data/lib/fastpix_api_sdk/models/operations/get_all_streams_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/get_live_stream_by_id_request.rb +33 -0
- data/lib/fastpix_api_sdk/models/operations/get_live_stream_by_id_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/get_live_stream_playback_id_request.rb +37 -0
- data/lib/fastpix_api_sdk/models/operations/get_live_stream_playback_id_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/get_media_request.rb +33 -0
- data/lib/fastpix_api_sdk/models/operations/get_media_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/get_media_responsebody.rb +37 -0
- data/lib/fastpix_api_sdk/models/operations/get_specific_simulcast_of_stream_request.rb +37 -0
- data/lib/fastpix_api_sdk/models/operations/get_specific_simulcast_of_stream_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/input.rb +28 -0
- data/lib/fastpix_api_sdk/models/operations/languagecode.rb +26 -0
- data/lib/fastpix_api_sdk/models/operations/list_media_orderby.rb +20 -0
- data/lib/fastpix_api_sdk/models/operations/list_media_request.rb +41 -0
- data/lib/fastpix_api_sdk/models/operations/list_media_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/list_media_responsebody.rb +41 -0
- data/lib/fastpix_api_sdk/models/operations/maxresolution.rb +25 -0
- data/lib/fastpix_api_sdk/models/operations/moderation.rb +34 -0
- data/lib/fastpix_api_sdk/models/operations/mp4support.rb +22 -0
- data/lib/fastpix_api_sdk/models/operations/push_media_settings.rb +95 -0
- data/lib/fastpix_api_sdk/models/operations/retrievemediainputinfo_request.rb +33 -0
- data/lib/fastpix_api_sdk/models/operations/retrievemediainputinfo_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/retrievemediainputinfo_responsebody.rb +37 -0
- data/lib/fastpix_api_sdk/models/operations/subtitles.rb +43 -0
- data/lib/fastpix_api_sdk/models/operations/subtitles_metadata.rb +28 -0
- data/lib/fastpix_api_sdk/models/operations/summary.rb +40 -0
- data/lib/fastpix_api_sdk/models/operations/type.rb +22 -0
- data/lib/fastpix_api_sdk/models/operations/update_live_stream_request.rb +37 -0
- data/lib/fastpix_api_sdk/models/operations/update_live_stream_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/update_specific_simulcast_of_stream_request.rb +41 -0
- data/lib/fastpix_api_sdk/models/operations/update_specific_simulcast_of_stream_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/updated_media_metadata.rb +28 -0
- data/lib/fastpix_api_sdk/models/operations/updated_media_request.rb +37 -0
- data/lib/fastpix_api_sdk/models/operations/updated_media_requestbody.rb +33 -0
- data/lib/fastpix_api_sdk/models/operations/updated_media_response.rb +45 -0
- data/lib/fastpix_api_sdk/models/operations/updated_media_responsebody.rb +37 -0
- data/lib/fastpix_api_sdk/models/operations.rb +89 -0
- data/lib/fastpix_api_sdk/playback.rb +941 -0
- data/lib/fastpix_api_sdk/sdk.rb +103 -0
- data/lib/fastpix_api_sdk/sdk_hooks/hooks.rb +96 -0
- data/lib/fastpix_api_sdk/sdk_hooks/types.rb +157 -0
- data/lib/fastpix_api_sdk/sdkconfiguration.rb +77 -0
- data/lib/fastpix_api_sdk/simulcast_stream.rb +767 -0
- data/lib/fastpix_api_sdk/start_live_stream.rb +208 -0
- data/lib/fastpix_api_sdk/utils/forms.rb +210 -0
- data/lib/fastpix_api_sdk/utils/headers.rb +79 -0
- data/lib/fastpix_api_sdk/utils/query_params.rb +133 -0
- data/lib/fastpix_api_sdk/utils/request_bodies.rb +62 -0
- data/lib/fastpix_api_sdk/utils/retries.rb +95 -0
- data/lib/fastpix_api_sdk/utils/security.rb +133 -0
- data/lib/fastpix_api_sdk/utils/url.rb +102 -0
- data/lib/fastpix_api_sdk/utils/utils.rb +186 -0
- data/lib/fastpixapi.rb +29 -0
- metadata +442 -0
@@ -0,0 +1,960 @@
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
2
|
+
|
3
|
+
# typed: true
|
4
|
+
# frozen_string_literal: true
|
5
|
+
|
6
|
+
require 'faraday'
|
7
|
+
require 'faraday/multipart'
|
8
|
+
require 'faraday/retry'
|
9
|
+
require 'sorbet-runtime'
|
10
|
+
require_relative 'sdk_hooks/hooks'
|
11
|
+
require_relative 'utils/retries'
|
12
|
+
|
13
|
+
module FastpixApiSDK
|
14
|
+
extend T::Sig
|
15
|
+
class ManageVideos
|
16
|
+
extend T::Sig
|
17
|
+
attr_accessor
|
18
|
+
|
19
|
+
|
20
|
+
sig { params(sdk_config: SDKConfiguration).void }
|
21
|
+
def initialize(sdk_config)
|
22
|
+
@sdk_configuration = sdk_config
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
sig { params(base_url: String, url_variables: T.nilable(T::Hash[Symbol, String])).returns(String) }
|
27
|
+
def get_url(base_url:, url_variables: nil)
|
28
|
+
sd_base_url, sd_options = @sdk_configuration.get_server_details
|
29
|
+
|
30
|
+
if base_url.nil?
|
31
|
+
base_url = sd_base_url
|
32
|
+
end
|
33
|
+
|
34
|
+
if url_variables.nil?
|
35
|
+
url_variables = sd_options
|
36
|
+
end
|
37
|
+
|
38
|
+
return Utils.template_url base_url, url_variables
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
sig { params(limit: T.nilable(::Integer), offset: T.nilable(::Integer), order_by: T.nilable(Models::Operations::ListMediaOrderBy), timeout_ms: T.nilable(Integer)).returns(Models::Operations::ListMediaResponse) }
|
43
|
+
def list_media(limit: nil, offset: nil, order_by: nil, timeout_ms: nil)
|
44
|
+
# list_media - Get list of all media
|
45
|
+
# This endpoint returns a list of all media files created from a URL or uploaded as file objects within your organization. Each media entry contains metadata such as the media ID, creation date, status, and type. It allows you to retrieve a comprehensive overview of your media assets, making it easier to manage and review them.
|
46
|
+
#
|
47
|
+
#
|
48
|
+
# #### How it works
|
49
|
+
#
|
50
|
+
# When called, the API provides a paginated response containing the media items in the organization's library. This is helpful for retrieving a large volume of media and managing content in bulk.
|
51
|
+
#
|
52
|
+
#
|
53
|
+
#
|
54
|
+
# #### Use case scenario
|
55
|
+
#
|
56
|
+
# * **Use case:** A content manager at a video-on-demand platform wants to see all uploaded media to assess the quality and status of videos.
|
57
|
+
#
|
58
|
+
#
|
59
|
+
#
|
60
|
+
# * **Detailed example:**
|
61
|
+
# You're managing a video platform and need to check all the uploaded media in your library to ensure no outdated or low-quality content is being served. Using this endpoint, you can retrieve a complete list of media, allowing you to filter, sort, or update items as needed.
|
62
|
+
#
|
63
|
+
request = Models::Operations::ListMediaRequest.new(
|
64
|
+
|
65
|
+
limit: limit,
|
66
|
+
offset: offset,
|
67
|
+
order_by: order_by
|
68
|
+
)
|
69
|
+
url, params = @sdk_configuration.get_server_details
|
70
|
+
base_url = Utils.template_url(url, params)
|
71
|
+
url = "#{base_url}/on-demand"
|
72
|
+
headers = {}
|
73
|
+
query_params = Utils.get_query_params(Models::Operations::ListMediaRequest, request, nil)
|
74
|
+
headers['Accept'] = 'application/json'
|
75
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
76
|
+
|
77
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
78
|
+
|
79
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
80
|
+
timeout ||= @sdk_configuration.timeout
|
81
|
+
|
82
|
+
connection = @sdk_configuration.client
|
83
|
+
|
84
|
+
hook_ctx = SDKHooks::HookContext.new(
|
85
|
+
config: @sdk_configuration,
|
86
|
+
base_url: base_url,
|
87
|
+
oauth2_scopes: [],
|
88
|
+
operation_id: 'list-media',
|
89
|
+
security_source: @sdk_configuration.security_source
|
90
|
+
)
|
91
|
+
|
92
|
+
error = T.let(nil, T.nilable(StandardError))
|
93
|
+
http_response = T.let(nil, T.nilable(Faraday::Response))
|
94
|
+
|
95
|
+
|
96
|
+
begin
|
97
|
+
http_response = connection.get(url) do |req|
|
98
|
+
req.headers.merge!(headers)
|
99
|
+
req.options.timeout = timeout unless timeout.nil?
|
100
|
+
req.params = query_params
|
101
|
+
Utils.configure_request_security(req, security)
|
102
|
+
|
103
|
+
@sdk_configuration.hooks.before_request(
|
104
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
105
|
+
hook_ctx: hook_ctx
|
106
|
+
),
|
107
|
+
request: req
|
108
|
+
)
|
109
|
+
end
|
110
|
+
rescue StandardError => e
|
111
|
+
error = e
|
112
|
+
ensure
|
113
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
114
|
+
http_response = @sdk_configuration.hooks.after_error(
|
115
|
+
error: error,
|
116
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
117
|
+
hook_ctx: hook_ctx
|
118
|
+
),
|
119
|
+
response: http_response
|
120
|
+
)
|
121
|
+
else
|
122
|
+
http_response = @sdk_configuration.hooks.after_success(
|
123
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
124
|
+
hook_ctx: hook_ctx
|
125
|
+
),
|
126
|
+
response: http_response
|
127
|
+
)
|
128
|
+
end
|
129
|
+
|
130
|
+
if http_response.nil?
|
131
|
+
raise error if !error.nil?
|
132
|
+
raise 'no response'
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
137
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
138
|
+
if Utils.match_content_type(content_type, 'application/json')
|
139
|
+
http_response = @sdk_configuration.hooks.after_success(
|
140
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
141
|
+
hook_ctx: hook_ctx
|
142
|
+
),
|
143
|
+
response: http_response
|
144
|
+
)
|
145
|
+
response_data = http_response.env.response_body
|
146
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::ListMediaResponseBody)
|
147
|
+
response = Models::Operations::ListMediaResponse.new(
|
148
|
+
status_code: http_response.status,
|
149
|
+
content_type: content_type,
|
150
|
+
raw_response: http_response,
|
151
|
+
object: obj
|
152
|
+
)
|
153
|
+
|
154
|
+
return response
|
155
|
+
else
|
156
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
157
|
+
end
|
158
|
+
elsif Utils.match_status_code(http_response.status, ['401'])
|
159
|
+
if Utils.match_content_type(content_type, 'application/json')
|
160
|
+
http_response = @sdk_configuration.hooks.after_success(
|
161
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
162
|
+
hook_ctx: hook_ctx
|
163
|
+
),
|
164
|
+
response: http_response
|
165
|
+
)
|
166
|
+
response_data = http_response.env.response_body
|
167
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InvalidPermissionError)
|
168
|
+
throw obj
|
169
|
+
else
|
170
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
171
|
+
end
|
172
|
+
elsif Utils.match_status_code(http_response.status, ['403'])
|
173
|
+
if Utils.match_content_type(content_type, 'application/json')
|
174
|
+
http_response = @sdk_configuration.hooks.after_success(
|
175
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
176
|
+
hook_ctx: hook_ctx
|
177
|
+
),
|
178
|
+
response: http_response
|
179
|
+
)
|
180
|
+
response_data = http_response.env.response_body
|
181
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ForbiddenError)
|
182
|
+
throw obj
|
183
|
+
else
|
184
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
185
|
+
end
|
186
|
+
elsif Utils.match_status_code(http_response.status, ['422'])
|
187
|
+
if Utils.match_content_type(content_type, 'application/json')
|
188
|
+
http_response = @sdk_configuration.hooks.after_success(
|
189
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
190
|
+
hook_ctx: hook_ctx
|
191
|
+
),
|
192
|
+
response: http_response
|
193
|
+
)
|
194
|
+
response_data = http_response.env.response_body
|
195
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ValidationErrorResponse)
|
196
|
+
throw obj
|
197
|
+
else
|
198
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
199
|
+
end
|
200
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
201
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
202
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
203
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
204
|
+
else
|
205
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
206
|
+
|
207
|
+
end
|
208
|
+
end
|
209
|
+
|
210
|
+
|
211
|
+
sig { params(media_id: ::String, timeout_ms: T.nilable(Integer)).returns(Models::Operations::GetMediaResponse) }
|
212
|
+
def get_media(media_id:, timeout_ms: nil)
|
213
|
+
# get_media - Get a media by ID
|
214
|
+
# By calling this endpoint, you can retrieve detailed information about a specific media item, including its current status and a playbackId. This is particularly useful for retrieving specific media details when managing large content libraries.
|
215
|
+
#
|
216
|
+
#
|
217
|
+
#
|
218
|
+
# #### How it works
|
219
|
+
#
|
220
|
+
#
|
221
|
+
#
|
222
|
+
# 1. Make a GET request to the **/on-demand/`<mediaId>`** endpoint, replacing `<mediaId>` with the **uploadId** received during the upload process or the id obtained when creating media from a URL.
|
223
|
+
#
|
224
|
+
#
|
225
|
+
# 2. Receive a response that includes details about the media, including:
|
226
|
+
#
|
227
|
+
# * **status:** Indicates whether the media is still "preparing" or has transitioned to "ready."
|
228
|
+
#
|
229
|
+
# * **playbackId:** The playbackId is a unique identifier that allows you to stream the media once it is ready. You can construct the stream URL dynamically using the playbackId in the following format: `https://stream.fastpix.io/<playbackId>.m3u8`
|
230
|
+
#
|
231
|
+
#
|
232
|
+
#
|
233
|
+
# **Please note:** Polling this API will let you know the status that whether the upload media has been moved to ready status, so that you can get started with streaming your media.
|
234
|
+
#
|
235
|
+
# #### Use case scenario
|
236
|
+
#
|
237
|
+
# **Use case:** Suppose your platform provides users with an interface where they can manage their uploaded content. A user requests detailed information about a specific video to see if it has been fully processed and is available for playback. Using the media ID, you can fetch the information from FastPix and display it in the user's dashboard.
|
238
|
+
#
|
239
|
+
request = Models::Operations::GetMediaRequest.new(
|
240
|
+
|
241
|
+
media_id: media_id
|
242
|
+
)
|
243
|
+
url, params = @sdk_configuration.get_server_details
|
244
|
+
base_url = Utils.template_url(url, params)
|
245
|
+
url = Utils.generate_url(
|
246
|
+
Models::Operations::GetMediaRequest,
|
247
|
+
base_url,
|
248
|
+
'/on-demand/{mediaId}',
|
249
|
+
request
|
250
|
+
)
|
251
|
+
headers = {}
|
252
|
+
headers['Accept'] = 'application/json'
|
253
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
254
|
+
|
255
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
256
|
+
|
257
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
258
|
+
timeout ||= @sdk_configuration.timeout
|
259
|
+
|
260
|
+
connection = @sdk_configuration.client
|
261
|
+
|
262
|
+
hook_ctx = SDKHooks::HookContext.new(
|
263
|
+
config: @sdk_configuration,
|
264
|
+
base_url: base_url,
|
265
|
+
oauth2_scopes: [],
|
266
|
+
operation_id: 'get-media',
|
267
|
+
security_source: @sdk_configuration.security_source
|
268
|
+
)
|
269
|
+
|
270
|
+
error = T.let(nil, T.nilable(StandardError))
|
271
|
+
http_response = T.let(nil, T.nilable(Faraday::Response))
|
272
|
+
|
273
|
+
|
274
|
+
begin
|
275
|
+
http_response = connection.get(url) do |req|
|
276
|
+
req.headers.merge!(headers)
|
277
|
+
req.options.timeout = timeout unless timeout.nil?
|
278
|
+
Utils.configure_request_security(req, security)
|
279
|
+
|
280
|
+
@sdk_configuration.hooks.before_request(
|
281
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
282
|
+
hook_ctx: hook_ctx
|
283
|
+
),
|
284
|
+
request: req
|
285
|
+
)
|
286
|
+
end
|
287
|
+
rescue StandardError => e
|
288
|
+
error = e
|
289
|
+
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
|
311
|
+
end
|
312
|
+
|
313
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
314
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
315
|
+
if Utils.match_content_type(content_type, 'application/json')
|
316
|
+
http_response = @sdk_configuration.hooks.after_success(
|
317
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
318
|
+
hook_ctx: hook_ctx
|
319
|
+
),
|
320
|
+
response: http_response
|
321
|
+
)
|
322
|
+
response_data = http_response.env.response_body
|
323
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::GetMediaResponseBody)
|
324
|
+
response = Models::Operations::GetMediaResponse.new(
|
325
|
+
status_code: http_response.status,
|
326
|
+
content_type: content_type,
|
327
|
+
raw_response: http_response,
|
328
|
+
object: obj
|
329
|
+
)
|
330
|
+
|
331
|
+
return response
|
332
|
+
else
|
333
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
334
|
+
end
|
335
|
+
elsif Utils.match_status_code(http_response.status, ['401'])
|
336
|
+
if Utils.match_content_type(content_type, 'application/json')
|
337
|
+
http_response = @sdk_configuration.hooks.after_success(
|
338
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
339
|
+
hook_ctx: hook_ctx
|
340
|
+
),
|
341
|
+
response: http_response
|
342
|
+
)
|
343
|
+
response_data = http_response.env.response_body
|
344
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InvalidPermissionError)
|
345
|
+
throw obj
|
346
|
+
else
|
347
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
348
|
+
end
|
349
|
+
elsif Utils.match_status_code(http_response.status, ['403'])
|
350
|
+
if Utils.match_content_type(content_type, 'application/json')
|
351
|
+
http_response = @sdk_configuration.hooks.after_success(
|
352
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
353
|
+
hook_ctx: hook_ctx
|
354
|
+
),
|
355
|
+
response: http_response
|
356
|
+
)
|
357
|
+
response_data = http_response.env.response_body
|
358
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ForbiddenError)
|
359
|
+
throw obj
|
360
|
+
else
|
361
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
362
|
+
end
|
363
|
+
elsif Utils.match_status_code(http_response.status, ['404'])
|
364
|
+
if Utils.match_content_type(content_type, 'application/json')
|
365
|
+
http_response = @sdk_configuration.hooks.after_success(
|
366
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
367
|
+
hook_ctx: hook_ctx
|
368
|
+
),
|
369
|
+
response: http_response
|
370
|
+
)
|
371
|
+
response_data = http_response.env.response_body
|
372
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::MediaNotFoundError)
|
373
|
+
throw obj
|
374
|
+
else
|
375
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
376
|
+
end
|
377
|
+
elsif Utils.match_status_code(http_response.status, ['422'])
|
378
|
+
if Utils.match_content_type(content_type, 'application/json')
|
379
|
+
http_response = @sdk_configuration.hooks.after_success(
|
380
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
381
|
+
hook_ctx: hook_ctx
|
382
|
+
),
|
383
|
+
response: http_response
|
384
|
+
)
|
385
|
+
response_data = http_response.env.response_body
|
386
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ValidationErrorResponse)
|
387
|
+
throw obj
|
388
|
+
else
|
389
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
390
|
+
end
|
391
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
392
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
393
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
394
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
395
|
+
else
|
396
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
397
|
+
|
398
|
+
end
|
399
|
+
end
|
400
|
+
|
401
|
+
|
402
|
+
sig { params(media_id: ::String, request_body: T.nilable(Models::Operations::UpdatedMediaRequestBody), timeout_ms: T.nilable(Integer)).returns(Models::Operations::UpdatedMediaResponse) }
|
403
|
+
def updated_media(media_id:, request_body: nil, timeout_ms: nil)
|
404
|
+
# updated_media - Update a media by ID
|
405
|
+
# This endpoint allows you to update specific parameters of an existing media file. You can modify the key-value pairs of the metadata that were provided in the payload during the creation of media from a URL or when uploading the media as a file object.
|
406
|
+
#
|
407
|
+
#
|
408
|
+
# #### How it works
|
409
|
+
#
|
410
|
+
# 1. Make a PATCH request to the **/on-demand/`<mediaId>`** endpoint, replacing `<mediaId>` with the uploadId or the id of the media you want to update.
|
411
|
+
#
|
412
|
+
# 2. Include the updated parameters in the request body.
|
413
|
+
#
|
414
|
+
# 3. Receive a response containing the updated media data, confirming the changes made.
|
415
|
+
#
|
416
|
+
# Once you have made the update request, you can also look for the webhook event **video.media.updated** to notify your system about update status.
|
417
|
+
#
|
418
|
+
#
|
419
|
+
# **Use case:** Imagine a scenario where a user uploads a video and later realizes they need to change the title, add a new description or tags. You can use this endpoint to update the media metadata without having to re-upload the entire video.
|
420
|
+
#
|
421
|
+
request = Models::Operations::UpdatedMediaRequest.new(
|
422
|
+
|
423
|
+
media_id: media_id,
|
424
|
+
request_body: request_body
|
425
|
+
)
|
426
|
+
url, params = @sdk_configuration.get_server_details
|
427
|
+
base_url = Utils.template_url(url, params)
|
428
|
+
url = Utils.generate_url(
|
429
|
+
Models::Operations::UpdatedMediaRequest,
|
430
|
+
base_url,
|
431
|
+
'/on-demand/{mediaId}',
|
432
|
+
request
|
433
|
+
)
|
434
|
+
headers = {}
|
435
|
+
req_content_type, data, form = Utils.serialize_request_body(request, false, false, :request_body, :json)
|
436
|
+
headers['content-type'] = req_content_type
|
437
|
+
|
438
|
+
if form
|
439
|
+
body = Utils.encode_form(form)
|
440
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
441
|
+
body = URI.encode_www_form(data)
|
442
|
+
else
|
443
|
+
body = data
|
444
|
+
end
|
445
|
+
headers['Accept'] = 'application/json'
|
446
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
447
|
+
|
448
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
449
|
+
|
450
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
451
|
+
timeout ||= @sdk_configuration.timeout
|
452
|
+
|
453
|
+
connection = @sdk_configuration.client
|
454
|
+
|
455
|
+
hook_ctx = SDKHooks::HookContext.new(
|
456
|
+
config: @sdk_configuration,
|
457
|
+
base_url: base_url,
|
458
|
+
oauth2_scopes: [],
|
459
|
+
operation_id: 'updated-media',
|
460
|
+
security_source: @sdk_configuration.security_source
|
461
|
+
)
|
462
|
+
|
463
|
+
error = T.let(nil, T.nilable(StandardError))
|
464
|
+
http_response = T.let(nil, T.nilable(Faraday::Response))
|
465
|
+
|
466
|
+
|
467
|
+
begin
|
468
|
+
http_response = connection.patch(url) do |req|
|
469
|
+
req.body = body
|
470
|
+
req.headers.merge!(headers)
|
471
|
+
req.options.timeout = timeout unless timeout.nil?
|
472
|
+
Utils.configure_request_security(req, security)
|
473
|
+
|
474
|
+
@sdk_configuration.hooks.before_request(
|
475
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
476
|
+
hook_ctx: hook_ctx
|
477
|
+
),
|
478
|
+
request: req
|
479
|
+
)
|
480
|
+
end
|
481
|
+
rescue StandardError => e
|
482
|
+
error = e
|
483
|
+
ensure
|
484
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
485
|
+
http_response = @sdk_configuration.hooks.after_error(
|
486
|
+
error: error,
|
487
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
488
|
+
hook_ctx: hook_ctx
|
489
|
+
),
|
490
|
+
response: http_response
|
491
|
+
)
|
492
|
+
else
|
493
|
+
http_response = @sdk_configuration.hooks.after_success(
|
494
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
495
|
+
hook_ctx: hook_ctx
|
496
|
+
),
|
497
|
+
response: http_response
|
498
|
+
)
|
499
|
+
end
|
500
|
+
|
501
|
+
if http_response.nil?
|
502
|
+
raise error if !error.nil?
|
503
|
+
raise 'no response'
|
504
|
+
end
|
505
|
+
end
|
506
|
+
|
507
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
508
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
509
|
+
if Utils.match_content_type(content_type, 'application/json')
|
510
|
+
http_response = @sdk_configuration.hooks.after_success(
|
511
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
512
|
+
hook_ctx: hook_ctx
|
513
|
+
),
|
514
|
+
response: http_response
|
515
|
+
)
|
516
|
+
response_data = http_response.env.response_body
|
517
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::UpdatedMediaResponseBody)
|
518
|
+
response = Models::Operations::UpdatedMediaResponse.new(
|
519
|
+
status_code: http_response.status,
|
520
|
+
content_type: content_type,
|
521
|
+
raw_response: http_response,
|
522
|
+
object: obj
|
523
|
+
)
|
524
|
+
|
525
|
+
return response
|
526
|
+
else
|
527
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
528
|
+
end
|
529
|
+
elsif Utils.match_status_code(http_response.status, ['401'])
|
530
|
+
if Utils.match_content_type(content_type, 'application/json')
|
531
|
+
http_response = @sdk_configuration.hooks.after_success(
|
532
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
533
|
+
hook_ctx: hook_ctx
|
534
|
+
),
|
535
|
+
response: http_response
|
536
|
+
)
|
537
|
+
response_data = http_response.env.response_body
|
538
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InvalidPermissionError)
|
539
|
+
throw obj
|
540
|
+
else
|
541
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
542
|
+
end
|
543
|
+
elsif Utils.match_status_code(http_response.status, ['403'])
|
544
|
+
if Utils.match_content_type(content_type, 'application/json')
|
545
|
+
http_response = @sdk_configuration.hooks.after_success(
|
546
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
547
|
+
hook_ctx: hook_ctx
|
548
|
+
),
|
549
|
+
response: http_response
|
550
|
+
)
|
551
|
+
response_data = http_response.env.response_body
|
552
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ForbiddenError)
|
553
|
+
throw obj
|
554
|
+
else
|
555
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
556
|
+
end
|
557
|
+
elsif Utils.match_status_code(http_response.status, ['404'])
|
558
|
+
if Utils.match_content_type(content_type, 'application/json')
|
559
|
+
http_response = @sdk_configuration.hooks.after_success(
|
560
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
561
|
+
hook_ctx: hook_ctx
|
562
|
+
),
|
563
|
+
response: http_response
|
564
|
+
)
|
565
|
+
response_data = http_response.env.response_body
|
566
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::MediaNotFoundError)
|
567
|
+
throw obj
|
568
|
+
else
|
569
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
570
|
+
end
|
571
|
+
elsif Utils.match_status_code(http_response.status, ['422'])
|
572
|
+
if Utils.match_content_type(content_type, 'application/json')
|
573
|
+
http_response = @sdk_configuration.hooks.after_success(
|
574
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
575
|
+
hook_ctx: hook_ctx
|
576
|
+
),
|
577
|
+
response: http_response
|
578
|
+
)
|
579
|
+
response_data = http_response.env.response_body
|
580
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ValidationErrorResponse)
|
581
|
+
throw obj
|
582
|
+
else
|
583
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
584
|
+
end
|
585
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
586
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
587
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
588
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
589
|
+
else
|
590
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
591
|
+
|
592
|
+
end
|
593
|
+
end
|
594
|
+
|
595
|
+
|
596
|
+
sig { params(media_id: ::String, timeout_ms: T.nilable(Integer)).returns(Models::Operations::DeleteMediaResponse) }
|
597
|
+
def delete_media(media_id:, timeout_ms: nil)
|
598
|
+
# delete_media - Delete a media by ID
|
599
|
+
# This endpoint allows you to permanently delete a a specific video or audio media file along with all associated data. If you wish to remove a media file from FastPix storage, use this endpoint with the **mediaId** (either **uploadId** or **id**) received during the media's creation or upload.
|
600
|
+
#
|
601
|
+
#
|
602
|
+
# #### How it works
|
603
|
+
#
|
604
|
+
#
|
605
|
+
# 1. Make a DELETE request to the **/on-demand/`<mediaId>`** endpoint, replacing `<mediaId>` with the uploadId or the id of the media you want to delete.
|
606
|
+
#
|
607
|
+
# 2. Confirm the deletion: Since this action is irreversible, ensure that you no longer need the media before proceeding. Once deleted, the media cannot be retrieved or played back.
|
608
|
+
#
|
609
|
+
# 3. Webhook event to look for: **video.media.deleted**
|
610
|
+
#
|
611
|
+
# **Use case:** A user on a video-sharing platform decides to remove an old video from their profile, or suppose you're running a content moderation system, and one of the videos uploaded by a user violates your platform's policies. Using this endpoint, the media is permanently deleted from your library, ensuring it's no longer accessible or viewable by other users.
|
612
|
+
#
|
613
|
+
request = Models::Operations::DeleteMediaRequest.new(
|
614
|
+
|
615
|
+
media_id: media_id
|
616
|
+
)
|
617
|
+
url, params = @sdk_configuration.get_server_details
|
618
|
+
base_url = Utils.template_url(url, params)
|
619
|
+
url = Utils.generate_url(
|
620
|
+
Models::Operations::DeleteMediaRequest,
|
621
|
+
base_url,
|
622
|
+
'/on-demand/{mediaId}',
|
623
|
+
request
|
624
|
+
)
|
625
|
+
headers = {}
|
626
|
+
headers['Accept'] = 'application/json'
|
627
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
628
|
+
|
629
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
630
|
+
|
631
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
632
|
+
timeout ||= @sdk_configuration.timeout
|
633
|
+
|
634
|
+
connection = @sdk_configuration.client
|
635
|
+
|
636
|
+
hook_ctx = SDKHooks::HookContext.new(
|
637
|
+
config: @sdk_configuration,
|
638
|
+
base_url: base_url,
|
639
|
+
oauth2_scopes: [],
|
640
|
+
operation_id: 'delete-media',
|
641
|
+
security_source: @sdk_configuration.security_source
|
642
|
+
)
|
643
|
+
|
644
|
+
error = T.let(nil, T.nilable(StandardError))
|
645
|
+
http_response = T.let(nil, T.nilable(Faraday::Response))
|
646
|
+
|
647
|
+
|
648
|
+
begin
|
649
|
+
http_response = connection.delete(url) do |req|
|
650
|
+
req.headers.merge!(headers)
|
651
|
+
req.options.timeout = timeout unless timeout.nil?
|
652
|
+
Utils.configure_request_security(req, security)
|
653
|
+
|
654
|
+
@sdk_configuration.hooks.before_request(
|
655
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
656
|
+
hook_ctx: hook_ctx
|
657
|
+
),
|
658
|
+
request: req
|
659
|
+
)
|
660
|
+
end
|
661
|
+
rescue StandardError => e
|
662
|
+
error = e
|
663
|
+
ensure
|
664
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
665
|
+
http_response = @sdk_configuration.hooks.after_error(
|
666
|
+
error: error,
|
667
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
668
|
+
hook_ctx: hook_ctx
|
669
|
+
),
|
670
|
+
response: http_response
|
671
|
+
)
|
672
|
+
else
|
673
|
+
http_response = @sdk_configuration.hooks.after_success(
|
674
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
675
|
+
hook_ctx: hook_ctx
|
676
|
+
),
|
677
|
+
response: http_response
|
678
|
+
)
|
679
|
+
end
|
680
|
+
|
681
|
+
if http_response.nil?
|
682
|
+
raise error if !error.nil?
|
683
|
+
raise 'no response'
|
684
|
+
end
|
685
|
+
end
|
686
|
+
|
687
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
688
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
689
|
+
if Utils.match_content_type(content_type, 'application/json')
|
690
|
+
http_response = @sdk_configuration.hooks.after_success(
|
691
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
692
|
+
hook_ctx: hook_ctx
|
693
|
+
),
|
694
|
+
response: http_response
|
695
|
+
)
|
696
|
+
response_data = http_response.env.response_body
|
697
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::DeleteMediaResponseBody)
|
698
|
+
response = Models::Operations::DeleteMediaResponse.new(
|
699
|
+
status_code: http_response.status,
|
700
|
+
content_type: content_type,
|
701
|
+
raw_response: http_response,
|
702
|
+
object: obj
|
703
|
+
)
|
704
|
+
|
705
|
+
return response
|
706
|
+
else
|
707
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
708
|
+
end
|
709
|
+
elsif Utils.match_status_code(http_response.status, ['401'])
|
710
|
+
if Utils.match_content_type(content_type, 'application/json')
|
711
|
+
http_response = @sdk_configuration.hooks.after_success(
|
712
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
713
|
+
hook_ctx: hook_ctx
|
714
|
+
),
|
715
|
+
response: http_response
|
716
|
+
)
|
717
|
+
response_data = http_response.env.response_body
|
718
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InvalidPermissionError)
|
719
|
+
throw obj
|
720
|
+
else
|
721
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
722
|
+
end
|
723
|
+
elsif Utils.match_status_code(http_response.status, ['403'])
|
724
|
+
if Utils.match_content_type(content_type, 'application/json')
|
725
|
+
http_response = @sdk_configuration.hooks.after_success(
|
726
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
727
|
+
hook_ctx: hook_ctx
|
728
|
+
),
|
729
|
+
response: http_response
|
730
|
+
)
|
731
|
+
response_data = http_response.env.response_body
|
732
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ForbiddenError)
|
733
|
+
throw obj
|
734
|
+
else
|
735
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
736
|
+
end
|
737
|
+
elsif Utils.match_status_code(http_response.status, ['404'])
|
738
|
+
if Utils.match_content_type(content_type, 'application/json')
|
739
|
+
http_response = @sdk_configuration.hooks.after_success(
|
740
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
741
|
+
hook_ctx: hook_ctx
|
742
|
+
),
|
743
|
+
response: http_response
|
744
|
+
)
|
745
|
+
response_data = http_response.env.response_body
|
746
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::MediaNotFoundError)
|
747
|
+
throw obj
|
748
|
+
else
|
749
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
750
|
+
end
|
751
|
+
elsif Utils.match_status_code(http_response.status, ['422'])
|
752
|
+
if Utils.match_content_type(content_type, 'application/json')
|
753
|
+
http_response = @sdk_configuration.hooks.after_success(
|
754
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
755
|
+
hook_ctx: hook_ctx
|
756
|
+
),
|
757
|
+
response: http_response
|
758
|
+
)
|
759
|
+
response_data = http_response.env.response_body
|
760
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ValidationErrorResponse)
|
761
|
+
throw obj
|
762
|
+
else
|
763
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
764
|
+
end
|
765
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
766
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
767
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
768
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
769
|
+
else
|
770
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
771
|
+
|
772
|
+
end
|
773
|
+
end
|
774
|
+
|
775
|
+
|
776
|
+
sig { params(media_id: ::String, timeout_ms: T.nilable(Integer)).returns(Models::Operations::RetrieveMediaInputInfoResponse) }
|
777
|
+
def retrieve_media_input_info(media_id:, timeout_ms: nil)
|
778
|
+
# retrieve_media_input_info - Get info of media inputs
|
779
|
+
# Allows you to retrieve detailed information about the media inputs associated with a specific media item. You can use this endpoint to verify the media file's input URL, track creation status, and container format. The mediaId (either uploadId or id) must be provided to fetch the information.
|
780
|
+
#
|
781
|
+
#
|
782
|
+
# #### How it works
|
783
|
+
#
|
784
|
+
#
|
785
|
+
#
|
786
|
+
# Upon making a GET request with the mediaId, FastPix returns a response that includes:
|
787
|
+
#
|
788
|
+
# * **Input-url:** The URL of the uploaded media file.
|
789
|
+
#
|
790
|
+
# * **tracks:** Information about the tracks associated with the media, including both video and audio tracks, indicating whether they have been successfully created.
|
791
|
+
#
|
792
|
+
# * **containerFormat:** The format of the uploaded media file container (e.g., MP4, MKV).
|
793
|
+
#
|
794
|
+
#
|
795
|
+
#
|
796
|
+
# This endpoint is particularly useful for ensuring that all necessary tracks (video and audio) have been correctly associated with the media during the upload or media creation process.
|
797
|
+
#
|
798
|
+
request = Models::Operations::RetrieveMediaInputInfoRequest.new(
|
799
|
+
|
800
|
+
media_id: media_id
|
801
|
+
)
|
802
|
+
url, params = @sdk_configuration.get_server_details
|
803
|
+
base_url = Utils.template_url(url, params)
|
804
|
+
url = Utils.generate_url(
|
805
|
+
Models::Operations::RetrieveMediaInputInfoRequest,
|
806
|
+
base_url,
|
807
|
+
'/on-demand/{mediaId}/input-info',
|
808
|
+
request
|
809
|
+
)
|
810
|
+
headers = {}
|
811
|
+
headers['Accept'] = 'application/json'
|
812
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
813
|
+
|
814
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
815
|
+
|
816
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
817
|
+
timeout ||= @sdk_configuration.timeout
|
818
|
+
|
819
|
+
connection = @sdk_configuration.client
|
820
|
+
|
821
|
+
hook_ctx = SDKHooks::HookContext.new(
|
822
|
+
config: @sdk_configuration,
|
823
|
+
base_url: base_url,
|
824
|
+
oauth2_scopes: [],
|
825
|
+
operation_id: 'retrieveMediaInputInfo',
|
826
|
+
security_source: @sdk_configuration.security_source
|
827
|
+
)
|
828
|
+
|
829
|
+
error = T.let(nil, T.nilable(StandardError))
|
830
|
+
http_response = T.let(nil, T.nilable(Faraday::Response))
|
831
|
+
|
832
|
+
|
833
|
+
begin
|
834
|
+
http_response = connection.get(url) do |req|
|
835
|
+
req.headers.merge!(headers)
|
836
|
+
req.options.timeout = timeout unless timeout.nil?
|
837
|
+
Utils.configure_request_security(req, security)
|
838
|
+
|
839
|
+
@sdk_configuration.hooks.before_request(
|
840
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
841
|
+
hook_ctx: hook_ctx
|
842
|
+
),
|
843
|
+
request: req
|
844
|
+
)
|
845
|
+
end
|
846
|
+
rescue StandardError => e
|
847
|
+
error = e
|
848
|
+
ensure
|
849
|
+
if http_response.nil? || Utils.error_status?(http_response.status)
|
850
|
+
http_response = @sdk_configuration.hooks.after_error(
|
851
|
+
error: error,
|
852
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
853
|
+
hook_ctx: hook_ctx
|
854
|
+
),
|
855
|
+
response: http_response
|
856
|
+
)
|
857
|
+
else
|
858
|
+
http_response = @sdk_configuration.hooks.after_success(
|
859
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
860
|
+
hook_ctx: hook_ctx
|
861
|
+
),
|
862
|
+
response: http_response
|
863
|
+
)
|
864
|
+
end
|
865
|
+
|
866
|
+
if http_response.nil?
|
867
|
+
raise error if !error.nil?
|
868
|
+
raise 'no response'
|
869
|
+
end
|
870
|
+
end
|
871
|
+
|
872
|
+
content_type = http_response.headers.fetch('Content-Type', 'application/octet-stream')
|
873
|
+
if Utils.match_status_code(http_response.status, ['200'])
|
874
|
+
if Utils.match_content_type(content_type, 'application/json')
|
875
|
+
http_response = @sdk_configuration.hooks.after_success(
|
876
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
877
|
+
hook_ctx: hook_ctx
|
878
|
+
),
|
879
|
+
response: http_response
|
880
|
+
)
|
881
|
+
response_data = http_response.env.response_body
|
882
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Operations::RetrieveMediaInputInfoResponseBody)
|
883
|
+
response = Models::Operations::RetrieveMediaInputInfoResponse.new(
|
884
|
+
status_code: http_response.status,
|
885
|
+
content_type: content_type,
|
886
|
+
raw_response: http_response,
|
887
|
+
object: obj
|
888
|
+
)
|
889
|
+
|
890
|
+
return response
|
891
|
+
else
|
892
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
893
|
+
end
|
894
|
+
elsif Utils.match_status_code(http_response.status, ['401'])
|
895
|
+
if Utils.match_content_type(content_type, 'application/json')
|
896
|
+
http_response = @sdk_configuration.hooks.after_success(
|
897
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
898
|
+
hook_ctx: hook_ctx
|
899
|
+
),
|
900
|
+
response: http_response
|
901
|
+
)
|
902
|
+
response_data = http_response.env.response_body
|
903
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::InvalidPermissionError)
|
904
|
+
throw obj
|
905
|
+
else
|
906
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
907
|
+
end
|
908
|
+
elsif Utils.match_status_code(http_response.status, ['403'])
|
909
|
+
if Utils.match_content_type(content_type, 'application/json')
|
910
|
+
http_response = @sdk_configuration.hooks.after_success(
|
911
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
912
|
+
hook_ctx: hook_ctx
|
913
|
+
),
|
914
|
+
response: http_response
|
915
|
+
)
|
916
|
+
response_data = http_response.env.response_body
|
917
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ForbiddenError)
|
918
|
+
throw obj
|
919
|
+
else
|
920
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
921
|
+
end
|
922
|
+
elsif Utils.match_status_code(http_response.status, ['404'])
|
923
|
+
if Utils.match_content_type(content_type, 'application/json')
|
924
|
+
http_response = @sdk_configuration.hooks.after_success(
|
925
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
926
|
+
hook_ctx: hook_ctx
|
927
|
+
),
|
928
|
+
response: http_response
|
929
|
+
)
|
930
|
+
response_data = http_response.env.response_body
|
931
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::MediaNotFoundError)
|
932
|
+
throw obj
|
933
|
+
else
|
934
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
935
|
+
end
|
936
|
+
elsif Utils.match_status_code(http_response.status, ['422'])
|
937
|
+
if Utils.match_content_type(content_type, 'application/json')
|
938
|
+
http_response = @sdk_configuration.hooks.after_success(
|
939
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
940
|
+
hook_ctx: hook_ctx
|
941
|
+
),
|
942
|
+
response: http_response
|
943
|
+
)
|
944
|
+
response_data = http_response.env.response_body
|
945
|
+
obj = Crystalline.unmarshal_json(JSON.parse(response_data), Models::Errors::ValidationErrorResponse)
|
946
|
+
throw obj
|
947
|
+
else
|
948
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown content type received'
|
949
|
+
end
|
950
|
+
elsif Utils.match_status_code(http_response.status, ['4XX'])
|
951
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
952
|
+
elsif Utils.match_status_code(http_response.status, ['5XX'])
|
953
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'API error occurred'
|
954
|
+
else
|
955
|
+
raise ::FastpixApiSDK::Models::Errors::APIError.new(status_code: http_response.status, body: http_response.env.response_body, raw_response: http_response), 'Unknown status code received'
|
956
|
+
|
957
|
+
end
|
958
|
+
end
|
959
|
+
end
|
960
|
+
end
|