Module: SendGrid4r::REST::Stats::Parse

Includes:
Request
Included in:
API
Defined in:
lib/sendgrid4r/rest/stats/parse.rb

Overview

SendGrid Web API v3 Stats - Parse

Constant Summary

Constants included from Request

Request::BASE_URL

Instance Method Summary collapse

Methods included from Request

#create_args, #delete, #execute, #finish, #get, #patch, #post, #process_array_params, #process_url_params, #put

Instance Method Details

#get_parse_stats(start_date:, end_date: nil, aggregated_by: nil, &block) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/sendgrid4r/rest/stats/parse.rb', line 11

def get_parse_stats(
  start_date:, end_date: nil, aggregated_by: nil, &block
)
  params = {
    start_date: start_date,
    end_date: end_date,
    aggregated_by: aggregated_by
  }
  endpoint = "#{BASE_URL}/user/webhooks/parse/stats"
  resp = get(@auth, endpoint, params, &block)
  finish(resp, @raw_resp) { |r| Stats.create_top_stats(r) }
end