Class: ApolloDeploySignalSdkRails::EmailPerformanceResponse

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

Overview

Schema type: EmailPerformanceResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(email_id:, subject:, from_address:, topic_id:, status:, delivered:, opened:, clicked:, total_clicks:, bounced:, complained:, unsubscribed:, read_engaged:, read_time_seconds:, read_category:, sent_at:, last_event_at:, computed_at:) ⇒ EmailPerformanceResponse

Returns a new instance of EmailPerformanceResponse.

Parameters:

  • email_id (String)

    , subject [String], from_address [String], topic_id [String, nil], status [String], delivered [Boolean], opened [Boolean], clicked [Boolean], total_clicks [Integer], bounced [Boolean], complained [Boolean], unsubscribed [Boolean], read_engaged [Boolean], read_time_seconds [Float, nil], read_category [String, nil], sent_at [String, nil], last_event_at [String, nil], computed_at [String]



1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1001

def initialize(email_id: , subject: , from_address: , topic_id: , status: , delivered: , opened: , clicked: , total_clicks: , bounced: , complained: , unsubscribed: , read_engaged: , read_time_seconds: , read_category: , sent_at: , last_event_at: , computed_at: )
  @email_id = email_id
  @subject = subject
  @from_address = from_address
  @topic_id = topic_id
  @status = status
  @delivered = delivered
  @opened = opened
  @clicked = clicked
  @total_clicks = total_clicks
  @bounced = bounced
  @complained = complained
  @unsubscribed = unsubscribed
  @read_engaged = read_engaged
  @read_time_seconds = read_time_seconds
  @read_category = read_category
  @sent_at = sent_at
  @last_event_at = last_event_at
  @computed_at = computed_at
end

Instance Attribute Details

#bouncedBoolean

Returns:

  • (Boolean)


982
983
984
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 982

def bounced
  @bounced
end

#clickedBoolean

Returns:

  • (Boolean)


978
979
980
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 978

def clicked
  @clicked
end

#complainedBoolean

Returns:

  • (Boolean)


984
985
986
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 984

def complained
  @complained
end

#computed_atString

Returns:

  • (String)


998
999
1000
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 998

def computed_at
  @computed_at
end

#deliveredBoolean

Returns:

  • (Boolean)


974
975
976
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 974

def delivered
  @delivered
end

#email_idString

Returns:

  • (String)


964
965
966
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 964

def email_id
  @email_id
end

#from_addressString

Returns:

  • (String)


968
969
970
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 968

def from_address
  @from_address
end

#last_event_atString?

Returns:

  • (String, nil)


996
997
998
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 996

def last_event_at
  @last_event_at
end

#openedBoolean

Returns:

  • (Boolean)


976
977
978
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 976

def opened
  @opened
end

#read_categoryString?

Returns:

  • (String, nil)


992
993
994
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 992

def read_category
  @read_category
end

#read_engagedBoolean

Returns:

  • (Boolean)


988
989
990
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 988

def read_engaged
  @read_engaged
end

#read_time_secondsFloat?

Returns:

  • (Float, nil)


990
991
992
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 990

def read_time_seconds
  @read_time_seconds
end

#sent_atString?

Returns:

  • (String, nil)


994
995
996
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 994

def sent_at
  @sent_at
end

#statusString

Returns:

  • (String)


972
973
974
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 972

def status
  @status
end

#subjectString

Returns:

  • (String)


966
967
968
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 966

def subject
  @subject
end

#topic_idString?

Returns:

  • (String, nil)


970
971
972
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 970

def topic_id
  @topic_id
end

#total_clicksInteger

Returns:

  • (Integer)


980
981
982
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 980

def total_clicks
  @total_clicks
end

#unsubscribedBoolean

Returns:

  • (Boolean)


986
987
988
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 986

def unsubscribed
  @unsubscribed
end

Class Method Details

.from_json(attributes) ⇒ EmailPerformanceResponse

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1049

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

  new(
    email_id: attributes.key?("emailId") ? attributes["emailId"] : attributes[:email_id],
    subject: attributes.key?("subject") ? attributes["subject"] : attributes[:subject],
    from_address: attributes.key?("fromAddress") ? attributes["fromAddress"] : attributes[:from_address],
    topic_id: attributes.key?("topicId") ? attributes["topicId"] : attributes[:topic_id],
    status: attributes.key?("status") ? attributes["status"] : attributes[:status],
    delivered: attributes.key?("delivered") ? attributes["delivered"] : attributes[:delivered],
    opened: attributes.key?("opened") ? attributes["opened"] : attributes[:opened],
    clicked: attributes.key?("clicked") ? attributes["clicked"] : attributes[:clicked],
    total_clicks: attributes.key?("totalClicks") ? attributes["totalClicks"] : attributes[:total_clicks],
    bounced: attributes.key?("bounced") ? attributes["bounced"] : attributes[:bounced],
    complained: attributes.key?("complained") ? attributes["complained"] : attributes[:complained],
    unsubscribed: attributes.key?("unsubscribed") ? attributes["unsubscribed"] : attributes[:unsubscribed],
    read_engaged: attributes.key?("readEngaged") ? attributes["readEngaged"] : attributes[:read_engaged],
    read_time_seconds: attributes.key?("readTimeSeconds") ? attributes["readTimeSeconds"] : attributes[:read_time_seconds],
    read_category: attributes.key?("readCategory") ? attributes["readCategory"] : attributes[:read_category],
    sent_at: attributes.key?("sentAt") ? attributes["sentAt"] : attributes[:sent_at],
    last_event_at: attributes.key?("lastEventAt") ? attributes["lastEventAt"] : attributes[:last_event_at],
    computed_at: attributes.key?("computedAt") ? attributes["computedAt"] : attributes[:computed_at],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1023

def to_h
  {
    email_id: @email_id,
    subject: @subject,
    from_address: @from_address,
    topic_id: @topic_id,
    status: @status,
    delivered: @delivered,
    opened: @opened,
    clicked: @clicked,
    total_clicks: @total_clicks,
    bounced: @bounced,
    complained: @complained,
    unsubscribed: @unsubscribed,
    read_engaged: @read_engaged,
    read_time_seconds: @read_time_seconds,
    read_category: @read_category,
    sent_at: @sent_at,
    last_event_at: @last_event_at,
    computed_at: @computed_at,
  }.compact
end