Class: Twilio::REST::Insights::V2::InboundContext
- Inherits:
-
Twilio::REST::InstanceContext
- Object
- Twilio::REST::InstanceContext
- Twilio::REST::Insights::V2::InboundContext
- Defined in:
- lib/twilio-ruby/rest/insights/v2/inbound.rb
Instance Method Summary collapse
-
#create(insights_v2_create_phone_numbers_report_request: :unset) ⇒ InboundInstance
Create the InboundInstance.
-
#create_with_metadata(insights_v2_create_phone_numbers_report_request: :unset) ⇒ InboundInstance
Create the InboundInstanceMetadata.
-
#initialize(version, report_id) ⇒ InboundContext
constructor
Initialize the InboundContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, report_id) ⇒ InboundContext
Initialize the InboundContext
227 228 229 230 231 232 233 234 235 236 |
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 227 def initialize(version, report_id) super(version) # Path Solution @solution = { report_id: report_id, } @uri = "/Voice/Reports/PhoneNumbers/Inbound" end |
Instance Method Details
#create(insights_v2_create_phone_numbers_report_request: :unset) ⇒ InboundInstance
Create the InboundInstance
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 |
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 241 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) InboundInstance.new( @version, payload, report_id: @solution[:report_id], ) end |
#create_with_metadata(insights_v2_create_phone_numbers_report_request: :unset) ⇒ InboundInstance
Create the InboundInstanceMetadata
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 262 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) inbound_instance = InboundInstance.new( @version, response.body, report_id: @solution[:report_id], ) InboundInstanceMetadata.new( @version, inbound_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
295 296 297 298 |
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 295 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Insights.V2.InboundContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
288 289 290 291 |
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 288 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Insights.V2.InboundContext #{context}>" end |