class PureCloud::NotificationsApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

delete_channels_channel_id_subscriptions(channel_id, opts = {}) click to toggle source

Remove all subscriptions

@param channel_id Channel ID @param [Hash] opts the optional parameters @return [nil]

# File lib/purecloud/api/notifications_api.rb, line 32
def delete_channels_channel_id_subscriptions(channel_id, opts = {})
  delete_channels_channel_id_subscriptions_with_http_info(channel_id, opts)
  return nil
end
delete_channels_channel_id_subscriptions_with_http_info(channel_id, opts = {}) click to toggle source

Remove all subscriptions

@param channel_id Channel ID @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers

# File lib/purecloud/api/notifications_api.rb, line 42
def delete_channels_channel_id_subscriptions_with_http_info(channel_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: NotificationsApi#delete_channels_channel_id_subscriptions ..."
  end
  
  # verify the required parameter 'channel_id' is set
  fail "Missing the required parameter 'channel_id' when calling delete_channels_channel_id_subscriptions" if channel_id.nil?
  
  # resource path
  local_var_path = "/api/v2/notifications/channels/{channelId}/subscriptions".sub('{format}','json').sub('{' + 'channelId' + '}', channel_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: NotificationsApi#delete_channels_channel_id_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_availabletopics(opts = {}) click to toggle source

Get available notification topics.

@param [Hash] opts the optional parameters @option opts [Array<String>] :expand Which fields, if any, to expand @return [AvailableTopicEntityListing]

# File lib/purecloud/api/notifications_api.rb, line 91
def get_availabletopics(opts = {})
  data, status_code, headers = get_availabletopics_with_http_info(opts)
  return data
end
get_availabletopics_with_http_info(opts = {}) click to toggle source

Get available notification topics.

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

# File lib/purecloud/api/notifications_api.rb, line 101
def get_availabletopics_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: NotificationsApi#get_availabletopics ..."
  end
  
  # resource path
  local_var_path = "/api/v2/notifications/availabletopics".sub('{format}','json')

  # 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)
  _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 => 'AvailableTopicEntityListing')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotificationsApi#get_availabletopics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_channels(opts = {}) click to toggle source

The list of existing channels

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

# File lib/purecloud/api/notifications_api.rb, line 148
def get_channels(opts = {})
  data, status_code, headers = get_channels_with_http_info(opts)
  return data
end
get_channels_channel_id_subscriptions(channel_id, opts = {}) click to toggle source

The list of all subscriptions for this channel

@param channel_id Channel ID @param [Hash] opts the optional parameters @return [ChannelTopicEntityListing]

# File lib/purecloud/api/notifications_api.rb, line 204
def get_channels_channel_id_subscriptions(channel_id, opts = {})
  data, status_code, headers = get_channels_channel_id_subscriptions_with_http_info(channel_id, opts)
  return data
end
get_channels_channel_id_subscriptions_with_http_info(channel_id, opts = {}) click to toggle source

The list of all subscriptions for this channel

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

# File lib/purecloud/api/notifications_api.rb, line 214
def get_channels_channel_id_subscriptions_with_http_info(channel_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: NotificationsApi#get_channels_channel_id_subscriptions ..."
  end
  
  # verify the required parameter 'channel_id' is set
  fail "Missing the required parameter 'channel_id' when calling get_channels_channel_id_subscriptions" if channel_id.nil?
  
  # resource path
  local_var_path = "/api/v2/notifications/channels/{channelId}/subscriptions".sub('{format}','json').sub('{' + 'channelId' + '}', channel_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(: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 => 'ChannelTopicEntityListing')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotificationsApi#get_channels_channel_id_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_channels_with_http_info(opts = {}) click to toggle source

The list of existing channels

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

# File lib/purecloud/api/notifications_api.rb, line 157
def get_channels_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: NotificationsApi#get_channels ..."
  end
  
  # resource path
  local_var_path = "/api/v2/notifications/channels".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 => 'ChannelEntityListing')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotificationsApi#get_channels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_channels(opts = {}) click to toggle source

Create a new channel There is a limit of 10 channels. Creating an 11th channel will remove the channel with oldest last used date. @param [Hash] opts the optional parameters @return [Channel]

# File lib/purecloud/api/notifications_api.rb, line 263
def post_channels(opts = {})
  data, status_code, headers = post_channels_with_http_info(opts)
  return data
end
post_channels_channel_id_subscriptions(channel_id, body, opts = {}) click to toggle source

Add a list of subscriptions to the existing list of subscriptions

@param channel_id Channel ID @param body Body @param [Hash] opts the optional parameters @return [ChannelTopicEntityListing]

# File lib/purecloud/api/notifications_api.rb, line 320
def post_channels_channel_id_subscriptions(channel_id, body, opts = {})
  data, status_code, headers = post_channels_channel_id_subscriptions_with_http_info(channel_id, body, opts)
  return data
end
post_channels_channel_id_subscriptions_with_http_info(channel_id, body, opts = {}) click to toggle source

Add a list of subscriptions to the existing list of subscriptions

@param channel_id Channel ID @param body Body @param [Hash] opts the optional parameters @return [Array<(ChannelTopicEntityListing, Fixnum, Hash)>] ChannelTopicEntityListing data, response status code and response headers

# File lib/purecloud/api/notifications_api.rb, line 331
def post_channels_channel_id_subscriptions_with_http_info(channel_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: NotificationsApi#post_channels_channel_id_subscriptions ..."
  end
  
  # verify the required parameter 'channel_id' is set
  fail "Missing the required parameter 'channel_id' when calling post_channels_channel_id_subscriptions" if channel_id.nil?
  
  # verify the required parameter 'body' is set
  fail "Missing the required parameter 'body' when calling post_channels_channel_id_subscriptions" if body.nil?
  
  # resource path
  local_var_path = "/api/v2/notifications/channels/{channelId}/subscriptions".sub('{format}','json').sub('{' + 'channelId' + '}', channel_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 = @api_client.object_to_http_body(body)
  
  auth_names = ['PureCloud Auth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ChannelTopicEntityListing')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotificationsApi#post_channels_channel_id_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
post_channels_with_http_info(opts = {}) click to toggle source

Create a new channel There is a limit of 10 channels. Creating an 11th channel will remove the channel with oldest last used date. @param [Hash] opts the optional parameters @return [Array<(Channel, Fixnum, Hash)>] Channel data, response status code and response headers

# File lib/purecloud/api/notifications_api.rb, line 272
def post_channels_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: NotificationsApi#post_channels ..."
  end
  
  # resource path
  local_var_path = "/api/v2/notifications/channels".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(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Channel')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotificationsApi#post_channels\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
put_channels_channel_id_subscriptions(channel_id, body, opts = {}) click to toggle source

Replace the current list of subscriptions with a new list.

@param channel_id Channel ID @param body Body @param [Hash] opts the optional parameters @return [ChannelTopicEntityListing]

# File lib/purecloud/api/notifications_api.rb, line 385
def put_channels_channel_id_subscriptions(channel_id, body, opts = {})
  data, status_code, headers = put_channels_channel_id_subscriptions_with_http_info(channel_id, body, opts)
  return data
end
put_channels_channel_id_subscriptions_with_http_info(channel_id, body, opts = {}) click to toggle source

Replace the current list of subscriptions with a new list.

@param channel_id Channel ID @param body Body @param [Hash] opts the optional parameters @return [Array<(ChannelTopicEntityListing, Fixnum, Hash)>] ChannelTopicEntityListing data, response status code and response headers

# File lib/purecloud/api/notifications_api.rb, line 396
def put_channels_channel_id_subscriptions_with_http_info(channel_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: NotificationsApi#put_channels_channel_id_subscriptions ..."
  end
  
  # verify the required parameter 'channel_id' is set
  fail "Missing the required parameter 'channel_id' when calling put_channels_channel_id_subscriptions" if channel_id.nil?
  
  # verify the required parameter 'body' is set
  fail "Missing the required parameter 'body' when calling put_channels_channel_id_subscriptions" if body.nil?
  
  # resource path
  local_var_path = "/api/v2/notifications/channels/{channelId}/subscriptions".sub('{format}','json').sub('{' + 'channelId' + '}', channel_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 = @api_client.object_to_http_body(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 => 'ChannelTopicEntityListing')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotificationsApi#put_channels_channel_id_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end