Class: Twilio::REST::Insights::V2::ReportContext
- Inherits:
-
Twilio::REST::InstanceContext
- Object
- Twilio::REST::InstanceContext
- Twilio::REST::Insights::V2::ReportContext
- Defined in:
- lib/twilio-ruby/rest/insights/v2/report.rb
Instance Method Summary collapse
-
#fetch ⇒ ReportInstance
Fetch the ReportInstance.
-
#fetch_with_metadata ⇒ ReportInstance
Fetch the ReportInstanceMetadata.
-
#initialize(version, report_id) ⇒ ReportContext
constructor
Initialize the ReportContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, report_id) ⇒ ReportContext
Initialize the ReportContext
535 536 537 538 539 540 541 542 543 544 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 535 def initialize(version, report_id) super(version) # Path Solution @solution = { report_id: report_id, } @uri = "/Voice/Reports/#{@solution[:report_id]}" end |
Instance Method Details
#fetch ⇒ ReportInstance
Fetch the ReportInstance
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 548 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) ReportInstance.new( @version, payload, report_id: @solution[:report_id], ) end |
#fetch_with_metadata ⇒ ReportInstance
Fetch the ReportInstanceMetadata
567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 567 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) report_instance = ReportInstance.new( @version, response.body, report_id: @solution[:report_id], ) ReportInstanceMetadata.new( @version, report_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
599 600 601 602 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 599 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Insights.V2.ReportContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
592 593 594 595 |
# File 'lib/twilio-ruby/rest/insights/v2/report.rb', line 592 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Insights.V2.ReportContext #{context}>" end |