Class: Twilio::REST::Insights::V2::InboundContext

Inherits:
Twilio::REST::InstanceContext show all
Defined in:
lib/twilio-ruby/rest/insights/v2/inbound.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, report_id) ⇒ InboundContext

Initialize the InboundContext

Parameters:

  • version (Version)

    Version that contains the resource

  • report_id (String)

    A unique Report Id.



235
236
237
238
239
240
241
242
243
244
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 235

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

Parameters:

  • insights_v2_create_phone_numbers_report_request (InsightsV2CreatePhoneNumbersReportRequest) (defaults to: :unset)

Returns:



249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 249

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

Parameters:

  • insights_v2_create_phone_numbers_report_request (InsightsV2CreatePhoneNumbersReportRequest) (defaults to: :unset)

Returns:



270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 270

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

#inspectObject

Provide a detailed, user friendly representation



303
304
305
306
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 303

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Insights.V2.InboundContext #{context}>"
end

#to_sObject

Provide a user friendly representation



296
297
298
299
# File 'lib/twilio-ruby/rest/insights/v2/inbound.rb', line 296

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Insights.V2.InboundContext #{context}>"
end