=begin #Mux API #Mux is how developers build online video. This API encompasses both Mux Video and Mux Data functionality to help you build your video-related projects better and faster than ever before. The version of the OpenAPI document: v1 Contact: devex@mux.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 5.0.1 =end require 'cgi' module MuxRuby class WebInputsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Create a new Web Input # Create a new Web Input # @param create_web_input_request [CreateWebInputRequest] # @param [Hash] opts the optional parameters # @return [WebInputResponse] def create_web_input(create_web_input_request, opts = {}) data, _status_code, _headers = create_web_input_with_http_info(create_web_input_request, opts) data end # Create a new Web Input # Create a new Web Input # @param create_web_input_request [CreateWebInputRequest] # @param [Hash] opts the optional parameters # @return [Array<(WebInputResponse, Integer, Hash)>] WebInputResponse data, response status code and response headers def create_web_input_with_http_info(create_web_input_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WebInputsApi.create_web_input ...' end # verify the required parameter 'create_web_input_request' is set if @api_client.config.client_side_validation && create_web_input_request.nil? fail ArgumentError, "Missing the required parameter 'create_web_input_request' when calling WebInputsApi.create_web_input" end # resource path local_var_path = '/video/v1/web-inputs' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_web_input_request) # return_type return_type = opts[:debug_return_type] || 'WebInputResponse' # auth_names auth_names = opts[:debug_auth_names] || ['accessToken'] new_options = opts.merge( :operation => :"WebInputsApi.create_web_input", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebInputsApi#create_web_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a Web Input # Deletes a Web Input and all its data # @param web_input_id [String] The Web Input ID # @param [Hash] opts the optional parameters # @return [nil] def delete_web_input(web_input_id, opts = {}) delete_web_input_with_http_info(web_input_id, opts) nil end # Delete a Web Input # Deletes a Web Input and all its data # @param web_input_id [String] The Web Input ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_web_input_with_http_info(web_input_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WebInputsApi.delete_web_input ...' end # verify the required parameter 'web_input_id' is set if @api_client.config.client_side_validation && web_input_id.nil? fail ArgumentError, "Missing the required parameter 'web_input_id' when calling WebInputsApi.delete_web_input" end # resource path local_var_path = '/video/v1/web-inputs/{WEB_INPUT_ID}'.sub('{' + 'WEB_INPUT_ID' + '}', CGI.escape(web_input_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || ['accessToken'] new_options = opts.merge( :operation => :"WebInputsApi.delete_web_input", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebInputsApi#delete_web_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve a Web Input # Retrieve a single Web Input's info # @param web_input_id [String] The Web Input ID # @param [Hash] opts the optional parameters # @return [WebInputResponse] def get_web_input(web_input_id, opts = {}) data, _status_code, _headers = get_web_input_with_http_info(web_input_id, opts) data end # Retrieve a Web Input # Retrieve a single Web Input's info # @param web_input_id [String] The Web Input ID # @param [Hash] opts the optional parameters # @return [Array<(WebInputResponse, Integer, Hash)>] WebInputResponse data, response status code and response headers def get_web_input_with_http_info(web_input_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WebInputsApi.get_web_input ...' end # verify the required parameter 'web_input_id' is set if @api_client.config.client_side_validation && web_input_id.nil? fail ArgumentError, "Missing the required parameter 'web_input_id' when calling WebInputsApi.get_web_input" end # resource path local_var_path = '/video/v1/web-inputs/{WEB_INPUT_ID}'.sub('{' + 'WEB_INPUT_ID' + '}', CGI.escape(web_input_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'WebInputResponse' # auth_names auth_names = opts[:debug_auth_names] || ['accessToken'] new_options = opts.merge( :operation => :"WebInputsApi.get_web_input", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebInputsApi#get_web_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Launch a Web Input # Launches the browsers instance, loads the URL specified, and then starts streaming to the specified Live Stream. # @param web_input_id [String] The Web Input ID # @param [Hash] opts the optional parameters # @return [LaunchWebInputResponse] def launch_web_input(web_input_id, opts = {}) data, _status_code, _headers = launch_web_input_with_http_info(web_input_id, opts) data end # Launch a Web Input # Launches the browsers instance, loads the URL specified, and then starts streaming to the specified Live Stream. # @param web_input_id [String] The Web Input ID # @param [Hash] opts the optional parameters # @return [Array<(LaunchWebInputResponse, Integer, Hash)>] LaunchWebInputResponse data, response status code and response headers def launch_web_input_with_http_info(web_input_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WebInputsApi.launch_web_input ...' end # verify the required parameter 'web_input_id' is set if @api_client.config.client_side_validation && web_input_id.nil? fail ArgumentError, "Missing the required parameter 'web_input_id' when calling WebInputsApi.launch_web_input" end # resource path local_var_path = '/video/v1/web-inputs/{WEB_INPUT_ID}/launch'.sub('{' + 'WEB_INPUT_ID' + '}', CGI.escape(web_input_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'LaunchWebInputResponse' # auth_names auth_names = opts[:debug_auth_names] || ['accessToken'] new_options = opts.merge( :operation => :"WebInputsApi.launch_web_input", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebInputsApi#launch_web_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Web Inputs # List Web Inputs # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of items to include in the response (default to 25) # @option opts [Integer] :page Offset by this many pages, of the size of `limit` (default to 1) # @return [ListWebInputsResponse] def list_web_inputs(opts = {}) data, _status_code, _headers = list_web_inputs_with_http_info(opts) data end # List Web Inputs # List Web Inputs # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of items to include in the response # @option opts [Integer] :page Offset by this many pages, of the size of `limit` # @return [Array<(ListWebInputsResponse, Integer, Hash)>] ListWebInputsResponse data, response status code and response headers def list_web_inputs_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WebInputsApi.list_web_inputs ...' end # resource path local_var_path = '/video/v1/web-inputs' # query parameters query_params = opts[:query_params] || {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListWebInputsResponse' # auth_names auth_names = opts[:debug_auth_names] || ['accessToken'] new_options = opts.merge( :operation => :"WebInputsApi.list_web_inputs", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebInputsApi#list_web_inputs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Reload a Web Input # Reloads the page that a Web Input is displaying. Note: Using this when the Web Input is streaming will display the page reloading. # @param web_input_id [String] The Web Input ID # @param [Hash] opts the optional parameters # @return [ReloadWebInputResponse] def reload_web_input(web_input_id, opts = {}) data, _status_code, _headers = reload_web_input_with_http_info(web_input_id, opts) data end # Reload a Web Input # Reloads the page that a Web Input is displaying. Note: Using this when the Web Input is streaming will display the page reloading. # @param web_input_id [String] The Web Input ID # @param [Hash] opts the optional parameters # @return [Array<(ReloadWebInputResponse, Integer, Hash)>] ReloadWebInputResponse data, response status code and response headers def reload_web_input_with_http_info(web_input_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WebInputsApi.reload_web_input ...' end # verify the required parameter 'web_input_id' is set if @api_client.config.client_side_validation && web_input_id.nil? fail ArgumentError, "Missing the required parameter 'web_input_id' when calling WebInputsApi.reload_web_input" end # resource path local_var_path = '/video/v1/web-inputs/{WEB_INPUT_ID}/reload'.sub('{' + 'WEB_INPUT_ID' + '}', CGI.escape(web_input_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ReloadWebInputResponse' # auth_names auth_names = opts[:debug_auth_names] || ['accessToken'] new_options = opts.merge( :operation => :"WebInputsApi.reload_web_input", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebInputsApi#reload_web_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Shut down a Web Input # Ends streaming to the specified Live Stream, and then shuts down the Web Input browser instance. # @param web_input_id [String] The Web Input ID # @param [Hash] opts the optional parameters # @return [ShutdownWebInputResponse] def shutdown_web_input(web_input_id, opts = {}) data, _status_code, _headers = shutdown_web_input_with_http_info(web_input_id, opts) data end # Shut down a Web Input # Ends streaming to the specified Live Stream, and then shuts down the Web Input browser instance. # @param web_input_id [String] The Web Input ID # @param [Hash] opts the optional parameters # @return [Array<(ShutdownWebInputResponse, Integer, Hash)>] ShutdownWebInputResponse data, response status code and response headers def shutdown_web_input_with_http_info(web_input_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WebInputsApi.shutdown_web_input ...' end # verify the required parameter 'web_input_id' is set if @api_client.config.client_side_validation && web_input_id.nil? fail ArgumentError, "Missing the required parameter 'web_input_id' when calling WebInputsApi.shutdown_web_input" end # resource path local_var_path = '/video/v1/web-inputs/{WEB_INPUT_ID}/shutdown'.sub('{' + 'WEB_INPUT_ID' + '}', CGI.escape(web_input_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ShutdownWebInputResponse' # auth_names auth_names = opts[:debug_auth_names] || ['accessToken'] new_options = opts.merge( :operation => :"WebInputsApi.shutdown_web_input", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebInputsApi#shutdown_web_input\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update Web Input URL # Changes the URL that a Web Input loads when it launches. Note: This can only be called when the Web Input is idle. # @param web_input_id [String] The Web Input ID # @param update_web_input_url_request [UpdateWebInputUrlRequest] # @param [Hash] opts the optional parameters # @return [WebInputResponse] def update_web_input_url(web_input_id, update_web_input_url_request, opts = {}) data, _status_code, _headers = update_web_input_url_with_http_info(web_input_id, update_web_input_url_request, opts) data end # Update Web Input URL # Changes the URL that a Web Input loads when it launches. Note: This can only be called when the Web Input is idle. # @param web_input_id [String] The Web Input ID # @param update_web_input_url_request [UpdateWebInputUrlRequest] # @param [Hash] opts the optional parameters # @return [Array<(WebInputResponse, Integer, Hash)>] WebInputResponse data, response status code and response headers def update_web_input_url_with_http_info(web_input_id, update_web_input_url_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: WebInputsApi.update_web_input_url ...' end # verify the required parameter 'web_input_id' is set if @api_client.config.client_side_validation && web_input_id.nil? fail ArgumentError, "Missing the required parameter 'web_input_id' when calling WebInputsApi.update_web_input_url" end # verify the required parameter 'update_web_input_url_request' is set if @api_client.config.client_side_validation && update_web_input_url_request.nil? fail ArgumentError, "Missing the required parameter 'update_web_input_url_request' when calling WebInputsApi.update_web_input_url" end # resource path local_var_path = '/video/v1/web-inputs/{WEB_INPUT_ID}/url'.sub('{' + 'WEB_INPUT_ID' + '}', CGI.escape(web_input_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(update_web_input_url_request) # return_type return_type = opts[:debug_return_type] || 'WebInputResponse' # auth_names auth_names = opts[:debug_auth_names] || ['accessToken'] new_options = opts.merge( :operation => :"WebInputsApi.update_web_input_url", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: WebInputsApi#update_web_input_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end