Class: Twilio::REST::Insights::V2::OutboundContext
- Inherits:
-
Twilio::REST::InstanceContext
- Object
- Twilio::REST::InstanceContext
- Twilio::REST::Insights::V2::OutboundContext
- Defined in:
- lib/twilio-ruby/rest/insights/v2/outbound.rb
Instance Method Summary collapse
-
#create(insights_v2_create_phone_numbers_report_request: :unset) ⇒ OutboundInstance
Create the OutboundInstance.
-
#create_with_metadata(insights_v2_create_phone_numbers_report_request: :unset) ⇒ OutboundInstance
Create the OutboundInstanceMetadata.
-
#initialize(version, report_id) ⇒ OutboundContext
constructor
Initialize the OutboundContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, report_id) ⇒ OutboundContext
Initialize the OutboundContext
249 250 251 252 253 254 255 256 257 258 |
# File 'lib/twilio-ruby/rest/insights/v2/outbound.rb', line 249 def initialize(version, report_id) super(version) # Path Solution @solution = { report_id: report_id, } @uri = "/Voice/Reports/PhoneNumbers/Outbound" end |
Instance Method Details
#create(insights_v2_create_phone_numbers_report_request: :unset) ⇒ OutboundInstance
Create the OutboundInstance
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 |
# File 'lib/twilio-ruby/rest/insights/v2/outbound.rb', line 263 def create(insights_v2_create_phone_numbers_report_request: :unset ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' payload = @version.create('POST', @uri, headers: headers, data: insights_v2_create_phone_numbers_report_request.to_json) OutboundInstance.new( @version, payload, report_id: @solution[:report_id], ) end |
#create_with_metadata(insights_v2_create_phone_numbers_report_request: :unset) ⇒ OutboundInstance
Create the OutboundInstanceMetadata
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 |
# File 'lib/twilio-ruby/rest/insights/v2/outbound.rb', line 284 def (insights_v2_create_phone_numbers_report_request: :unset ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' response = @version.('POST', @uri, headers: headers, data: insights_v2_create_phone_numbers_report_request.to_json) outbound_instance = OutboundInstance.new( @version, response.body, report_id: @solution[:report_id], ) OutboundInstanceMetadata.new( @version, outbound_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
317 318 319 320 |
# File 'lib/twilio-ruby/rest/insights/v2/outbound.rb', line 317 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Insights.V2.OutboundContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
310 311 312 313 |
# File 'lib/twilio-ruby/rest/insights/v2/outbound.rb', line 310 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Insights.V2.OutboundContext #{context}>" end |