Class: Mailkube::ScheduledEmailBatchCancel

Inherits:
Object
  • Object
show all
Defined in:
lib/mailkube/types/scheduled_acks.rb,
sig/mailkube/types/scheduled_acks.rbs

Overview

What cancelling a whole batch reports back.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object: "scheduled_email.batch", batch_id: "", canceled_count: 0) ⇒ ScheduledEmailBatchCancel

Returns a new instance of ScheduledEmailBatchCancel.

Parameters:

  • object (String) (defaults to: "scheduled_email.batch")

    the resource discriminator, always scheduled_email.batch.

  • batch_id (String) (defaults to: "")

    the batch that was targeted.

  • canceled_count (Integer) (defaults to: 0)

    how many pending emails the cancellation affected. An unknown batch is a no-op reporting 0, not an error, so do not treat 0 as a failure.

  • object: (String) (defaults to: "scheduled_email.batch")
  • batch_id: (String) (defaults to: "")
  • canceled_count: (Integer) (defaults to: 0)


29
# File 'lib/mailkube/types/scheduled_acks.rb', line 29

def initialize(object: "scheduled_email.batch", batch_id: "", canceled_count: 0) = super

Instance Attribute Details

#batch_idString (readonly)

Returns the value of attribute batch_id.

Returns:

  • (String)


13
14
15
# File 'sig/mailkube/types/scheduled_acks.rbs', line 13

def batch_id
  @batch_id
end

#canceled_countInteger (readonly)

Returns the value of attribute canceled_count.

Returns:

  • (Integer)


14
15
16
# File 'sig/mailkube/types/scheduled_acks.rbs', line 14

def canceled_count
  @canceled_count
end

#objectString (readonly)

Returns the value of attribute object.

Returns:

  • (String)


12
13
14
# File 'sig/mailkube/types/scheduled_acks.rbs', line 12

def object
  @object
end

Class Method Details

.from(payload) ⇒ ScheduledEmailBatchCancel

Returns the model.

Parameters:

  • payload (Hash{String => Object})

    the decoded acknowledgement.

  • (Hash[String, untyped])

Returns:



33
34
35
36
# File 'lib/mailkube/types/scheduled_acks.rb', line 33

def self.from(payload)
  new(object: payload["object"] || "scheduled_email.batch", batch_id: payload["batch_id"] || "",
      canceled_count: payload["canceled_count"] || 0)
end