Class: Twilio::REST::Insights::V1::CallContext
- Inherits:
-
Twilio::REST::InstanceContext
- Object
- Twilio::REST::InstanceContext
- Twilio::REST::Insights::V1::CallContext
- Defined in:
- lib/twilio-ruby/rest/insights/v1/call.rb,
lib/twilio-ruby/rest/insights/v1/call/event.rb,
lib/twilio-ruby/rest/insights/v1/call/metric.rb,
lib/twilio-ruby/rest/insights/v1/call/summary.rb
Overview
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected]
Defined Under Namespace
Classes: CallSummaryContext, CallSummaryInstance, CallSummaryList, CallSummaryPage, EventInstance, EventList, EventPage, MetricInstance, MetricList, MetricPage
Instance Method Summary collapse
-
#events ⇒ EventList, EventContext
Access the events.
-
#fetch ⇒ CallInstance
Fetch the CallInstance.
-
#initialize(version, sid) ⇒ CallContext
constructor
Initialize the CallContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#metrics ⇒ MetricList, MetricContext
Access the metrics.
-
#summary ⇒ CallSummaryList, CallSummaryContext
Access the summary.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, sid) ⇒ CallContext
Initialize the CallContext
73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 73 def initialize(version, sid) super(version) # Path Solution @solution = {sid: sid, } @uri = "/Voice/#{@solution[:sid]}" # Dependents @events = nil @metrics = nil @summary = nil end |
Instance Method Details
#events ⇒ EventList, EventContext
Access the events
99 100 101 102 103 104 105 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 99 def events unless @events @events = EventList.new(@version, call_sid: @solution[:sid], ) end @events end |
#fetch ⇒ CallInstance
Fetch the CallInstance
89 90 91 92 93 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 89 def fetch payload = @version.fetch('GET', @uri) CallInstance.new(@version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
136 137 138 139 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 136 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Insights.V1.CallContext #{context}>" end |
#metrics ⇒ MetricList, MetricContext
Access the metrics
111 112 113 114 115 116 117 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 111 def metrics unless @metrics @metrics = MetricList.new(@version, call_sid: @solution[:sid], ) end @metrics end |
#summary ⇒ CallSummaryList, CallSummaryContext
Access the summary
123 124 125 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 123 def summary CallSummaryContext.new(@version, @solution[:sid], ) end |
#to_s ⇒ Object
Provide a user friendly representation
129 130 131 132 |
# File 'lib/twilio-ruby/rest/insights/v1/call.rb', line 129 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Insights.V1.CallContext #{context}>" end |