Class: Twilio::REST::Numbers::V1::PortingPortInInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, port_in_request_sid: nil) ⇒ PortingPortInInstance

Initialize the PortingPortInInstance

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 PortingPortIn resource.

  • sid (String) —

    The SID of the Call resource to fetch.



373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 373

def initialize(version, payload , port_in_request_sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'port_in_request_sid' => payload['port_in_request_sid'],
        'url' => payload['url'],
        'account_sid' => payload['account_sid'],
        'notification_emails' => payload['notification_emails'],
        'target_port_in_date' => Twilio.deserialize_iso8601_date(payload['target_port_in_date']),
        'target_port_in_time_range_start' => payload['target_port_in_time_range_start'],
        'target_port_in_time_range_end' => payload['target_port_in_time_range_end'],
        'port_in_request_status' => payload['port_in_request_status'],
        'order_cancellation_reason' => payload['order_cancellation_reason'],
        'losing_carrier_information' => payload['losing_carrier_information'],
        'phone_numbers' => payload['phone_numbers'],
        'bundle_sid' => payload['bundle_sid'],
        'portability_advance_carrier' => payload['portability_advance_carrier'],
        'auto_cancel_approval_numbers' => payload['auto_cancel_approval_numbers'],
        'documents' => payload['documents'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'support_ticket_id' => payload['support_ticket_id'] == nil ? payload['support_ticket_id'] : payload['support_ticket_id'].to_i,
        'signature_request_url' => payload['signature_request_url'],
    }

    # Context
    @instance_context = nil
    @params = { 'port_in_request_sid' => port_in_request_sid  || @properties['port_in_request_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



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

def 
    @properties['account_sid']
end

#auto_cancel_approval_numbers ⇒ String

Returns Japan specific field, indicates the number of phone numbers to automatically approve for cancellation.

Returns:

  • (String) —

    Japan specific field, indicates the number of phone numbers to automatically approve for cancellation.



495
496
497
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 495

def auto_cancel_approval_numbers
    @properties['auto_cancel_approval_numbers']
end

#bundle_sid ⇒ String

Returns The bundle sid is an optional identifier to reference a group of regulatory documents for a port request.

Returns:

  • (String) —

    The bundle sid is an optional identifier to reference a group of regulatory documents for a port request.



483
484
485
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 483

def bundle_sid
    @properties['bundle_sid']
end

#context ⇒ PortingPortInContext

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

Returns:



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

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

#date_created ⇒ Time

Returns:

  • (Time)


507
508
509
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 507

def date_created
    @properties['date_created']
end

#delete ⇒ Boolean

Delete the PortingPortInInstance

Returns:

  • (Boolean) —

    True if delete succeeds, false otherwise



526
527
528
529
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 526

def delete

    context.delete
end

#documents ⇒ Array<String>

Returns List of document SIDs for all phone numbers included in the port in request. At least one document SID referring to a document of the type Utility Bill is required.

Returns:

  • (Array<String>) —

    List of document SIDs for all phone numbers included in the port in request. At least one document SID referring to a document of the type Utility Bill is required.



501
502
503
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 501

def documents
    @properties['documents']
end

#fetch ⇒ PortingPortInInstance

Fetch the PortingPortInInstance

Returns:



534
535
536
537
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 534

def fetch

    context.fetch
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



548
549
550
551
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 548

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

#losing_carrier_information ⇒ NumbersV1PortingLosingCarrierInformation

Returns:

  • (NumbersV1PortingLosingCarrierInformation)


471
472
473
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 471

def losing_carrier_information
    @properties['losing_carrier_information']
end

#notification_emails ⇒ Array<String>

Returns Additional emails to send a copy of the signed LOA to.

Returns:

  • (Array<String>) —

    Additional emails to send a copy of the signed LOA to.



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

def notification_emails
    @properties['notification_emails']
end

#order_cancellation_reason ⇒ String

Returns If the order is cancelled this field will provide further context on the cause of the cancellation.

Returns:

  • (String) —

    If the order is cancelled this field will provide further context on the cause of the cancellation.



465
466
467
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 465

def order_cancellation_reason
    @properties['order_cancellation_reason']
end

#phone_numbers ⇒ Array<NumbersV1PortingPortInPhoneNumberResult>

Returns:

  • (Array<NumbersV1PortingPortInPhoneNumberResult>)


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

def phone_numbers
    @properties['phone_numbers']
end

#port_in_request_sid ⇒ String

Returns The SID of the Port In request. This is a unique identifier of the port in request.

Returns:

  • (String) —

    The SID of the Port In request. This is a unique identifier of the port in request.



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

def port_in_request_sid
    @properties['port_in_request_sid']
end

#port_in_request_status ⇒ String

Returns The status of the port in request. The possible values are: In progress, Completed, Expired, In review, Waiting for Signature, Action Required, and Canceled.

Returns:

  • (String) —

    The status of the port in request. The possible values are: In progress, Completed, Expired, In review, Waiting for Signature, Action Required, and Canceled.



459
460
461
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 459

def port_in_request_status
    @properties['port_in_request_status']
end

#portability_advance_carrier ⇒ String

Returns A field only required for Japan port in requests. It is a unique identifier for the donor carrier service the line is being ported from.

Returns:

  • (String) —

    A field only required for Japan port in requests. It is a unique identifier for the donor carrier service the line is being ported from.



489
490
491
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 489

def portability_advance_carrier
    @properties['portability_advance_carrier']
end

#signature_request_url ⇒ String

Returns:

  • (String)


519
520
521
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 519

def signature_request_url
    @properties['signature_request_url']
end

#support_ticket_id ⇒ String

Returns Unique ID of the request's support ticket.

Returns:

  • (String) —

    Unique ID of the request's support ticket



513
514
515
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 513

def support_ticket_id
    @properties['support_ticket_id']
end

#target_port_in_date ⇒ Date

Returns Target date to port the number. We cannot guarantee that this date will be honored by the other carriers, please work with Ops to get a confirmation of the firm order commitment (FOC) date. Expected format is ISO Local Date, example: ‘2011-12-03`. This date must be at least 7 days in the future for US ports and 10 days in the future for Japanese ports. If a start and end range is provided, the date will be converted to its UTC equivalent with the ranges as reference and stored in UTC. We can't guarantee the exact date and time, as this depends on the losing carrier.

Returns:

  • (Date) —

    Target date to port the number. We cannot guarantee that this date will be honored by the other carriers, please work with Ops to get a confirmation of the firm order commitment (FOC) date. Expected format is ISO Local Date, example: ‘2011-12-03`. This date must be at least 7 days in the future for US ports and 10 days in the future for Japanese ports. If a start and end range is provided, the date will be converted to its UTC equivalent with the ranges as reference and stored in UTC. We can't guarantee the exact date and time, as this depends on the losing carrier.



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

def target_port_in_date
    @properties['target_port_in_date']
end

#target_port_in_time_range_end ⇒ String

Returns The latest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. We can't guarantee the exact date and time, as this depends on the losing carrier. The time will be stored and returned as UTC standard timezone.

Returns:

  • (String) —

    The latest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. We can't guarantee the exact date and time, as this depends on the losing carrier. The time will be stored and returned as UTC standard timezone.



453
454
455
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 453

def target_port_in_time_range_end
    @properties['target_port_in_time_range_end']
end

#target_port_in_time_range_start ⇒ String

Returns The earliest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. We can't guarantee the exact date and time, as this depends on the losing carrier. The time will be stored and returned as UTC standard timezone.

Returns:

  • (String) —

    The earliest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. We can't guarantee the exact date and time, as this depends on the losing carrier. The time will be stored and returned as UTC standard timezone.



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

def target_port_in_time_range_start
    @properties['target_port_in_time_range_start']
end

#to_s ⇒ Object

Provide a user friendly representation



541
542
543
544
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb', line 541

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

#url ⇒ String

Returns The URL of this Port In request.

Returns:

  • (String) —

    The URL of this Port In request



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

def url
    @properties['url']
end