=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 TranscriptionVocabulariesApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Create a Transcription Vocabulary # Create a new Transcription Vocabulary. # @param create_transcription_vocabulary_request [CreateTranscriptionVocabularyRequest] # @param [Hash] opts the optional parameters # @return [TranscriptionVocabularyResponse] def create_transcription_vocabulary(create_transcription_vocabulary_request, opts = {}) data, _status_code, _headers = create_transcription_vocabulary_with_http_info(create_transcription_vocabulary_request, opts) data end # Create a Transcription Vocabulary # Create a new Transcription Vocabulary. # @param create_transcription_vocabulary_request [CreateTranscriptionVocabularyRequest] # @param [Hash] opts the optional parameters # @return [Array<(TranscriptionVocabularyResponse, Integer, Hash)>] TranscriptionVocabularyResponse data, response status code and response headers def create_transcription_vocabulary_with_http_info(create_transcription_vocabulary_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranscriptionVocabulariesApi.create_transcription_vocabulary ...' end # verify the required parameter 'create_transcription_vocabulary_request' is set if @api_client.config.client_side_validation && create_transcription_vocabulary_request.nil? fail ArgumentError, "Missing the required parameter 'create_transcription_vocabulary_request' when calling TranscriptionVocabulariesApi.create_transcription_vocabulary" end # resource path local_var_path = '/video/v1/transcription-vocabularies' # 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_transcription_vocabulary_request) # return_type return_type = opts[:debug_return_type] || 'TranscriptionVocabularyResponse' # auth_names auth_names = opts[:debug_auth_names] || ['accessToken'] new_options = opts.merge( :operation => :"TranscriptionVocabulariesApi.create_transcription_vocabulary", :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: TranscriptionVocabulariesApi#create_transcription_vocabulary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete a Transcription Vocabulary # Deletes a Transcription Vocabulary. The Transcription Vocabulary's ID will be disassociated from any live streams using it. Transcription Vocabularies can be deleted while associated live streams are active. However, the words and phrases in the deleted Transcription Vocabulary will remain attached to those streams while they are active. # @param transcription_vocabulary_id [String] The ID of the Transcription Vocabulary. # @param [Hash] opts the optional parameters # @return [nil] def delete_transcription_vocabulary(transcription_vocabulary_id, opts = {}) delete_transcription_vocabulary_with_http_info(transcription_vocabulary_id, opts) nil end # Delete a Transcription Vocabulary # Deletes a Transcription Vocabulary. The Transcription Vocabulary's ID will be disassociated from any live streams using it. Transcription Vocabularies can be deleted while associated live streams are active. However, the words and phrases in the deleted Transcription Vocabulary will remain attached to those streams while they are active. # @param transcription_vocabulary_id [String] The ID of the Transcription Vocabulary. # @param [Hash] opts the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_transcription_vocabulary_with_http_info(transcription_vocabulary_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranscriptionVocabulariesApi.delete_transcription_vocabulary ...' end # verify the required parameter 'transcription_vocabulary_id' is set if @api_client.config.client_side_validation && transcription_vocabulary_id.nil? fail ArgumentError, "Missing the required parameter 'transcription_vocabulary_id' when calling TranscriptionVocabulariesApi.delete_transcription_vocabulary" end # resource path local_var_path = '/video/v1/transcription-vocabularies/{TRANSCRIPTION_VOCABULARY_ID}'.sub('{' + 'TRANSCRIPTION_VOCABULARY_ID' + '}', CGI.escape(transcription_vocabulary_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 => :"TranscriptionVocabulariesApi.delete_transcription_vocabulary", :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: TranscriptionVocabulariesApi#delete_transcription_vocabulary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Retrieve a Transcription Vocabulary # Retrieves the details of a Transcription Vocabulary that has previously been created. Supply the unique Transcription Vocabulary ID and Mux will return the corresponding Transcription Vocabulary information. The same information is returned when creating a Transcription Vocabulary. # @param transcription_vocabulary_id [String] The ID of the Transcription Vocabulary. # @param [Hash] opts the optional parameters # @return [TranscriptionVocabularyResponse] def get_transcription_vocabulary(transcription_vocabulary_id, opts = {}) data, _status_code, _headers = get_transcription_vocabulary_with_http_info(transcription_vocabulary_id, opts) data end # Retrieve a Transcription Vocabulary # Retrieves the details of a Transcription Vocabulary that has previously been created. Supply the unique Transcription Vocabulary ID and Mux will return the corresponding Transcription Vocabulary information. The same information is returned when creating a Transcription Vocabulary. # @param transcription_vocabulary_id [String] The ID of the Transcription Vocabulary. # @param [Hash] opts the optional parameters # @return [Array<(TranscriptionVocabularyResponse, Integer, Hash)>] TranscriptionVocabularyResponse data, response status code and response headers def get_transcription_vocabulary_with_http_info(transcription_vocabulary_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranscriptionVocabulariesApi.get_transcription_vocabulary ...' end # verify the required parameter 'transcription_vocabulary_id' is set if @api_client.config.client_side_validation && transcription_vocabulary_id.nil? fail ArgumentError, "Missing the required parameter 'transcription_vocabulary_id' when calling TranscriptionVocabulariesApi.get_transcription_vocabulary" end # resource path local_var_path = '/video/v1/transcription-vocabularies/{TRANSCRIPTION_VOCABULARY_ID}'.sub('{' + 'TRANSCRIPTION_VOCABULARY_ID' + '}', CGI.escape(transcription_vocabulary_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] || 'TranscriptionVocabularyResponse' # auth_names auth_names = opts[:debug_auth_names] || ['accessToken'] new_options = opts.merge( :operation => :"TranscriptionVocabulariesApi.get_transcription_vocabulary", :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: TranscriptionVocabulariesApi#get_transcription_vocabulary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List Transcription Vocabularies # List all Transcription Vocabularies. # @param [Hash] opts the optional parameters # @option opts [Integer] :limit Number of items to include in the response (default to 10) # @option opts [Integer] :page Offset by this many pages, of the size of `limit` (default to 1) # @return [ListTranscriptionVocabulariesResponse] def list_transcription_vocabularies(opts = {}) data, _status_code, _headers = list_transcription_vocabularies_with_http_info(opts) data end # List Transcription Vocabularies # List all Transcription Vocabularies. # @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<(ListTranscriptionVocabulariesResponse, Integer, Hash)>] ListTranscriptionVocabulariesResponse data, response status code and response headers def list_transcription_vocabularies_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranscriptionVocabulariesApi.list_transcription_vocabularies ...' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 10 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling TranscriptionVocabulariesApi.list_transcription_vocabularies, must be smaller than or equal to 10.' end # resource path local_var_path = '/video/v1/transcription-vocabularies' # 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] || 'ListTranscriptionVocabulariesResponse' # auth_names auth_names = opts[:debug_auth_names] || ['accessToken'] new_options = opts.merge( :operation => :"TranscriptionVocabulariesApi.list_transcription_vocabularies", :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: TranscriptionVocabulariesApi#list_transcription_vocabularies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a Transcription Vocabulary # Updates the details of a previously-created Transcription Vocabulary. Updates to Transcription Vocabularies are allowed while associated live streams are active. However, updates will not be applied to those streams while they are active. # @param transcription_vocabulary_id [String] The ID of the Transcription Vocabulary. # @param update_transcription_vocabulary_request [UpdateTranscriptionVocabularyRequest] # @param [Hash] opts the optional parameters # @return [TranscriptionVocabularyResponse] def update_transcription_vocabulary(transcription_vocabulary_id, update_transcription_vocabulary_request, opts = {}) data, _status_code, _headers = update_transcription_vocabulary_with_http_info(transcription_vocabulary_id, update_transcription_vocabulary_request, opts) data end # Update a Transcription Vocabulary # Updates the details of a previously-created Transcription Vocabulary. Updates to Transcription Vocabularies are allowed while associated live streams are active. However, updates will not be applied to those streams while they are active. # @param transcription_vocabulary_id [String] The ID of the Transcription Vocabulary. # @param update_transcription_vocabulary_request [UpdateTranscriptionVocabularyRequest] # @param [Hash] opts the optional parameters # @return [Array<(TranscriptionVocabularyResponse, Integer, Hash)>] TranscriptionVocabularyResponse data, response status code and response headers def update_transcription_vocabulary_with_http_info(transcription_vocabulary_id, update_transcription_vocabulary_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TranscriptionVocabulariesApi.update_transcription_vocabulary ...' end # verify the required parameter 'transcription_vocabulary_id' is set if @api_client.config.client_side_validation && transcription_vocabulary_id.nil? fail ArgumentError, "Missing the required parameter 'transcription_vocabulary_id' when calling TranscriptionVocabulariesApi.update_transcription_vocabulary" end # verify the required parameter 'update_transcription_vocabulary_request' is set if @api_client.config.client_side_validation && update_transcription_vocabulary_request.nil? fail ArgumentError, "Missing the required parameter 'update_transcription_vocabulary_request' when calling TranscriptionVocabulariesApi.update_transcription_vocabulary" end # resource path local_var_path = '/video/v1/transcription-vocabularies/{TRANSCRIPTION_VOCABULARY_ID}'.sub('{' + 'TRANSCRIPTION_VOCABULARY_ID' + '}', CGI.escape(transcription_vocabulary_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_transcription_vocabulary_request) # return_type return_type = opts[:debug_return_type] || 'TranscriptionVocabularyResponse' # auth_names auth_names = opts[:debug_auth_names] || ['accessToken'] new_options = opts.merge( :operation => :"TranscriptionVocabulariesApi.update_transcription_vocabulary", :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: TranscriptionVocabulariesApi#update_transcription_vocabulary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end