mandrill-api 1.0.27 → 1.0.28

Sign up to get free protection for your applications and to get access to all the features.
@@ -61,7 +61,8 @@ module Mandrill
61
61
  'Unknown_Url' => UnknownUrlError,
62
62
  'Invalid_Template' => InvalidTemplateError,
63
63
  'Unknown_Webhook' => UnknownWebhookError,
64
- 'Unknown_InboundDomain' => UnknownInboundDomainError
64
+ 'Unknown_InboundDomain' => UnknownInboundDomainError,
65
+ 'Unknown_Export' => UnknownExportError
65
66
  }
66
67
 
67
68
  begin
@@ -82,6 +83,9 @@ module Mandrill
82
83
  def templates()
83
84
  Templates.new self
84
85
  end
86
+ def exports()
87
+ Exports.new self
88
+ end
85
89
  def users()
86
90
  Users.new self
87
91
  end
@@ -200,6 +200,92 @@ module Mandrill
200
200
  return @master.call 'templates/render', _params
201
201
  end
202
202
 
203
+ end
204
+ class Exports
205
+ attr_accessor :master
206
+
207
+ def initialize(master)
208
+ @master = master
209
+ end
210
+
211
+ # Returns information about an export job. If the export job's state is 'complete', the returned data will include a URL you can use to fetch the results. Every export job produces a zip archive, but the format of the archive is distinct for each job type. The api calls that initiate exports include more details about the output format for that job type.
212
+ # @param [String] id an export job identifier
213
+ # @return [Hash] the information about the export
214
+ # - [String] id the unique identifier for this Export. Use this identifier when checking the export job's status
215
+ # - [String] created_at the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
216
+ # - [String] type the type of the export job - activity, reject, or whitelist
217
+ # - [String] finished_at the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format
218
+ # - [String] state the export job's state - waiting, working, complete, error, or expired.
219
+ # - [String] result_url the url for the export job's results, if the job is completed.
220
+ def info(id)
221
+ _params = {:id => id}
222
+ return @master.call 'exports/info', _params
223
+ end
224
+
225
+ # Returns a list of your exports.
226
+ # @return [Array] the account's exports
227
+ # - [Hash] return[] the individual export info
228
+ # - [String] id the unique identifier for this Export. Use this identifier when checking the export job's status
229
+ # - [String] created_at the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
230
+ # - [String] type the type of the export job - activity, reject, or whitelist
231
+ # - [String] finished_at the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format
232
+ # - [String] state the export job's state - waiting, working, complete, error, or expired.
233
+ # - [String] result_url the url for the export job's results, if the job is completed.
234
+ def list()
235
+ _params = {}
236
+ return @master.call 'exports/list', _params
237
+ end
238
+
239
+ # Begins an export of your rejection blacklist. The blacklist will be exported to a zip archive containing a single file named rejects.csv that includes the following fields: email, reason, detail, created_at, expires_at, last_event_at, expires_at.
240
+ # @param [String] notify_email an optional email address to notify when the export job has finished.
241
+ # @return [Hash] information about the rejects export job that was started
242
+ # - [String] id the unique identifier for this Export. Use this identifier when checking the export job's status
243
+ # - [String] created_at the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
244
+ # - [String] type the type of the export job
245
+ # - [String] finished_at the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format, or null for jobs that have not run
246
+ # - [String] state the export job's state
247
+ # - [String] result_url the url for the export job's results, if the job is complete
248
+ def rejects(notify_email=nil)
249
+ _params = {:notify_email => notify_email}
250
+ return @master.call 'exports/rejects', _params
251
+ end
252
+
253
+ # Begins an export of your rejection whitelist. The whitelist will be exported to a zip archive containing a single file named whitelist.csv that includes the following fields: email, detail, created_at.
254
+ # @param [String] notify_email an optional email address to notify when the export job has finished.
255
+ # @return [Hash] information about the whitelist export job that was started
256
+ # - [String] id the unique identifier for this Export. Use this identifier when checking the export job's status
257
+ # - [String] created_at the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
258
+ # - [String] type the type of the export job
259
+ # - [String] finished_at the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format, or null for jobs that have not run
260
+ # - [String] state the export job's state
261
+ # - [String] result_url the url for the export job's results, if the job is complete
262
+ def whitelist(notify_email=nil)
263
+ _params = {:notify_email => notify_email}
264
+ return @master.call 'exports/whitelist', _params
265
+ end
266
+
267
+ # Begins an export of your activity history. The activity will be exported to a zaip archive containing a single file named activity.csv in the same format as you would be able to export from your account's activity view. It includes the following fields: Date, Email Address, Sender, Subject, Status, Tags, Opens, Clicks, Bounce Detail. If you have configured any custom metadata fields, they will be included in the exported data.
268
+ # @param [String] notify_email an optional email address to notify when the export job has finished
269
+ # @param [String] date_from start date as a UTC string in YYYY-MM-DD HH:MM:SS format
270
+ # @param [String] date_to end date as a UTC string in YYYY-MM-DD HH:MM:SS format
271
+ # @param [Array] tags an array of tag names to narrow the export to; will match messages that contain ANY of the tags
272
+ # - [String] tags[] a tag name
273
+ # @param [Array] senders an array of senders to narrow the export to
274
+ # - [String] senders[] a sender address
275
+ # @param [Array] states an array of states to narrow the export to; messages with ANY of the states will be included
276
+ # - [String] states[] a message state
277
+ # @return [Hash] information about the activity export job that was started
278
+ # - [String] id the unique identifier for this Export. Use this identifier when checking the export job's status
279
+ # - [String] created_at the date and time that the export job was created as a UTC string in YYYY-MM-DD HH:MM:SS format
280
+ # - [String] type the type of the export job
281
+ # - [String] finished_at the date and time that the export job was finished as a UTC string in YYYY-MM-DD HH:MM:SS format, or null for jobs that have not run
282
+ # - [String] state the export job's state
283
+ # - [String] result_url the url for the export job's results, if the job is complete
284
+ def activity(notify_email=nil, date_from=nil, date_to=nil, tags=nil, senders=nil, states=nil)
285
+ _params = {:notify_email => notify_email, :date_from => date_from, :date_to => date_to, :tags => tags, :senders => senders, :states => states}
286
+ return @master.call 'exports/activity', _params
287
+ end
288
+
203
289
  end
204
290
  class Users
205
291
  attr_accessor :master
@@ -888,7 +974,7 @@ module Mandrill
888
974
 
889
975
  # Get the list of all webhooks defined on the account
890
976
  # @return [Array] the webhooks associated with the account
891
- # - [Hash] return[] the inidividual webhook info
977
+ # - [Hash] return[] the individual webhook info
892
978
  # - [Integer] id a unique integer indentifier for the webhook
893
979
  # - [String] url The URL that the event data will be posted to
894
980
  # - [String] description a description of the webhook
@@ -21,5 +21,7 @@ module Mandrill
21
21
  end
22
22
  class UnknownInboundDomainError < Error
23
23
  end
24
+ class UnknownExportError < Error
25
+ end
24
26
  end
25
27
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mandrill-api
3
3
  version: !ruby/object:Gem::Version
4
- hash: 33
4
+ hash: 47
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 27
10
- version: 1.0.27
9
+ - 28
10
+ version: 1.0.28
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mandrill Devs
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-05-03 00:00:00 Z
18
+ date: 2013-05-10 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: json