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
257 258 259 260 261 262 263 264 265 266 |
# File 'lib/twilio-ruby/rest/insights/v2/outbound.rb', line 257 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
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 |
# File 'lib/twilio-ruby/rest/insights/v2/outbound.rb', line 271 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
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
# File 'lib/twilio-ruby/rest/insights/v2/outbound.rb', line 292 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
325 326 327 328 |
# File 'lib/twilio-ruby/rest/insights/v2/outbound.rb', line 325 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Insights.V2.OutboundContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
318 319 320 321 |
# File 'lib/twilio-ruby/rest/insights/v2/outbound.rb', line 318 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Insights.V2.OutboundContext #{context}>" end |