Class: Twilio::REST::Numbers::V1::PortingPortInPhoneNumberInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, port_in_request_sid: nil, phone_number_sid: nil) ⇒ PortingPortInPhoneNumberInstance

Initialize the PortingPortInPhoneNumberInstance



301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 301

def initialize(version, payload , port_in_request_sid: nil, phone_number_sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'port_in_request_sid' => payload['port_in_request_sid'],
        'phone_number_sid' => payload['phone_number_sid'],
        'url' => payload['url'],
        'account_sid' => payload['account_sid'],
        'phone_number_type' => payload['phone_number_type'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'country' => payload['country'],
        'missing_required_fields' => payload['missing_required_fields'],
        'last_updated' => Twilio.deserialize_iso8601_datetime(payload['last_updated']),
        'phone_number' => payload['phone_number'],
        'portable' => payload['portable'],
        'not_portability_reason' => payload['not_portability_reason'],
        'not_portability_reason_code' => payload['not_portability_reason_code'] == nil ? payload['not_portability_reason_code'] : payload['not_portability_reason_code'].to_i,
        'port_in_phone_number_status' => payload['port_in_phone_number_status'],
        'port_out_pin' => payload['port_out_pin'] == nil ? payload['port_out_pin'] : payload['port_out_pin'].to_i,
        'rejection_reason' => payload['rejection_reason'],
        'rejection_reason_code' => payload['rejection_reason_code'] == nil ? payload['rejection_reason_code'] : payload['rejection_reason_code'].to_i,
        'port_date' => Twilio.deserialize_iso8601_datetime(payload['port_date']),
    }

    # Context
    @instance_context = nil
    @params = { 'port_in_request_sid' => port_in_request_sid  || @properties['port_in_request_sid']  ,'phone_number_sid' => phone_number_sid  || @properties['phone_number_sid']  , }
end

Instance Method Details

#account_sidString



363
364
365
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 363

def 
    @properties['account_sid']
end

#contextPortingPortInPhoneNumberContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context



336
337
338
339
340
341
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 336

def context
    unless @instance_context
        @instance_context = PortingPortInPhoneNumberContext.new(@version , @params['port_in_request_sid'], @params['phone_number_sid'])
    end
    @instance_context
end

#countryString



381
382
383
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 381

def country
    @properties['country']
end

#date_createdTime



375
376
377
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 375

def date_created
    @properties['date_created']
end

#deleteBoolean

Delete the PortingPortInPhoneNumberInstance



454
455
456
457
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 454

def delete

    context.delete
end

#fetchPortingPortInPhoneNumberInstance

Fetch the PortingPortInPhoneNumberInstance



462
463
464
465
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 462

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



476
477
478
479
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 476

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Numbers.V1.PortingPortInPhoneNumberInstance #{values}>"
end

#last_updatedTime



393
394
395
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 393

def last_updated
    @properties['last_updated']
end

#missing_required_fieldsBoolean



387
388
389
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 387

def missing_required_fields
    @properties['missing_required_fields']
end

#not_portability_reasonString



411
412
413
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 411

def not_portability_reason
    @properties['not_portability_reason']
end

#not_portability_reason_codeString



417
418
419
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 417

def not_portability_reason_code
    @properties['not_portability_reason_code']
end

#phone_numberString



399
400
401
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 399

def phone_number
    @properties['phone_number']
end

#phone_number_sidString



351
352
353
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 351

def phone_number_sid
    @properties['phone_number_sid']
end

#phone_number_typeString



369
370
371
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 369

def phone_number_type
    @properties['phone_number_type']
end

#port_dateTime



447
448
449
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 447

def port_date
    @properties['port_date']
end

#port_in_phone_number_statusString



423
424
425
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 423

def port_in_phone_number_status
    @properties['port_in_phone_number_status']
end

#port_in_request_sidString



345
346
347
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 345

def port_in_request_sid
    @properties['port_in_request_sid']
end

#port_out_pinString



429
430
431
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 429

def port_out_pin
    @properties['port_out_pin']
end

#portableBoolean



405
406
407
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 405

def portable
    @properties['portable']
end

#rejection_reasonString



435
436
437
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 435

def rejection_reason
    @properties['rejection_reason']
end

#rejection_reason_codeString



441
442
443
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 441

def rejection_reason_code
    @properties['rejection_reason_code']
end

#to_sObject

Provide a user friendly representation



469
470
471
472
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 469

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Numbers.V1.PortingPortInPhoneNumberInstance #{values}>"
end

#urlString



357
358
359
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 357

def url
    @properties['url']
end