Class: ApolloDeploySignalSdk::TopicPerformanceResponse

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

Overview

Schema type: TopicPerformanceResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(topic_id:, topic_name:, window:, total_emails:, delivered:, delivery_rate:, opened:, open_rate:, clicked:, click_rate:, bounced:, bounce_rate:, complained:, complaint_rate:, unsubscribed:, unsubscribe_rate:, read_engaged:, read_engagement_rate:, avg_read_time_seconds:, opt_in_count:, opt_out_count:, computed_at:) ⇒ TopicPerformanceResponse

Returns a new instance of TopicPerformanceResponse.

Parameters:

  • topic_id (String)

    , topic_name [String], window [MetricsWindowResponse], total_emails [Integer], delivered [Integer], delivery_rate [Float], opened [Integer], open_rate [Float], clicked [Integer], click_rate [Float], bounced [Integer], bounce_rate [Float], complained [Integer], complaint_rate [Float], unsubscribed [Integer], unsubscribe_rate [Float], read_engaged [Integer], read_engagement_rate [Float], avg_read_time_seconds [Float, nil], opt_in_count [Integer], opt_out_count [Integer], computed_at [String]



875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 875

def initialize(topic_id: , topic_name: , window: , total_emails: , delivered: , delivery_rate: , opened: , open_rate: , clicked: , click_rate: , bounced: , bounce_rate: , complained: , complaint_rate: , unsubscribed: , unsubscribe_rate: , read_engaged: , read_engagement_rate: , avg_read_time_seconds: , opt_in_count: , opt_out_count: , computed_at: )
  @topic_id = topic_id
  @topic_name = topic_name
  @window = window
  @total_emails = total_emails
  @delivered = delivered
  @delivery_rate = delivery_rate
  @opened = opened
  @open_rate = open_rate
  @clicked = clicked
  @click_rate = click_rate
  @bounced = bounced
  @bounce_rate = bounce_rate
  @complained = complained
  @complaint_rate = complaint_rate
  @unsubscribed = unsubscribed
  @unsubscribe_rate = unsubscribe_rate
  @read_engaged = read_engaged
  @read_engagement_rate = read_engagement_rate
  @avg_read_time_seconds = avg_read_time_seconds
  @opt_in_count = opt_in_count
  @opt_out_count = opt_out_count
  @computed_at = computed_at
end

Instance Attribute Details

#avg_read_time_secondsFloat?

Returns:

  • (Float, nil)


866
867
868
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 866

def avg_read_time_seconds
  @avg_read_time_seconds
end

#bounce_rateFloat

Returns:

  • (Float)


852
853
854
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 852

def bounce_rate
  @bounce_rate
end

#bouncedInteger

Returns:

  • (Integer)


850
851
852
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 850

def bounced
  @bounced
end

#click_rateFloat

Returns:

  • (Float)


848
849
850
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 848

def click_rate
  @click_rate
end

#clickedInteger

Returns:

  • (Integer)


846
847
848
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 846

def clicked
  @clicked
end

#complainedInteger

Returns:

  • (Integer)


854
855
856
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 854

def complained
  @complained
end

#complaint_rateFloat

Returns:

  • (Float)


856
857
858
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 856

def complaint_rate
  @complaint_rate
end

#computed_atString

Returns:

  • (String)


872
873
874
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 872

def computed_at
  @computed_at
end

#deliveredInteger

Returns:

  • (Integer)


838
839
840
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 838

def delivered
  @delivered
end

#delivery_rateFloat

Returns:

  • (Float)


840
841
842
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 840

def delivery_rate
  @delivery_rate
end

#open_rateFloat

Returns:

  • (Float)


844
845
846
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 844

def open_rate
  @open_rate
end

#openedInteger

Returns:

  • (Integer)


842
843
844
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 842

def opened
  @opened
end

#opt_in_countInteger

Returns:

  • (Integer)


868
869
870
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 868

def opt_in_count
  @opt_in_count
end

#opt_out_countInteger

Returns:

  • (Integer)


870
871
872
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 870

def opt_out_count
  @opt_out_count
end

#read_engagedInteger

Returns:

  • (Integer)


862
863
864
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 862

def read_engaged
  @read_engaged
