class ElasticEmail::StatisticsApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

statistics_campaigns_by_name_get(name, opts = {}) click to toggle source

Load Campaign Stats Retrieve stats of an existing campaign. Required Access Level: ViewChannels @param name [String] The name of the campaign to get. @param [Hash] opts the optional parameters @return [ChannelLogStatusSummary]

# File lib/ElasticEmail/api/statistics_api.rb, line 27
def statistics_campaigns_by_name_get(name, opts = {})
  data, _status_code, _headers = statistics_campaigns_by_name_get_with_http_info(name, opts)
  data
end
statistics_campaigns_by_name_get_with_http_info(name, opts = {}) click to toggle source

Load Campaign Stats Retrieve stats of an existing campaign. Required Access Level: ViewChannels @param name [String] The name of the campaign to get. @param [Hash] opts the optional parameters @return [Array<(ChannelLogStatusSummary, Integer, Hash)>] ChannelLogStatusSummary data, response status code and response headers

# File lib/ElasticEmail/api/statistics_api.rb, line 37
def statistics_campaigns_by_name_get_with_http_info(name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StatisticsApi.statistics_campaigns_by_name_get ...'
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling StatisticsApi.statistics_campaigns_by_name_get"
  end
  # resource path
  local_var_path = '/statistics/campaigns/{name}'.sub('{' + 'name' + '}', CGI.escape(name.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ChannelLogStatusSummary'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apikey']

  new_options = opts.merge(
    :operation => :"StatisticsApi.statistics_campaigns_by_name_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StatisticsApi#statistics_campaigns_by_name_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
statistics_campaigns_get(opts = {}) click to toggle source

Load Campaigns Stats Returns a list of your Campaigns' stats. Required Access Level: ViewChannels @param [Hash] opts the optional parameters @option opts [Integer] :limit Maximum number of returned items. @option opts [Integer] :offset How many items should be returned ahead. @return [Array<ChannelLogStatusSummary>]

# File lib/ElasticEmail/api/statistics_api.rb, line 91
def statistics_campaigns_get(opts = {})
  data, _status_code, _headers = statistics_campaigns_get_with_http_info(opts)
  data
end
statistics_campaigns_get_with_http_info(opts = {}) click to toggle source

Load Campaigns Stats Returns a list of your Campaigns&#39; stats. Required Access Level: ViewChannels @param [Hash] opts the optional parameters @option opts [Integer] :limit Maximum number of returned items. @option opts [Integer] :offset How many items should be returned ahead. @return [Array<(Array<ChannelLogStatusSummary>, Integer, Hash)>] Array<ChannelLogStatusSummary> data, response status code and response headers

# File lib/ElasticEmail/api/statistics_api.rb, line 102
def statistics_campaigns_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StatisticsApi.statistics_campaigns_get ...'
  end
  # resource path
  local_var_path = '/statistics/campaigns'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<ChannelLogStatusSummary>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apikey']

  new_options = opts.merge(
    :operation => :"StatisticsApi.statistics_campaigns_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StatisticsApi#statistics_campaigns_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
statistics_channels_by_name_get(name, opts = {}) click to toggle source

Load Channel Stats Retrieve an existing channel stats. Required Access Level: ViewChannels @param name [String] The name of the channel to get. @param [Hash] opts the optional parameters @return [ChannelLogStatusSummary]

# File lib/ElasticEmail/api/statistics_api.rb, line 153
def statistics_channels_by_name_get(name, opts = {})
  data, _status_code, _headers = statistics_channels_by_name_get_with_http_info(name, opts)
  data
end
statistics_channels_by_name_get_with_http_info(name, opts = {}) click to toggle source

Load Channel Stats Retrieve an existing channel stats. Required Access Level: ViewChannels @param name [String] The name of the channel to get. @param [Hash] opts the optional parameters @return [Array<(ChannelLogStatusSummary, Integer, Hash)>] ChannelLogStatusSummary data, response status code and response headers

# File lib/ElasticEmail/api/statistics_api.rb, line 163
def statistics_channels_by_name_get_with_http_info(name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StatisticsApi.statistics_channels_by_name_get ...'
  end
  # verify the required parameter 'name' is set
  if @api_client.config.client_side_validation && name.nil?
    fail ArgumentError, "Missing the required parameter 'name' when calling StatisticsApi.statistics_channels_by_name_get"
  end
  # resource path
  local_var_path = '/statistics/channels/{name}'.sub('{' + 'name' + '}', CGI.escape(name.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ChannelLogStatusSummary'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apikey']

  new_options = opts.merge(
    :operation => :"StatisticsApi.statistics_channels_by_name_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StatisticsApi#statistics_channels_by_name_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
statistics_channels_get(opts = {}) click to toggle source

Load Channels Stats Returns a list of your Channels' stats. Required Access Level: ViewChannels @param [Hash] opts the optional parameters @option opts [Integer] :limit Maximum number of returned items. @option opts [Integer] :offset How many items should be returned ahead. @return [Array<ChannelLogStatusSummary>]

# File lib/ElasticEmail/api/statistics_api.rb, line 217
def statistics_channels_get(opts = {})
  data, _status_code, _headers = statistics_channels_get_with_http_info(opts)
  data
end
statistics_channels_get_with_http_info(opts = {}) click to toggle source

Load Channels Stats Returns a list of your Channels&#39; stats. Required Access Level: ViewChannels @param [Hash] opts the optional parameters @option opts [Integer] :limit Maximum number of returned items. @option opts [Integer] :offset How many items should be returned ahead. @return [Array<(Array<ChannelLogStatusSummary>, Integer, Hash)>] Array<ChannelLogStatusSummary> data, response status code and response headers

# File lib/ElasticEmail/api/statistics_api.rb, line 228
def statistics_channels_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StatisticsApi.statistics_channels_get ...'
  end
  # resource path
  local_var_path = '/statistics/channels'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<ChannelLogStatusSummary>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apikey']

  new_options = opts.merge(
    :operation => :"StatisticsApi.statistics_channels_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StatisticsApi#statistics_channels_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
statistics_get(from, opts = {}) click to toggle source

Load Statistics Returns basic statistics. Required Access Level: ViewReports @param from [Time] Starting date for search in YYYY-MM-DDThh:mm:ss format. @param [Hash] opts the optional parameters @option opts [Time] :to Ending date for search in YYYY-MM-DDThh:mm:ss format. @return [LogStatusSummary]

# File lib/ElasticEmail/api/statistics_api.rb, line 280
def statistics_get(from, opts = {})
  data, _status_code, _headers = statistics_get_with_http_info(from, opts)
  data
end
statistics_get_with_http_info(from, opts = {}) click to toggle source

Load Statistics Returns basic statistics. Required Access Level: ViewReports @param from [Time] Starting date for search in YYYY-MM-DDThh:mm:ss format. @param [Hash] opts the optional parameters @option opts [Time] :to Ending date for search in YYYY-MM-DDThh:mm:ss format. @return [Array<(LogStatusSummary, Integer, Hash)>] LogStatusSummary data, response status code and response headers

# File lib/ElasticEmail/api/statistics_api.rb, line 291
def statistics_get_with_http_info(from, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: StatisticsApi.statistics_get ...'
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling StatisticsApi.statistics_get"
  end
  # resource path
  local_var_path = '/statistics'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'from'] = from
  query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LogStatusSummary'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['apikey']

  new_options = opts.merge(
    :operation => :"StatisticsApi.statistics_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: StatisticsApi#statistics_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end