Class: Mandrill::Subaccounts
- Inherits:
-
Object
- Object
- Mandrill::Subaccounts
- Defined in:
- lib/mandrill/api.rb
Instance Attribute Summary collapse
-
#master ⇒ Object
Returns the value of attribute master.
Instance Method Summary collapse
-
#add(id, name = nil, notes = nil, custom_quota = nil) ⇒ Hash
Add a new subaccount.
-
#delete(id) ⇒ Hash
Delete an existing subaccount.
-
#info(id) ⇒ Hash
Given the ID of an existing subaccount, return the data about it.
-
#initialize(master) ⇒ Subaccounts
constructor
A new instance of Subaccounts.
-
#list(q = nil) ⇒ Array
Get the list of subaccounts defined for the account, optionally filtered by a prefix.
-
#pause(id) ⇒ Hash
Pause a subaccount’s sending.
-
#resume(id) ⇒ Hash
Resume a paused subaccount’s sending.
-
#update(id, name = nil, notes = nil, custom_quota = nil) ⇒ Hash
Update an existing subaccount.
Constructor Details
#initialize(master) ⇒ Subaccounts
Returns a new instance of Subaccounts.
1448 1449 1450 |
# File 'lib/mandrill/api.rb', line 1448 def initialize(master) @master = master end |
Instance Attribute Details
#master ⇒ Object
Returns the value of attribute master.
1446 1447 1448 |
# File 'lib/mandrill/api.rb', line 1446 def master @master end |
Instance Method Details
#add(id, name = nil, notes = nil, custom_quota = nil) ⇒ Hash
Add a new subaccount
1487 1488 1489 1490 |
# File 'lib/mandrill/api.rb', line 1487 def add(id, name=nil, notes=nil, custom_quota=nil) _params = {:id => id, :name => name, :notes => notes, :custom_quota => custom_quota} return @master.call 'subaccounts/add', _params end |
#delete(id) ⇒ Hash
Delete an existing subaccount. Any email related to the subaccount will be saved, but stats will be removed and any future sending calls to this subaccount will fail.
1558 1559 1560 1561 |
# File 'lib/mandrill/api.rb', line 1558 def delete(id) _params = {:id => id} return @master.call 'subaccounts/delete', _params end |
#info(id) ⇒ Hash
Given the ID of an existing subaccount, return the data about it
1519 1520 1521 1522 |
# File 'lib/mandrill/api.rb', line 1519 def info(id) _params = {:id => id} return @master.call 'subaccounts/info', _params end |
#list(q = nil) ⇒ Array
Get the list of subaccounts defined for the account, optionally filtered by a prefix
1466 1467 1468 1469 |
# File 'lib/mandrill/api.rb', line 1466 def list(q=nil) _params = {:q => q} return @master.call 'subaccounts/list', _params end |
#pause(id) ⇒ Hash
Pause a subaccount’s sending. Any future emails delivered to this subaccount will be queued for a maximum of 3 days until the subaccount is resumed.
1576 1577 1578 1579 |
# File 'lib/mandrill/api.rb', line 1576 def pause(id) _params = {:id => id} return @master.call 'subaccounts/pause', _params end |
#resume(id) ⇒ Hash
Resume a paused subaccount’s sending
1594 1595 1596 1597 |
# File 'lib/mandrill/api.rb', line 1594 def resume(id) _params = {:id => id} return @master.call 'subaccounts/resume', _params end |
#update(id, name = nil, notes = nil, custom_quota = nil) ⇒ Hash
Update an existing subaccount
1540 1541 1542 1543 |
# File 'lib/mandrill/api.rb', line 1540 def update(id, name=nil, notes=nil, custom_quota=nil) _params = {:id => id, :name => name, :notes => notes, :custom_quota => custom_quota} return @master.call 'subaccounts/update', _params end |