Class: Twilio::REST::Insights::V1::CallContext::MetricInstance

Inherits:
Twilio::REST::InstanceResource show all
Defined in:
lib/twilio-ruby/rest/insights/v1/call/metric.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, call_sid: nil) ⇒ MetricInstance

Initialize the MetricInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this Metric resource.

  • sid (String)

    The SID of the Call resource to fetch.



277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/twilio-ruby/rest/insights/v1/call/metric.rb', line 277

def initialize(version, payload , call_sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'timestamp' => payload['timestamp'],
        'call_sid' => payload['call_sid'],
        'account_sid' => payload['account_sid'],
        'edge' => payload['edge'],
        'direction' => payload['direction'],
        'carrier_edge' => payload['carrier_edge'],
        'sip_edge' => payload['sip_edge'],
        'sdk_edge' => payload['sdk_edge'],
        'client_edge' => payload['client_edge'],
    }
end

Instance Method Details

#account_sidString

Returns The unique SID identifier of the Account.

Returns:

  • (String)

    The unique SID identifier of the Account.



310
311
312
# File 'lib/twilio-ruby/rest/insights/v1/call/metric.rb', line 310

def 
    @properties['account_sid']
end

#call_sidString

Returns The unique SID identifier of the Call.

Returns:

  • (String)

    The unique SID identifier of the Call.



304
305
306
# File 'lib/twilio-ruby/rest/insights/v1/call/metric.rb', line 304

def call_sid
    @properties['call_sid']
end

#carrier_edgeHash

Returns Contains metrics and properties for the Twilio media gateway of a PSTN call.

Returns:

  • (Hash)

    Contains metrics and properties for the Twilio media gateway of a PSTN call.



328
329
330
# File 'lib/twilio-ruby/rest/insights/v1/call/metric.rb', line 328

def carrier_edge
    @properties['carrier_edge']
end

#client_edgeHash

Returns Contains metrics and properties for the Twilio media gateway of a Client call.

Returns:

  • (Hash)

    Contains metrics and properties for the Twilio media gateway of a Client call.



346
347
348
# File 'lib/twilio-ruby/rest/insights/v1/call/metric.rb', line 346

def client_edge
    @properties['client_edge']
end

#directionStreamDirection

Returns:

  • (StreamDirection)


322
323
324
# File 'lib/twilio-ruby/rest/insights/v1/call/metric.rb', line 322

def direction
    @properties['direction']
end

#edgeTwilioEdge

Returns:

  • (TwilioEdge)


316
317
318
# File 'lib/twilio-ruby/rest/insights/v1/call/metric.rb', line 316

def edge
    @properties['edge']
end

#inspectObject

Provide a detailed, user friendly representation



358
359
360
# File 'lib/twilio-ruby/rest/insights/v1/call/metric.rb', line 358

def inspect
    "<Twilio.Insights.V1.MetricInstance>"
end

#sdk_edgeHash

Returns Contains metrics and properties for the SDK sensor library for Client calls.

Returns:

  • (Hash)

    Contains metrics and properties for the SDK sensor library for Client calls.



340
341
342
# File 'lib/twilio-ruby/rest/insights/v1/call/metric.rb', line 340

def sdk_edge
    @properties['sdk_edge']
end

#sip_edgeHash

Returns Contains metrics and properties for the Twilio media gateway of a SIP Interface or Trunking call.

Returns:

  • (Hash)

    Contains metrics and properties for the Twilio media gateway of a SIP Interface or Trunking call.



334
335
336
# File 'lib/twilio-ruby/rest/insights/v1/call/metric.rb', line 334

def sip_edge
    @properties['sip_edge']
end

#timestampString

Returns Timestamp of metric sample. Samples are taken every 10 seconds and contain the metrics for the previous 10 seconds.

Returns:

  • (String)

    Timestamp of metric sample. Samples are taken every 10 seconds and contain the metrics for the previous 10 seconds.



298
299
300
# File 'lib/twilio-ruby/rest/insights/v1/call/metric.rb', line 298

def timestamp
    @properties['timestamp']
end

#to_sObject

Provide a user friendly representation



352
353
354
# File 'lib/twilio-ruby/rest/insights/v1/call/metric.rb', line 352

def to_s
    "<Twilio.Insights.V1.MetricInstance>"
end