Class: Sendpost::StatsApi
- Inherits:
-
Object
- Object
- Sendpost::StatsApi
- Defined in:
- lib/sendpost_ruby_sdk/api/stats_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#account_subaccount_stat_subaccount_id_aggregate_get(from, to, subaccount_id, opts = {}) ⇒ AggregateStat
Get Aggregate Stats Retrieves aggregated email stats for a specific sub-account for a date range.
-
#account_subaccount_stat_subaccount_id_aggregate_get_with_http_info(from, to, subaccount_id, opts = {}) ⇒ Array<(AggregateStat, Integer, Hash)>
Get Aggregate Stats Retrieves aggregated email stats for a specific sub-account for a date range.
-
#account_subaccount_stat_subaccount_id_get(from, to, subaccount_id, opts = {}) ⇒ Array<Stat>
List Stats Retrieves a list of email stats for a specific sub-account within a given date range.
-
#account_subaccount_stat_subaccount_id_get_with_http_info(from, to, subaccount_id, opts = {}) ⇒ Array<(Array<Stat>, Integer, Hash)>
List Stats Retrieves a list of email stats for a specific sub-account within a given date range.
-
#get_aggregate_stats_by_group(group, from, to, subaccount_id, opts = {}) ⇒ AggregateStat
Get Group Aggregate Stats Retrieves aggregated email stats for a specific group in a sub-account for the specified daterange.
-
#get_aggregate_stats_by_group_with_http_info(group, from, to, subaccount_id, opts = {}) ⇒ Array<(AggregateStat, Integer, Hash)>
Get Group Aggregate Stats Retrieves aggregated email stats for a specific group in a sub-account for the specified daterange.
-
#initialize(api_client = ApiClient.default) ⇒ StatsApi
constructor
A new instance of StatsApi.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ StatsApi
Returns a new instance of StatsApi.
19 20 21 |
# File 'lib/sendpost_ruby_sdk/api/stats_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/sendpost_ruby_sdk/api/stats_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#account_subaccount_stat_subaccount_id_aggregate_get(from, to, subaccount_id, opts = {}) ⇒ AggregateStat
Get Aggregate Stats Retrieves aggregated email stats for a specific sub-account for a date range. Note: The maximum date range is 366 days.
29 30 31 32 |
# File 'lib/sendpost_ruby_sdk/api/stats_api.rb', line 29 def account_subaccount_stat_subaccount_id_aggregate_get(from, to, subaccount_id, opts = {}) data, _status_code, _headers = account_subaccount_stat_subaccount_id_aggregate_get_with_http_info(from, to, subaccount_id, opts) data end |
#account_subaccount_stat_subaccount_id_aggregate_get_with_http_info(from, to, subaccount_id, opts = {}) ⇒ Array<(AggregateStat, Integer, Hash)>
Get Aggregate Stats Retrieves aggregated email stats for a specific sub-account for a date range. Note: The maximum date range is 366 days.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/sendpost_ruby_sdk/api/stats_api.rb', line 41 def account_subaccount_stat_subaccount_id_aggregate_get_with_http_info(from, to, subaccount_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StatsApi.account_subaccount_stat_subaccount_id_aggregate_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 StatsApi.account_subaccount_stat_subaccount_id_aggregate_get" end # verify the required parameter 'to' is set if @api_client.config.client_side_validation && to.nil? fail ArgumentError, "Missing the required parameter 'to' when calling StatsApi.account_subaccount_stat_subaccount_id_aggregate_get" end # verify the required parameter 'subaccount_id' is set if @api_client.config.client_side_validation && subaccount_id.nil? fail ArgumentError, "Missing the required parameter 'subaccount_id' when calling StatsApi.account_subaccount_stat_subaccount_id_aggregate_get" end # resource path local_var_path = '/account/subaccount/stat/{subaccount_id}/aggregate'.sub('{' + 'subaccount_id' + '}', CGI.escape(subaccount_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'from'] = from query_params[:'to'] = to # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'AggregateStat' # auth_names auth_names = opts[:debug_auth_names] || ['accountAuth'] = opts.merge( :operation => :"StatsApi.account_subaccount_stat_subaccount_id_aggregate_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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: StatsApi#account_subaccount_stat_subaccount_id_aggregate_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#account_subaccount_stat_subaccount_id_get(from, to, subaccount_id, opts = {}) ⇒ Array<Stat>
List Stats Retrieves a list of email stats for a specific sub-account within a given date range. Both ‘from` and `to` dates are inclusive. Note: The maximum date range is 31 days.
106 107 108 109 |
# File 'lib/sendpost_ruby_sdk/api/stats_api.rb', line 106 def account_subaccount_stat_subaccount_id_get(from, to, subaccount_id, opts = {}) data, _status_code, _headers = account_subaccount_stat_subaccount_id_get_with_http_info(from, to, subaccount_id, opts) data end |
#account_subaccount_stat_subaccount_id_get_with_http_info(from, to, subaccount_id, opts = {}) ⇒ Array<(Array<Stat>, Integer, Hash)>
List Stats Retrieves a list of email stats for a specific sub-account within a given date range. Both `from` and `to` dates are inclusive. Note: The maximum date range is 31 days.
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
# File 'lib/sendpost_ruby_sdk/api/stats_api.rb', line 118 def account_subaccount_stat_subaccount_id_get_with_http_info(from, to, subaccount_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StatsApi.account_subaccount_stat_subaccount_id_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 StatsApi.account_subaccount_stat_subaccount_id_get" end # verify the required parameter 'to' is set if @api_client.config.client_side_validation && to.nil? fail ArgumentError, "Missing the required parameter 'to' when calling StatsApi.account_subaccount_stat_subaccount_id_get" end # verify the required parameter 'subaccount_id' is set if @api_client.config.client_side_validation && subaccount_id.nil? fail ArgumentError, "Missing the required parameter 'subaccount_id' when calling StatsApi.account_subaccount_stat_subaccount_id_get" end # resource path local_var_path = '/account/subaccount/stat/{subaccount_id}'.sub('{' + 'subaccount_id' + '}', CGI.escape(subaccount_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'from'] = from query_params[:'to'] = to # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Array<Stat>' # auth_names auth_names = opts[:debug_auth_names] || ['accountAuth'] = opts.merge( :operation => :"StatsApi.account_subaccount_stat_subaccount_id_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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: StatsApi#account_subaccount_stat_subaccount_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_aggregate_stats_by_group(group, from, to, subaccount_id, opts = {}) ⇒ AggregateStat
Get Group Aggregate Stats Retrieves aggregated email stats for a specific group in a sub-account for the specified daterange. The maximum daterange for which these stats can be retrieved is 366 days. Ensure that the difference between the ‘from` and `to` dates does not exceed 366 days.
184 185 186 187 |
# File 'lib/sendpost_ruby_sdk/api/stats_api.rb', line 184 def get_aggregate_stats_by_group(group, from, to, subaccount_id, opts = {}) data, _status_code, _headers = get_aggregate_stats_by_group_with_http_info(group, from, to, subaccount_id, opts) data end |
#get_aggregate_stats_by_group_with_http_info(group, from, to, subaccount_id, opts = {}) ⇒ Array<(AggregateStat, Integer, Hash)>
Get Group Aggregate Stats Retrieves aggregated email stats for a specific group in a sub-account for the specified daterange. The maximum daterange for which these stats can be retrieved is 366 days. Ensure that the difference between the `from` and `to` dates does not exceed 366 days.
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/sendpost_ruby_sdk/api/stats_api.rb', line 197 def get_aggregate_stats_by_group_with_http_info(group, from, to, subaccount_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StatsApi.get_aggregate_stats_by_group ...' end # verify the required parameter 'group' is set if @api_client.config.client_side_validation && group.nil? fail ArgumentError, "Missing the required parameter 'group' when calling StatsApi.get_aggregate_stats_by_group" 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 StatsApi.get_aggregate_stats_by_group" end # verify the required parameter 'to' is set if @api_client.config.client_side_validation && to.nil? fail ArgumentError, "Missing the required parameter 'to' when calling StatsApi.get_aggregate_stats_by_group" end # verify the required parameter 'subaccount_id' is set if @api_client.config.client_side_validation && subaccount_id.nil? fail ArgumentError, "Missing the required parameter 'subaccount_id' when calling StatsApi.get_aggregate_stats_by_group" end # resource path local_var_path = '/account/subaccount/stat/{subaccount_id}/group'.sub('{' + 'subaccount_id' + '}', CGI.escape(subaccount_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'group'] = group query_params[:'from'] = from query_params[:'to'] = to # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'AggregateStat' # auth_names auth_names = opts[:debug_auth_names] || ['accountAuth'] = opts.merge( :operation => :"StatsApi.get_aggregate_stats_by_group", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: StatsApi#get_aggregate_stats_by_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |