Class: Mailkube::ScheduledEmail
- Inherits:
-
Object
- Object
- Mailkube::ScheduledEmail
- Defined in:
- lib/mailkube/types/scheduled_emails.rb,
sig/mailkube/types/scheduled_emails.rbs
Overview
Declared the same way as every other model — see sig/mailkube/types.rbs for why these are
plain classes that do not name ::Data as a superclass.
Instance Attribute Summary collapse
-
#batch_id ⇒ String?
readonly
Returns the value of attribute batch_id.
-
#created_at ⇒ String?
readonly
Returns the value of attribute created_at.
-
#id ⇒ String
readonly
Returns the value of attribute id.
-
#message_id ⇒ String?
readonly
Returns the value of attribute message_id.
-
#object ⇒ String
readonly
Returns the value of attribute object.
-
#recipients ⇒ String?
readonly
Returns the value of attribute recipients.
-
#scheduled_at ⇒ String?
readonly
Returns the value of attribute scheduled_at.
-
#status ⇒ String
readonly
Returns the value of attribute status.
-
#subject ⇒ String?
readonly
Returns the value of attribute subject.
-
#tags ⇒ Array[Hash[String, untyped]]
readonly
Returns the value of attribute tags.
-
#topic ⇒ String?
readonly
Returns the value of attribute topic.
Class Method Summary collapse
-
.from(payload) ⇒ ScheduledEmail
The model.
Instance Method Summary collapse
-
#initialize(id:, message_id: nil, object: "scheduled_email", status: "", scheduled_at: nil, created_at: nil, batch_id: nil, subject: nil, recipients: nil, topic: nil, tags: []) ⇒ ScheduledEmail
constructor
A new instance of ScheduledEmail.
Constructor Details
#initialize(id:, message_id: nil, object: "scheduled_email", status: "", scheduled_at: nil, created_at: nil, batch_id: nil, subject: nil, recipients: nil, topic: nil, tags: []) ⇒ ScheduledEmail
Returns a new instance of ScheduledEmail.
28 29 30 31 |
# File 'lib/mailkube/types/scheduled_emails.rb', line 28 def initialize(id:, message_id: nil, object: "scheduled_email", status: "", scheduled_at: nil, created_at: nil, batch_id: nil, subject: nil, recipients: nil, topic: nil, tags: []) super end |
Instance Attribute Details
#batch_id ⇒ String? (readonly)
Returns the value of attribute batch_id.
11 12 13 |
# File 'sig/mailkube/types/scheduled_emails.rbs', line 11 def batch_id @batch_id end |
#created_at ⇒ String? (readonly)
Returns the value of attribute created_at.
10 11 12 |
# File 'sig/mailkube/types/scheduled_emails.rbs', line 10 def created_at @created_at end |
#id ⇒ String (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'sig/mailkube/types/scheduled_emails.rbs', line 5 def id @id end |
#message_id ⇒ String? (readonly)
Returns the value of attribute message_id.
6 7 8 |
# File 'sig/mailkube/types/scheduled_emails.rbs', line 6 def @message_id end |
#object ⇒ String (readonly)
Returns the value of attribute object.
7 8 9 |
# File 'sig/mailkube/types/scheduled_emails.rbs', line 7 def object @object end |
#recipients ⇒ String? (readonly)
Returns the value of attribute recipients.
13 14 15 |
# File 'sig/mailkube/types/scheduled_emails.rbs', line 13 def recipients @recipients end |
#scheduled_at ⇒ String? (readonly)
Returns the value of attribute scheduled_at.
9 10 11 |
# File 'sig/mailkube/types/scheduled_emails.rbs', line 9 def scheduled_at @scheduled_at end |
#status ⇒ String (readonly)
Returns the value of attribute status.
8 9 10 |
# File 'sig/mailkube/types/scheduled_emails.rbs', line 8 def status @status end |
#subject ⇒ String? (readonly)
Returns the value of attribute subject.
12 13 14 |
# File 'sig/mailkube/types/scheduled_emails.rbs', line 12 def subject @subject end |
#tags ⇒ Array[Hash[String, untyped]] (readonly)
Returns the value of attribute tags.
15 16 17 |
# File 'sig/mailkube/types/scheduled_emails.rbs', line 15 def @tags end |
#topic ⇒ String? (readonly)
Returns the value of attribute topic.
14 15 16 |
# File 'sig/mailkube/types/scheduled_emails.rbs', line 14 def topic @topic end |
Class Method Details
.from(payload) ⇒ ScheduledEmail
Returns the model.
35 36 37 38 39 40 41 |
# File 'lib/mailkube/types/scheduled_emails.rb', line 35 def self.from(payload) new(id: payload["id"], message_id: payload["message_id"], object: payload["object"] || "scheduled_email", status: payload["status"] || "", scheduled_at: payload["scheduled_at"], created_at: payload["created_at"], batch_id: payload["batch_id"], subject: payload["subject"], recipients: payload["recipients"], topic: payload["topic"], tags: payload["tags"] || []) end |