Class: ApolloDeploySignalSdk::ProjectMetricsSummaryResponse

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

Overview

Schema type: ProjectMetricsSummaryResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_id:, window:, sent:, delivered:, opened:, clicked:, bounced:, complained:, failed:, unsubscribed:, read_engaged:, delivery_rate:, open_rate:, click_rate:, bounce_rate:, complaint_rate:, read_engagement_rate:) ⇒ ProjectMetricsSummaryResponse

Returns a new instance of ProjectMetricsSummaryResponse.

Parameters:

  • project_id (String)

    , window [MetricsWindowResponse], sent [Integer], delivered [Integer], opened [Integer], clicked [Integer], bounced [Integer], complained [Integer], failed [Integer], unsubscribed [Integer], read_engaged [Integer], delivery_rate [Float], open_rate [Float], click_rate [Float], bounce_rate [Float], complaint_rate [Float], read_engagement_rate [Float]



1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1237

def initialize(project_id: , window: , sent: , delivered: , opened: , clicked: , bounced: , complained: , failed: , unsubscribed: , read_engaged: , delivery_rate: , open_rate: , click_rate: , bounce_rate: , complaint_rate: , read_engagement_rate: )
  @project_id = project_id
  @window = window
  @sent = sent
  @delivered = delivered
  @opened = opened
  @clicked = clicked
  @bounced = bounced
  @complained = complained
  @failed = failed
  @unsubscribed = unsubscribed
  @read_engaged = read_engaged
  @delivery_rate = delivery_rate
  @open_rate = open_rate
  @click_rate = click_rate
  @bounce_rate = bounce_rate
  @complaint_rate = complaint_rate
  @read_engagement_rate = read_engagement_rate
end

Instance Attribute Details

#bounce_rateFloat

Returns:

  • (Float)


1230
1231
1232
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1230

def bounce_rate
  @bounce_rate
end

#bouncedInteger

Returns:

  • (Integer)


1214
1215
1216
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1214

def bounced
  @bounced
end

#click_rateFloat

Returns:

  • (Float)


1228
1229
1230
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1228

def click_rate
  @click_rate
end

#clickedInteger

Returns:

  • (Integer)


1212
1213
1214
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1212

def clicked
  @clicked
end

#complainedInteger

Returns:

  • (Integer)


1216
1217
1218
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1216

def complained
  @complained
end

#complaint_rateFloat

Returns:

  • (Float)


1232
1233
1234
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1232

def complaint_rate
  @complaint_rate
end

#deliveredInteger

Returns:

  • (Integer)


1208
1209
1210
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1208

def delivered
  @delivered
end

#delivery_rateFloat

Returns:

  • (Float)


1224
1225
1226
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1224

def delivery_rate
  @delivery_rate
end

#failedInteger

Returns:

  • (Integer)


1218
1219
1220
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1218

def failed
  @failed
end

#open_rateFloat

Returns:

  • (Float)


1226
1227
1228
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1226

def open_rate
  @open_rate
end

#openedInteger

Returns:

  • (Integer)


1210
1211
1212
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1210

def opened
  @opened
end

#project_idString

Returns:

  • (String)


1202
1203
1204
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1202

def project_id
  @project_id
end

#read_engagedInteger

Returns:

  • (Integer)


1222
1223
1224
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1222

def read_engaged
  @read_engaged
end

#read_engagement_rateFloat

Returns:

  • (Float)


1234
1235
1236
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1234

def read_engagement_rate
  @read_engagement_rate
end

#sentInteger

Returns:

  • (Integer)


1206
1207
1208
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1206

def sent
  @sent
end

#unsubscribedInteger

Returns:

  • (Integer)


1220
1221
1222
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1220

def unsubscribed
  @unsubscribed
end

#windowMetricsWindowResponse



1204
1205
1206
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1204

def window
  @window
end

Class Method Details

.from_json(attributes) ⇒ ProjectMetricsSummaryResponse

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1283

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

  new(
    project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
    window: attributes.key?("window") ? attributes["window"] : attributes[:window],
    sent: attributes.key?("sent") ? attributes["sent"] : attributes[:sent],
    delivered: attributes.key?("delivered") ? attributes["delivered"] : attributes[:delivered],
    opened: attributes.key?("opened") ? attributes["opened"] : attributes[:opened],
    clicked: attributes.key?("clicked") ? attributes["clicked"] : attributes[:clicked],
    bounced: attributes.key?("bounced") ? attributes["bounced"] : attributes[:bounced],
    complained: attributes.key?("complained") ? attributes["complained"] : attributes[:complained],
    failed: attributes.key?("failed") ? attributes["failed"] : attributes[:failed],
    unsubscribed: attributes.key?("unsubscribed") ? attributes["unsubscribed"] : attributes[:unsubscribed],
    read_engaged: attributes.key?("readEngaged") ? attributes["readEngaged"] : attributes[:read_engaged],
    delivery_rate: attributes.key?("deliveryRate") ? attributes["deliveryRate"] : attributes[:delivery_rate],
    open_rate: attributes.key?("openRate") ? attributes["openRate"] : attributes[:open_rate],
    click_rate: attributes.key?("clickRate") ? attributes["clickRate"] : attributes[:click_rate],
    bounce_rate: attributes.key?("bounceRate") ? attributes["bounceRate"] : attributes[:bounce_rate],
    complaint_rate: attributes.key?("complaintRate") ? attributes["complaintRate"] : attributes[:complaint_rate],
    read_engagement_rate: attributes.key?("readEngagementRate") ? attributes["readEngagementRate"] : attributes[:read_engagement_rate],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1258

def to_h
  {
    project_id: @project_id,
    window: @window,
    sent: @sent,
    delivered: @delivered,
    opened: @opened,
    clicked: @clicked,
    bounced: @bounced,
    complained: @complained,
    failed: @failed,
    unsubscribed: @unsubscribed,
    read_engaged: @read_engaged,
    delivery_rate: @delivery_rate,
    open_rate: @open_rate,
    click_rate: @click_rate,
    bounce_rate: @bounce_rate,
    complaint_rate: @complaint_rate,
    read_engagement_rate: @read_engagement_rate,
  }.compact
end