Class: ApolloDeploySignalSdk::SendEmailRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/apollo_deploy_signal_sdk/types.rb

Overview

Schema type: SendEmailRequest

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from:, to:, cc: nil, bcc: nil, reply_to: nil, subject: nil, html: nil, text: nil, tags: nil, metadata: nil, idempotency_key: nil, test_mode: nil, attachments: nil, scheduled_at: nil, delivery_window: nil, send_time_category: nil, tracking_settings: nil) ⇒ SendEmailRequest

Returns a new instance of SendEmailRequest.

Parameters:

  • from (String)

    , to [Array], cc [Array], bcc [Array], reply_to [String, nil], subject [String, nil], html [String, nil], text [String, nil], tags [Hash=> String], metadata [Hash=> String], idempotency_key [String, nil], test_mode [Boolean], attachments [Array], scheduled_at [String, nil], delivery_window [DeliveryWindowRequest, nil], send_time_category [String], tracking_settings [TrackingSettingsRequest, nil]



169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 169

def initialize(from: , to: , cc: nil, bcc: nil, reply_to: nil, subject: nil, html: nil, text: nil, tags: nil, metadata: nil, idempotency_key: nil, test_mode: nil, attachments: nil, scheduled_at: nil, delivery_window: nil, send_time_category: nil, tracking_settings: nil)
  @from = from
  @to = to
  @cc = cc
  @bcc = bcc
  @reply_to = reply_to
  @subject = subject
  @html = html
  @text = text
  @tags = tags
  @metadata = 
  @idempotency_key = idempotency_key
  @test_mode = test_mode
  @attachments = attachments
  @scheduled_at = scheduled_at
  @delivery_window = delivery_window
  @send_time_category = send_time_category
  @tracking_settings = tracking_settings
end

Instance Attribute Details

#attachmentsArray<AttachmentRequest>

Returns:



158
159
160
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 158

def attachments
  @attachments
end

#bccArray<String>

Returns:

  • (Array<String>)


140
141
142
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 140

def bcc
  @bcc
end

#ccArray<String>

Returns:

  • (Array<String>)


138
139
140
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 138

def cc
  @cc
end

#delivery_windowDeliveryWindowRequest?

Returns:



162
163
164
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 162

def delivery_window
  @delivery_window
end

#fromString

Returns:

  • (String)


134
135
136
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 134

def from
  @from
end

#htmlString?

Returns:

  • (String, nil)


146
147
148
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 146

def html
  @html
end

#idempotency_keyString?

Returns:

  • (String, nil)


154
155
156
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 154

def idempotency_key
  @idempotency_key
end

#metadataHash{String => String}

Returns:

  • (Hash{String => String})


152
153
154
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 152

def 
  @metadata
end

#reply_toString?

Returns:

  • (String, nil)


142
143
144
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 142

def reply_to
  @reply_to
end

#scheduled_atString?

Returns:

  • (String, nil)


160
161
162
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 160

def scheduled_at
  @scheduled_at
end

#send_time_categoryString

Returns:

  • (String)


164
165
166
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 164

def send_time_category
  @send_time_category
end

#subjectString?

Returns:

  • (String, nil)


144
145
146
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 144

def subject
  @subject
end

#tagsHash{String => String}

Returns:

  • (Hash{String => String})


150
151
152
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 150

def tags
  @tags
end

#test_modeBoolean

Returns:

  • (Boolean)


156
157
158
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 156

def test_mode
  @test_mode
end

#textString?

Returns:

  • (String, nil)


148
149
150
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 148

def text
  @text
end

#toArray<String>

Returns:

  • (Array<String>)


136
137
138
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 136

def to
  @to
end

#tracking_settingsTrackingSettingsRequest?

Returns:



166
167
168
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 166

def tracking_settings
  @tracking_settings
end

Class Method Details

.from_json(attributes) ⇒ SendEmailRequest

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 215

def self.from_json(attributes)
  return nil unless attributes.is_a?(Hash)

  new(
    from: attributes.key?("from") ? attributes["from"] : attributes[:from],
    to: attributes.key?("to") ? attributes["to"] : attributes[:to],
    cc: attributes.key?("cc") ? attributes["cc"] : attributes[:cc],
    bcc: attributes.key?("bcc") ? attributes["bcc"] : attributes[:bcc],
    reply_to: attributes.key?("replyTo") ? attributes["replyTo"] : attributes[:reply_to],
    subject: attributes.key?("subject") ? attributes["subject"] : attributes[:subject],
    html: attributes.key?("html") ? attributes["html"] : attributes[:html],
    text: attributes.key?("text") ? attributes["text"] : attributes[:text],
    tags: attributes.key?("tags") ? attributes["tags"] : attributes[:tags],
    metadata: attributes.key?("metadata") ? attributes["metadata"] : attributes[:metadata],
    idempotency_key: attributes.key?("idempotencyKey") ? attributes["idempotencyKey"] : attributes[:idempotency_key],
    test_mode: attributes.key?("testMode") ? attributes["testMode"] : attributes[:test_mode],
    attachments: attributes.key?("attachments") ? attributes["attachments"] : attributes[:attachments],
    scheduled_at: attributes.key?("scheduledAt") ? attributes["scheduledAt"] : attributes[:scheduled_at],
    delivery_window: attributes.key?("deliveryWindow") ? attributes["deliveryWindow"] : attributes[:delivery_window],
    send_time_category: attributes.key?("sendTimeCategory") ? attributes["sendTimeCategory"] : attributes[:send_time_category],
    tracking_settings: attributes.key?("trackingSettings") ? attributes["trackingSettings"] : attributes[:tracking_settings],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 190

def to_h
  {
    from: @from,
    to: @to,
    cc: @cc,
    bcc: @bcc,
    reply_to: @reply_to,
    subject: @subject,
    html: @html,
    text: @text,
    tags: @tags,
    metadata: @metadata,
    idempotency_key: @idempotency_key,
    test_mode: @test_mode,
    attachments: @attachments,
    scheduled_at: @scheduled_at,
    delivery_window: @delivery_window,
    send_time_category: @send_time_category,
    tracking_settings: @tracking_settings,
  }.compact
end