require "uri" module PureCloud class NotificationsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Get available notification topics. # # @param [Hash] opts the optional parameters # @return [AvailableTopicEntityListing] def get_availabletopics(opts = {}) data, status_code, headers = get_availabletopics_with_http_info(opts) return data end # Get available notification topics. # # @param [Hash] opts the optional parameters # @return [Array<(AvailableTopicEntityListing, Fixnum, Hash)>] AvailableTopicEntityListing data, response status code and response headers 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 path = "/api/v1/notifications/availabletopics".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, 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 # The list of existing channels # # @param [Hash] opts the optional parameters # @return [ChannelEntityListing] def get_channels(opts = {}) data, status_code, headers = get_channels_with_http_info(opts) return data end # The list of existing channels # # @param [Hash] opts the optional parameters # @return [Array<(ChannelEntityListing, Fixnum, Hash)>] ChannelEntityListing data, response status code and response headers 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 path = "/api/v1/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, 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 # 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] def post_channels(opts = {}) data, status_code, headers = post_channels_with_http_info(opts) return data end # 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 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 path = "/api/v1/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, 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 # The list of all subscriptions for this channel # # @param channel_id Channel ID # @param [Hash] opts the optional parameters # @return [ChannelTopicEntityListing] 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 # 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 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 path = "/api/v1/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, 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 # Replace the current list of subscriptions with a new list. # # @param channel_id Channel ID # @param [Hash] opts the optional parameters # @option opts [Array] :body Topic # @return [ChannelTopicEntityListing] def put_channels_channel_id_subscriptions(channel_id, opts = {}) data, status_code, headers = put_channels_channel_id_subscriptions_with_http_info(channel_id, opts) return data end # Replace the current list of subscriptions with a new list. # # @param channel_id Channel ID # @param [Hash] opts the optional parameters # @option opts [Array] :body Topic # @return [Array<(ChannelTopicEntityListing, Fixnum, Hash)>] ChannelTopicEntityListing data, response status code and response headers def put_channels_channel_id_subscriptions_with_http_info(channel_id, 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? # resource path path = "/api/v1/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(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:PUT, 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 # Add a list of subscriptions to the existing list of subscriptions # # @param channel_id Channel ID # @param [Hash] opts the optional parameters # @option opts [Array] :body Topic # @return [ChannelTopicEntityListing] def post_channels_channel_id_subscriptions(channel_id, opts = {}) data, status_code, headers = post_channels_channel_id_subscriptions_with_http_info(channel_id, opts) return data end # Add a list of subscriptions to the existing list of subscriptions # # @param channel_id Channel ID # @param [Hash] opts the optional parameters # @option opts [Array] :body Topic # @return [Array<(ChannelTopicEntityListing, Fixnum, Hash)>] ChannelTopicEntityListing data, response status code and response headers def post_channels_channel_id_subscriptions_with_http_info(channel_id, 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? # resource path path = "/api/v1/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(opts[:'body']) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:POST, 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 # Remove all subscriptions # # @param channel_id Channel ID # @param [Hash] opts the optional parameters # @return [String] def delete_channels_channel_id_subscriptions(channel_id, opts = {}) data, status_code, headers = delete_channels_channel_id_subscriptions_with_http_info(channel_id, opts) return data end # Remove all subscriptions # # @param channel_id Channel ID # @param [Hash] opts the optional parameters # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers 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 path = "/api/v1/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, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'String') 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 end end