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

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this PortingPortInPhoneNumber resource.

  • sid (String)

    The SID of the Call resource to fetch.



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

Returns Account Sid or subaccount where the phone number(s) will be Ported.

Returns:

  • (String)

    Account Sid or subaccount where the phone number(s) will be Ported.



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

Returns:



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

Returns The ISO country code that this number is associated with. This field may be null if the number is not portable or if the portability for a number has not yet been evaluated.

Returns:

  • (String)

    The ISO country code that this number is associated with. This field may be null if the number is not portable or if the portability for a number has not yet been evaluated.



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

Returns The timestamp for when this port in phone number was created.

Returns:

  • (Time)

    The timestamp for when this port in phone number was created.



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

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



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

Returns:



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

Returns Timestamp indicating when the Port In Phone Number resource was last modified.

Returns:

  • (Time)

    Timestamp indicating when the Port In Phone Number resource was last modified.



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

Returns Indicates if the phone number is missing required fields such as a PIN or account number. This field may be null if the number is not portable or if the portability for a number has not yet been evaluated.

Returns:

  • (Boolean)

    Indicates if the phone number is missing required fields such as a PIN or account number. This field may be null if the number is not portable or if the portability for a number has not yet been evaluated.



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

Returns The not portability reason code description. This field may be null if the number is portable or if the portability for a number has not yet been evaluated.

Returns:

  • (String)

    The not portability reason code description. This field may be null if the number is portable or if the portability for a number has not yet been evaluated.



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

Returns The not portability reason code. This field may be null if the number is portable or if the portability for a number has not yet been evaluated.

Returns:

  • (String)

    The not portability reason code. This field may be null if the number is portable or if the portability for a number has not yet been evaluated.



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

Returns Phone number to be ported. This will be in the E164 Format.

Returns:

  • (String)

    Phone number to be ported. This will be in the E164 Format.



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

Returns The unique identifier for this phone number associated with this port in request.

Returns:

  • (String)

    The unique identifier for this phone number associated with this port in request.



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

Returns The number type of the phone number. This can be: toll-free, local, mobile or unknown. This field may be null if the number is not portable or if the portability for a number has not yet been evaluated.

Returns:

  • (String)

    The number type of the phone number. This can be: toll-free, local, mobile or unknown. This field may be null if the number is not portable or if the portability for a number has not yet been evaluated.



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

Returns The timestamp the phone number will be ported. This will only be set once a port date has been confirmed. Not all carriers can guarantee a specific time on the port date. Twilio will try its best to get the port completed by this time on the port date. Please subscribe to webhooks for confirmation on when a port has actually been completed.

Returns:

  • (Time)

    The timestamp the phone number will be ported. This will only be set once a port date has been confirmed. Not all carriers can guarantee a specific time on the port date. Twilio will try its best to get the port completed by this time on the port date. Please subscribe to webhooks for confirmation on when a port has actually been completed.



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

Returns The status of the port in phone number.

Returns:

  • (String)

    The status of the port in phone number.



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

Returns The unique identifier for the port in request that this phone number is associated with.

Returns:

  • (String)

    The unique identifier for the port in request that this phone number is associated with.



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

Returns The pin required by the losing carrier to do the port out.

Returns:

  • (String)

    The pin required by the losing carrier to do the port out.



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

Returns If the number is portable by Twilio or not. This field may be null if the number portability has not yet been evaluated. If a number is not portable reference the not_portability_reason_code and not_portability_reason fields for more details.

Returns:

  • (Boolean)

    If the number is portable by Twilio or not. This field may be null if the number portability has not yet been evaluated. If a number is not portable reference the not_portability_reason_code and not_portability_reason fields for more details



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

Returns The description of the rejection reason provided by the losing carrier. This field may be null if the number has not been rejected by the losing carrier.

Returns:

  • (String)

    The description of the rejection reason provided by the losing carrier. This field may be null if the number has not been rejected by the losing carrier.



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

Returns The code for the rejection reason provided by the losing carrier. This field may be null if the number has not been rejected by the losing carrier.

Returns:

  • (String)

    The code for the rejection reason provided by the losing carrier. This field may be null if the number has not been rejected by the losing carrier.



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

Returns URL reference for this resource.

Returns:

  • (String)

    URL reference for this resource.



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

def url
    @properties['url']
end