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.



242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 242

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_sid ⇒ String

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.



304
305
306
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 304

def 
    @properties['account_sid']
end

#context ⇒ PortingPortInPhoneNumberContext

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

Returns:



277
278
279
280
281
282
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 277

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

#country ⇒ String

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.



322
323
324
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 322

def country
    @properties['country']
end

#date_created ⇒ Time

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.



316
317
318
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 316

def date_created
    @properties['date_created']
end

#delete ⇒ Boolean

Delete the PortingPortInPhoneNumberInstance

Returns:

  • (Boolean) —

    True if delete succeeds, false otherwise



395
396
397
398
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 395

def delete

    context.delete
end

#fetch ⇒ PortingPortInPhoneNumberInstance

Fetch the PortingPortInPhoneNumberInstance

Returns:



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

def fetch

    context.fetch
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



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

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

#last_updated ⇒ Time

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.



334
335
336
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 334

def last_updated
    @properties['last_updated']
end

#missing_required_fields ⇒ Boolean

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.



328
329
330
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 328

def missing_required_fields
    @properties['missing_required_fields']
end

#not_portability_reason ⇒ String

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.



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

def not_portability_reason
    @properties['not_portability_reason']
end

#not_portability_reason_code ⇒ String

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.



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

def not_portability_reason_code
    @properties['not_portability_reason_code']
end

#phone_number ⇒ String

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.



340
341
342
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 340

def phone_number
    @properties['phone_number']
end

#phone_number_sid ⇒ String

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.



292
293
294
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 292

def phone_number_sid
    @properties['phone_number_sid']
end

#phone_number_type ⇒ String

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.



310
311
312
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 310

def phone_number_type
    @properties['phone_number_type']
end

#port_date ⇒ Time

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.



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

def port_date
    @properties['port_date']
end

#port_in_phone_number_status ⇒ String

Returns The status of the port in phone number.

Returns:

  • (String) —

    The status of the port in phone number.



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

def port_in_phone_number_status
    @properties['port_in_phone_number_status']
end

#port_in_request_sid ⇒ String

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.



286
287
288
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 286

def port_in_request_sid
    @properties['port_in_request_sid']
end

#port_out_pin ⇒ String

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.



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

def port_out_pin
    @properties['port_out_pin']
end

#portable ⇒ Boolean

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



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

def portable
    @properties['portable']
end

#rejection_reason ⇒ String

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.



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

def rejection_reason
    @properties['rejection_reason']
end

#rejection_reason_code ⇒ String

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.



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

def rejection_reason_code
    @properties['rejection_reason_code']
end

#to_s ⇒ Object

Provide a user friendly representation



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

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

#url ⇒ String

Returns URL reference for this resource.

Returns:

  • (String) —

    URL reference for this resource.



298
299
300
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 298

def url
    @properties['url']
end