Class: ApolloDeploySignalSdkRails::EmailDetailResponse

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

Overview

Schema type: EmailDetailResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, message_id:, from:, to:, cc:, bcc:, reply_to:, subject:, html: nil, text: nil, status:, error:, tags:, metadata:, test_mode:, topic_id: nil, created_at:, sent_at:, updated_at:) ⇒ EmailDetailResponse

Returns a new instance of EmailDetailResponse.

Parameters:

  • id (String)

    , message_id [String, nil], from [String], to [Array], cc [Array], bcc [Array], reply_to [String, nil], subject [String], html [String, nil], text [String, nil], status [String], error [String, nil], tags [Hash=> String], metadata [Hash=> String], test_mode [Boolean], topic_id [String, nil], created_at [String], sent_at [String, nil], updated_at [String, nil]



400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 400

def initialize(id: , message_id: , from: , to: , cc: , bcc: , reply_to: , subject: , html: nil, text: nil, status: , error: , tags: , metadata: , test_mode: , topic_id: nil, created_at: , sent_at: , updated_at: )
  @id = id
  @message_id = message_id
  @from = from
  @to = to
  @cc = cc
  @bcc = bcc
  @reply_to = reply_to
  @subject = subject
  @html = html
  @text = text
  @status = status
  @error = error
  @tags = tags
  @metadata = 
  @test_mode = test_mode
  @topic_id = topic_id
  @created_at = created_at
  @sent_at = sent_at
  @updated_at = updated_at
end

Instance Attribute Details

#bccArray<String>

Returns:

  • (Array<String>)


371
372
373
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 371

def bcc
  @bcc
end

#ccArray<String>

Returns:

  • (Array<String>)


369
370
371
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 369

def cc
  @cc
end

#created_atString

Returns:

  • (String)


393
394
395
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 393

def created_at
  @created_at
end

#errorString?

Returns:

  • (String, nil)


383
384
385
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 383

def error
  @error
end

#fromString

Returns:

  • (String)


365
366
367
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 365

def from
  @from
end

#htmlString?

Returns:

  • (String, nil)


377
378
379
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 377

def html
  @html
end

#idString

Returns:

  • (String)


361
362
363
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 361

def id
  @id
end

#message_idString?

Returns:

  • (String, nil)


363
364
365
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 363

def message_id
  @message_id
end

#metadataHash{String => String}

Returns:

  • (Hash{String => String})


387
388
389
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 387

def 
  @metadata
end

#reply_toString?

Returns:

  • (String, nil)


373
374
375
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 373

def reply_to
  @reply_to
end

#sent_atString?

Returns:

  • (String, nil)


395
396
397
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 395

def sent_at
  @sent_at
end

#statusString

Returns:

  • (String)


381
382
383
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 381

def status
  @status
end

#subjectString

Returns:

  • (String)


375
376
377
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 375

def subject
  @subject
end

#tagsHash{String => String}

Returns:

  • (Hash{String => String})


385
386
387
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 385

def tags
  @tags
end

#test_modeBoolean

Returns:

  • (Boolean)


389
390
391
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 389

def test_mode
  @test_mode
end

#textString?

Returns:

  • (String, nil)


379
380
381
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 379

def text
  @text
end

#toArray<String>

Returns:

  • (Array<String>)


367
368
369
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 367

def to
  @to
end

#topic_idString?

Returns:

  • (String, nil)


391
392
393
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 391

def topic_id
  @topic_id
end

#updated_atString?

Returns:

  • (String, nil)


397
398
399
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 397

def updated_at
  @updated_at
end

Class Method Details

.from_json(attributes) ⇒ EmailDetailResponse

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 450

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

  new(
    id: attributes.key?("id") ? attributes["id"] : attributes[:id],
    message_id: attributes.key?("messageId") ? attributes["messageId"] : attributes[:message_id],
    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],
    status: attributes.key?("status") ? attributes["status"] : attributes[:status],
    error: attributes.key?("error") ? attributes["error"] : attributes[:error],
    tags: attributes.key?("tags") ? attributes["tags"] : attributes[:tags],
    metadata: attributes.key?("metadata") ? attributes["metadata"] : attributes[:metadata],
    test_mode: attributes.key?("testMode") ? attributes["testMode"] : attributes[:test_mode],
    topic_id: attributes.key?("topicId") ? attributes["topicId"] : attributes[:topic_id],
    created_at: attributes.key?("createdAt") ? attributes["createdAt"] : attributes[:created_at],
    sent_at: attributes.key?("sentAt") ? attributes["sentAt"] : attributes[:sent_at],
    updated_at: attributes.key?("updatedAt") ? attributes["updatedAt"] : attributes[:updated_at],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 423

def to_h
  {
    id: @id,
    message_id: @message_id,
    from: @from,
    to: @to,
    cc: @cc,
    bcc: @bcc,
    reply_to: @reply_to,
    subject: @subject,
    html: @html,
    text: @text,
    status: @status,
    error: @error,
    tags: @tags,
    metadata: @metadata,
    test_mode: @test_mode,
    topic_id: @topic_id,
    created_at: @created_at,
    sent_at: @sent_at,
    updated_at: @updated_at,
  }.compact
end