class PureCloud::UserRecordingsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/purecloudplatformclientv2/api/user_recordings_api.rb, line 23
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

delete_userrecording(recording_id, opts = {}) click to toggle source

Delete a user recording.

@param recording_id User Recording ID @param [Hash] opts the optional parameters @return [nil]

# File lib/purecloudplatformclientv2/api/user_recordings_api.rb, line 32
def delete_userrecording(recording_id, opts = {})
  delete_userrecording_with_http_info(recording_id, opts)
  return nil
end
delete_userrecording_with_http_info(recording_id, opts = {}) click to toggle source

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

# File lib/purecloudplatformclientv2/api/user_recordings_api.rb, line 42
def delete_userrecording_with_http_info(recording_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: UserRecordingsApi.delete_userrecording ..."
  end
  
  
  # verify the required parameter 'recording_id' is set
  fail ArgumentError, "Missing the required parameter 'recording_id' when calling UserRecordingsApi.delete_userrecording" 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)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud OAuth']
  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_userrecording\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_userrecording(recording_id, opts = {}) click to toggle source

Get a user recording.

@param recording_id User Recording ID @param [Hash] opts the optional parameters @option opts [Array<String>] :expand Which fields, if any, to expand. @return [UserRecording]

# File lib/purecloudplatformclientv2/api/user_recordings_api.rb, line 97
def get_userrecording(recording_id, opts = {})
  data, _status_code, _headers = get_userrecording_with_http_info(recording_id, opts)
  return data
end
get_userrecording_media(recording_id, opts = {}) click to toggle source

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. (default to WEBM) @return [DownloadResponse]

# File lib/purecloudplatformclientv2/api/user_recordings_api.rb, line 171
def get_userrecording_media(recording_id, opts = {})
  data, _status_code, _headers = get_userrecording_media_with_http_info(recording_id, opts)
  return data
end
get_userrecording_media_with_http_info(recording_id, opts = {}) click to toggle source

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. @return [Array<(DownloadResponse, Fixnum, Hash)>] DownloadResponse data, response status code and response headers

# File lib/purecloudplatformclientv2/api/user_recordings_api.rb, line 182
def get_userrecording_media_with_http_info(recording_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: UserRecordingsApi.get_userrecording_media ..."
  end
  
  
  # verify the required parameter 'recording_id' is set
  fail ArgumentError, "Missing the required parameter 'recording_id' when calling UserRecordingsApi.get_userrecording_media" if recording_id.nil?
  
  
  
  
  
  
  
  
  if opts[:'format_id'] && !['WAV', 'WEBM', 'WAV_ULAW', 'OGG_VORBIS', 'OGG_OPUS', 'MP3', 'NONE'].include?(opts[:'format_id'])
    fail ArgumentError, 'invalid value for "format_id", must be one of WAV, WEBM, WAV_ULAW, OGG_VORBIS, OGG_OPUS, MP3, NONE'
  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)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud OAuth']
  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_userrecording_media\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_userrecording_with_http_info(recording_id, opts = {}) click to toggle source

Get a user recording.

@param recording_id User Recording ID @param [Hash] opts the optional parameters @option opts [Array<String>] :expand Which fields, if any, to expand. @return [Array<(UserRecording, Fixnum, Hash)>] UserRecording data, response status code and response headers

# File lib/purecloudplatformclientv2/api/user_recordings_api.rb, line 108
def get_userrecording_with_http_info(recording_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: UserRecordingsApi.get_userrecording ..."
  end
  
  
  # verify the required parameter 'recording_id' is set
  fail ArgumentError, "Missing the required parameter 'recording_id' when calling UserRecordingsApi.get_userrecording" 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'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud OAuth']
  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_userrecording\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_userrecordings(opts = {}) click to toggle source

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 [Array<String>] :expand Which fields, if any, to expand. @return [UserRecordingEntityListing]

# File lib/purecloudplatformclientv2/api/user_recordings_api.rb, line 250
def get_userrecordings(opts = {})
  data, _status_code, _headers = get_userrecordings_with_http_info(opts)
  return data
end
get_userrecordings_summary(opts = {}) click to toggle source

Get user recording summary

@param [Hash] opts the optional parameters @return [FaxSummary]

# File lib/purecloudplatformclientv2/api/user_recordings_api.rb, line 329
def get_userrecordings_summary(opts = {})
  data, _status_code, _headers = get_userrecordings_summary_with_http_info(opts)
  return data
end
get_userrecordings_summary_with_http_info(opts = {}) click to toggle source

Get user recording summary

@param [Hash] opts the optional parameters @return [Array<(FaxSummary, Fixnum, Hash)>] FaxSummary data, response status code and response headers

# File lib/purecloudplatformclientv2/api/user_recordings_api.rb, line 338
def get_userrecordings_summary_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: UserRecordingsApi.get_userrecordings_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)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud OAuth']
  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_userrecordings_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_userrecordings_with_http_info(opts = {}) click to toggle source

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 [Array<String>] :expand Which fields, if any, to expand. @return [Array<(UserRecordingEntityListing, Fixnum, Hash)>] UserRecordingEntityListing data, response status code and response headers

# File lib/purecloudplatformclientv2/api/user_recordings_api.rb, line 262
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'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  
  auth_names = ['PureCloud OAuth']
  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
put_userrecording(recording_id, body, opts = {}) click to toggle source

Update a user recording.

@param recording_id User Recording ID @param body UserRecording @param [Hash] opts the optional parameters @option opts [Array<String>] :expand Which fields, if any, to expand. @return [UserRecording]

# File lib/purecloudplatformclientv2/api/user_recordings_api.rb, line 387
def put_userrecording(recording_id, body, opts = {})
  data, _status_code, _headers = put_userrecording_with_http_info(recording_id, body, opts)
  return data
end
put_userrecording_with_http_info(recording_id, body, opts = {}) click to toggle source

Update a user recording.

@param recording_id User Recording ID @param body UserRecording @param [Hash] opts the optional parameters @option opts [Array<String>] :expand Which fields, if any, to expand. @return [Array<(UserRecording, Fixnum, Hash)>] UserRecording data, response status code and response headers

# File lib/purecloudplatformclientv2/api/user_recordings_api.rb, line 399
def put_userrecording_with_http_info(recording_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: UserRecordingsApi.put_userrecording ..."
  end
  
  
  # verify the required parameter 'recording_id' is set
  fail ArgumentError, "Missing the required parameter 'recording_id' when calling UserRecordingsApi.put_userrecording" if recording_id.nil?
  
  
  
  
  
  
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling UserRecordingsApi.put_userrecording" if body.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'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand']

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  local_header_accept = ['application/json']
  local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result

  # HTTP header 'Content-Type'
  local_header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  
  auth_names = ['PureCloud OAuth']
  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_userrecording\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end