Class: Mailkube::CanceledScheduledEmail

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

Overview

What a cancellation reports back.

A separate model from ScheduledEmail rather than a widened one: the server answers a cancellation with a three-field acknowledgement, not with the record, and a model mirrors the wire and nothing else.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, object: "scheduled_email", status: "canceled") ⇒ CanceledScheduledEmail

Returns a new instance of CanceledScheduledEmail.

Parameters:

  • id (String)

    the canceled scheduled email's UUID.

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

    the resource discriminator, always scheduled_email.

  • status (String) (defaults to: "canceled")

    the resulting status, always canceled.

  • id: (String)
  • object: (String) (defaults to: "scheduled_email")
  • status: (String) (defaults to: "canceled")


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

def initialize(id:, object: "scheduled_email", status: "canceled") = super

Instance Attribute Details

#idString (readonly)

Returns the value of attribute id.

Returns:

  • (String)


3
4
5
# File 'sig/mailkube/types/scheduled_acks.rbs', line 3

def id
  @id
end

#objectString (readonly)

Returns the value of attribute object.

Returns:

  • (String)


4
5
6
# File 'sig/mailkube/types/scheduled_acks.rbs', line 4

def object
  @object
end

#statusString (readonly)

Returns the value of attribute status.

Returns:

  • (String)


5
6
7
# File 'sig/mailkube/types/scheduled_acks.rbs', line 5

def status
  @status
end

Class Method Details

.from(payload) ⇒ CanceledScheduledEmail

Returns the model.

Parameters:

  • payload (Hash{String => Object})

    the decoded acknowledgement.

  • (Hash[String, untyped])

Returns:



17
18
19
20
# File 'lib/mailkube/types/scheduled_acks.rb', line 17

def self.from(payload)
  new(id: payload["id"], object: payload["object"] || "scheduled_email",
      status: payload["status"] || "canceled")
end