Method: PureCloud::AlertingApi#post_alerting_interactionstats_rules_with_http_info

Defined in:
lib/purecloudplatformclientv2/api/alerting_api.rb

#post_alerting_interactionstats_rules_with_http_info(body, opts = {}) ⇒ Array<(InteractionStatsRule, Fixnum, Hash)>

Create an interaction stats rule.

Parameters:

  • body

    AlertingRule

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :expand (Array<String>)

    Which fields, if any, to expand

Returns:

  • (Array<(InteractionStatsRule, Fixnum, Hash)>)

    InteractionStatsRule data, response status code and response headers



558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
# File 'lib/purecloudplatformclientv2/api/alerting_api.rb', line 558

def post_alerting_interactionstats_rules_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: AlertingApi.post_alerting_interactionstats_rules ..."
  end
  
  
  # verify the required parameter 'body' is set
  fail ArgumentError, "Missing the required parameter 'body' when calling AlertingApi.post_alerting_interactionstats_rules" if body.nil?
  
  
  
  
  
  
  
  
  
  
  
  # resource path
  local_var_path = "/api/v2/alerting/interactionstats/rules".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)
  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(: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 => 'InteractionStatsRule')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AlertingApi#post_alerting_interactionstats_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end