Class: FastpixApiSDK::SDK
- Inherits:
-
Object
- Object
- FastpixApiSDK::SDK
- Extended by:
- T::Sig
- Defined in:
- lib/fastpix_api_sdk/sdk.rb
Instance Attribute Summary collapse
-
#input_video ⇒ Object
Returns the value of attribute input_video.
-
#manage_live_stream ⇒ Object
Returns the value of attribute manage_live_stream.
-
#manage_videos ⇒ Object
Returns the value of attribute manage_videos.
-
#playback ⇒ Object
Returns the value of attribute playback.
-
#simulcast_stream ⇒ Object
Returns the value of attribute simulcast_stream.
-
#start_live_stream ⇒ Object
Returns the value of attribute start_live_stream.
Instance Method Summary collapse
- #get_url(base_url:, url_variables: nil) ⇒ Object
- #init_sdks ⇒ Object
-
#initialize(client: nil, retry_config: nil, timeout_ms: nil, security: nil, security_source: nil, server_idx: nil, server_url: nil, url_params: nil) ⇒ SDK
constructor
A new instance of SDK.
Constructor Details
#initialize(client: nil, retry_config: nil, timeout_ms: nil, security: nil, security_source: nil, server_idx: nil, server_url: nil, url_params: nil) ⇒ SDK
Returns a new instance of SDK.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/fastpix_api_sdk/sdk.rb', line 33 def initialize(client: nil, retry_config: nil, timeout_ms: nil, security: nil, security_source: nil, server_idx: nil, server_url: nil, url_params: nil) ## Instantiates the SDK configuring it with the provided parameters. # @param [T.nilable(Faraday::Connection)] client The faraday HTTP client to use for all operations # @param [T.nilable(::FastpixApiSDK::Utils::RetryConfig)] retry_config The retry configuration to use for all operations # @param [T.nilable(Integer)] timeout_ms Request timeout in milliseconds for all operations # @param [T.nilable(Models::Components::Security)] security: The security details required for authentication # @param [T.proc.returns(T.nilable(Models::Components::Security))] security_source: A function that returns security details required for authentication # @param [T.nilable(::Integer)] server_idx The index of the server to use for all operations # @param [T.nilable(::String)] server_url The server URL to use for all operations # @param [T.nilable(::Hash<::Symbol, ::String>)] url_params Parameters to optionally template the server URL with = { request: { params_encoder: Faraday::FlatParamsEncoder } } [:request][:timeout] = (timeout_ms.to_f / 1000) unless timeout_ms.nil? client ||= Faraday.new(**) do |f| f.request :multipart, {} # f.response :logger, nil, { headers: true, bodies: true, errors: true } end if !server_url.nil? if !url_params.nil? server_url = Utils.template_url(server_url, url_params) end end server_idx = 0 if server_idx.nil? hooks = SDKHooks::Hooks.new @sdk_configuration = SDKConfiguration.new( client, hooks, retry_config, timeout_ms, security, security_source, server_url, server_idx ) @sdk_configuration = hooks.sdk_init(config: @sdk_configuration) init_sdks end |
Instance Attribute Details
#input_video ⇒ Object
Returns the value of attribute input_video.
19 20 21 |
# File 'lib/fastpix_api_sdk/sdk.rb', line 19 def input_video @input_video end |
#manage_live_stream ⇒ Object
Returns the value of attribute manage_live_stream.
19 20 21 |
# File 'lib/fastpix_api_sdk/sdk.rb', line 19 def manage_live_stream @manage_live_stream end |
#manage_videos ⇒ Object
Returns the value of attribute manage_videos.
19 20 21 |
# File 'lib/fastpix_api_sdk/sdk.rb', line 19 def manage_videos @manage_videos end |
#playback ⇒ Object
Returns the value of attribute playback.
19 20 21 |
# File 'lib/fastpix_api_sdk/sdk.rb', line 19 def playback @playback end |
#simulcast_stream ⇒ Object
Returns the value of attribute simulcast_stream.
19 20 21 |
# File 'lib/fastpix_api_sdk/sdk.rb', line 19 def simulcast_stream @simulcast_stream end |
#start_live_stream ⇒ Object
Returns the value of attribute start_live_stream.
19 20 21 |
# File 'lib/fastpix_api_sdk/sdk.rb', line 19 def start_live_stream @start_live_stream end |
Instance Method Details
#get_url(base_url:, url_variables: nil) ⇒ Object
89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/fastpix_api_sdk/sdk.rb', line 89 def get_url(base_url:, url_variables: nil) sd_base_url, = @sdk_configuration.get_server_details if base_url.nil? base_url = sd_base_url end if url_variables.nil? url_variables = end return Utils.template_url base_url, url_variables end |
#init_sdks ⇒ Object
79 80 81 82 83 84 85 86 |
# File 'lib/fastpix_api_sdk/sdk.rb', line 79 def init_sdks @start_live_stream = StartLiveStream.new(@sdk_configuration) @manage_live_stream = ManageLiveStream.new(@sdk_configuration) @playback = Playback.new(@sdk_configuration) @simulcast_stream = SimulcastStream.new(@sdk_configuration) @input_video = InputVideo.new(@sdk_configuration) @manage_videos = ManageVideos.new(@sdk_configuration) end |