Class: Mailkube::Resources::ScheduledEmailBatches
- Inherits:
-
Object
- Object
- Mailkube::Resources::ScheduledEmailBatches
- Defined in:
- lib/mailkube/resources/scheduled_emails.rb,
sig/mailkube/resources/scheduled_emails.rbs
Overview
Batch operations, reached as client.scheduled_emails.batches.
A sibling resource sharing the enclosing namespace's transport, not a method group: the wire
has a scheduled-emails/batches/{id} sub-path, so the SDK has a sub-namespace. A
update_batch suffix would flatten a structure the API actually has.
Instance Method Summary collapse
-
#cancel(batch_id) ⇒ ScheduledEmailBatchCancel
Cancel every pending email in a batch.
-
#initialize(transport) ⇒ ScheduledEmailBatches
constructor
A new instance of ScheduledEmailBatches.
-
#update(batch_id, scheduled_at:) ⇒ ScheduledEmailBatchUpdate
Reschedule every pending email in a batch.
Constructor Details
#initialize(transport) ⇒ ScheduledEmailBatches
Returns a new instance of ScheduledEmailBatches.
12 13 14 15 |
# File 'lib/mailkube/resources/scheduled_emails.rb', line 12 def initialize(transport) @transport = transport freeze end |
Instance Method Details
#cancel(batch_id) ⇒ ScheduledEmailBatchCancel
Cancel every pending email in a batch.
An unknown batch is a no-op reporting a count of 0 rather than a 404, so a count of 0 is not a failure.
37 38 39 |
# File 'lib/mailkube/resources/scheduled_emails.rb', line 37 def cancel(batch_id) ScheduledEmailBatchCancel.from(@transport.request_json(ScheduledEmailRequests.batch_cancel(batch_id))) end |
#update(batch_id, scheduled_at:) ⇒ ScheduledEmailBatchUpdate
Reschedule every pending email in a batch.
24 25 26 27 |
# File 'lib/mailkube/resources/scheduled_emails.rb', line 24 def update(batch_id, scheduled_at:) body = { "scheduled_at" => Serialization.to_iso(scheduled_at) } ScheduledEmailBatchUpdate.from(@transport.request_json(ScheduledEmailRequests.batch_update(batch_id, body))) end |