end

#read_engagement_rateFloat

Returns:

  • (Float)


864
865
866
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 864

def read_engagement_rate
  @read_engagement_rate
end

#topic_idString

Returns:

  • (String)


830
831
832
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 830

def topic_id
  @topic_id
end

#topic_nameString

Returns:

  • (String)


832
833
834
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 832

def topic_name
  @topic_name
end

#total_emailsInteger

Returns:

  • (Integer)


836
837
838
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 836

def total_emails
  @total_emails
end

#unsubscribe_rateFloat

Returns:

  • (Float)


860
861
862
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 860

def unsubscribe_rate
  @unsubscribe_rate
end

#unsubscribedInteger

Returns:

  • (Integer)


858
859
860
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 858

def unsubscribed
  @unsubscribed
end

#windowMetricsWindowResponse



834
835
836
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 834

def window
  @window
end

Class Method Details

.from_json(attributes) ⇒ TopicPerformanceResponse

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 931

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

  new(
    topic_id: attributes.key?("topicId") ? attributes["topicId"] : attributes[:topic_id],
    topic_name: attributes.key?("topicName") ? attributes["topicName"] : attributes[:topic_name],
    window: attributes.key?("window") ? attributes["window"] : attributes[:window],
    total_emails: attributes.key?("totalEmails") ? attributes["totalEmails"] : attributes[:total_emails],
    delivered: attributes.key?("delivered") ? attributes["delivered"] : attributes[:delivered],
    delivery_rate: attributes.key?("deliveryRate") ? attributes["deliveryRate"] : attributes[:delivery_rate],
    opened: attributes.key?("opened") ? attributes["opened"] : attributes[:opened],
    open_rate: attributes.key?("openRate") ? attributes["openRate"] : attributes[:open_rate],
    clicked: attributes.key?("clicked") ? attributes["clicked"] : attributes[:clicked],
    click_rate: attributes.key?("clickRate") ? attributes["clickRate"] : attributes[:click_rate],
    bounced: attributes.key?("bounced") ? attributes["bounced"] : attributes[:bounced],
    bounce_rate: attributes.key?("bounceRate") ? attributes["bounceRate"] : attributes[:bounce_rate],
    complained: attributes.key?("complained") ? attributes["complained"] : attributes[:complained],
    complaint_rate: attributes.key?("complaintRate") ? attributes["complaintRate"] : attributes[:complaint_rate],
    unsubscribed: attributes.key?("unsubscribed") ? attributes["unsubscribed"] : attributes[:unsubscribed],
    unsubscribe_rate: attributes.key?("unsubscribeRate") ? attributes["unsubscribeRate"] : attributes[:unsubscribe_rate],
    read_engaged: attributes.key?("readEngaged") ? attributes["readEngaged"] : attributes[:read_engaged],
    read_engagement_rate: attributes.key?("readEngagementRate") ? attributes["readEngagementRate"] : attributes[:read_engagement_rate],
    avg_read_time_seconds: attributes.key?("avgReadTimeSeconds") ? attributes["avgReadTimeSeconds"] : attributes[:avg_read_time_seconds],
    opt_in_count: attributes.key?("optInCount") ? attributes["optInCount"] : attributes[:opt_in_count],
    opt_out_count: attributes.key?("optOutCount") ? attributes["optOutCount"] : attributes[:opt_out_count],
    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



901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 901

def to_h
  {
    topic_id: @topic_id,
    topic_name: @topic_name,
    window: @window,
    total_emails: @total_emails,
    delivered: @delivered,
    delivery_rate: @delivery_rate,
    opened: @opened,
    open_rate: @open_rate,
    clicked: @clicked,
    click_rate: @click_rate,
    bounced: @bounced,
    bounce_rate: @bounce_rate,
    complained: @complained,
    complaint_rate: @complaint_rate,
    unsubscribed: @unsubscribed,
    unsubscribe_rate: @unsubscribe_rate,
    read_engaged: @read_engaged,
    read_engagement_rate: @read_engagement_rate,
    avg_read_time_seconds: @avg_read_time_seconds,
    opt_in_count: @opt_in_count,
    opt_out_count: @opt_out_count,
    computed_at: @computed_at,
  }.compact
end