=begin PureCloud API PureCloud API OpenAPI spec version: v1 Contact: chuck.pulfer@inin.com Generated by: https://github.com/swagger-api/swagger-codegen.git License: ININ http://www.inin.com Terms of Service: http://www.inin.com =end require "uri" module PureCloud class UserRecordingsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Delete a user recording. # # @param recording_id User Recording ID # @param [Hash] opts the optional parameters # @return [nil] def delete_recording_id(recording_id, opts = {}) delete_recording_id_with_http_info(recording_id, opts) return nil end # Delete a user recording. # # @param recording_id User Recording ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_recording_id_with_http_info(recording_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UserRecordingsApi#delete_recording_id ..." end # verify the required parameter 'recording_id' is set fail "Missing the required parameter 'recording_id' when calling delete_recording_id" if recording_id.nil? # resource path local_var_path = "/api/v2/userrecordings/{recordingId}".sub('{format}','json').sub('{' + 'recordingId' + '}', recording_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: UserRecordingsApi#delete_recording_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a user recording. # # @param recording_id User Recording ID # @param [Hash] opts the optional parameters # @option opts [String] :expand conversation # @return [UserRecording] def get_recording_id(recording_id, opts = {}) data, status_code, headers = get_recording_id_with_http_info(recording_id, opts) return data end # Get a user recording. # # @param recording_id User Recording ID # @param [Hash] opts the optional parameters # @option opts [String] :expand conversation # @return [Array<(UserRecording, Fixnum, Hash)>] UserRecording data, response status code and response headers def get_recording_id_with_http_info(recording_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UserRecordingsApi#get_recording_id ..." end # verify the required parameter 'recording_id' is set fail "Missing the required parameter 'recording_id' when calling get_recording_id" if recording_id.nil? # resource path local_var_path = "/api/v2/userrecordings/{recordingId}".sub('{format}','json').sub('{' + 'recordingId' + '}', recording_id.to_s) # query parameters query_params = {} query_params[:'expand'] = opts[:'expand'] if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UserRecording') if @api_client.config.debugging @api_client.config.logger.debug "API called: UserRecordingsApi#get_recording_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Download a user recording. # # @param recording_id User Recording ID # @param [Hash] opts the optional parameters # @option opts [String] :format_id The desired media format (WEBM, WAV) (default to WEBM) # @return [DownloadResponse] def get_recording_id_media(recording_id, opts = {}) data, status_code, headers = get_recording_id_media_with_http_info(recording_id, opts) return data end # Download a user recording. # # @param recording_id User Recording ID # @param [Hash] opts the optional parameters # @option opts [String] :format_id The desired media format (WEBM, WAV) # @return [Array<(DownloadResponse, Fixnum, Hash)>] DownloadResponse data, response status code and response headers def get_recording_id_media_with_http_info(recording_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UserRecordingsApi#get_recording_id_media ..." end # verify the required parameter 'recording_id' is set fail "Missing the required parameter 'recording_id' when calling get_recording_id_media" if recording_id.nil? if opts[:'format_id'] && !['WEBM', 'WAV'].include?(opts[:'format_id']) fail 'invalid value for "format_id", must be one of WEBM, WAV' end # resource path local_var_path = "/api/v2/userrecordings/{recordingId}/media".sub('{format}','json').sub('{' + 'recordingId' + '}', recording_id.to_s) # query parameters query_params = {} query_params[:'formatId'] = opts[:'format_id'] if opts[:'format_id'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'DownloadResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: UserRecordingsApi#get_recording_id_media\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get user recording summary # # @param [Hash] opts the optional parameters # @return [FaxSummary] def get_summary(opts = {}) data, status_code, headers = get_summary_with_http_info(opts) return data end # Get user recording summary # # @param [Hash] opts the optional parameters # @return [Array<(FaxSummary, Fixnum, Hash)>] FaxSummary data, response status code and response headers def get_summary_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UserRecordingsApi#get_summary ..." end # resource path local_var_path = "/api/v2/userrecordings/summary".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'FaxSummary') if @api_client.config.debugging @api_client.config.logger.debug "API called: UserRecordingsApi#get_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a list of user recordings. # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size (default to 25) # @option opts [Integer] :page_number Page number (default to 1) # @option opts [String] :expand conversation # @return [UserRecordingEntityListing] def get_userrecordings(opts = {}) data, status_code, headers = get_userrecordings_with_http_info(opts) return data end # Get a list of user recordings. # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [String] :expand conversation # @return [Array<(UserRecordingEntityListing, Fixnum, Hash)>] UserRecordingEntityListing data, response status code and response headers def get_userrecordings_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UserRecordingsApi#get_userrecordings ..." end # resource path local_var_path = "/api/v2/userrecordings".sub('{format}','json') # query parameters query_params = {} query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'expand'] = opts[:'expand'] if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UserRecordingEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: UserRecordingsApi#get_userrecordings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a user recording. # # @param recording_id User Recording ID # @param [Hash] opts the optional parameters # @option opts [UserRecording] :body UserRecording # @option opts [String] :expand conversation # @return [UserRecording] def put_recording_id(recording_id, opts = {}) data, status_code, headers = put_recording_id_with_http_info(recording_id, opts) return data end # Update a user recording. # # @param recording_id User Recording ID # @param [Hash] opts the optional parameters # @option opts [UserRecording] :body UserRecording # @option opts [String] :expand conversation # @return [Array<(UserRecording, Fixnum, Hash)>] UserRecording data, response status code and response headers def put_recording_id_with_http_info(recording_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UserRecordingsApi#put_recording_id ..." end # verify the required parameter 'recording_id' is set fail "Missing the required parameter 'recording_id' when calling put_recording_id" if recording_id.nil? # resource path local_var_path = "/api/v2/userrecordings/{recordingId}".sub('{format}','json').sub('{' + 'recordingId' + '}', recording_id.to_s) # query parameters query_params = {} query_params[:'expand'] = opts[:'expand'] if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UserRecording') if @api_client.config.debugging @api_client.config.logger.debug "API called: UserRecordingsApi#put_recording_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end