Class: Twilio::REST::Numbers::V1::PortingPortInPhoneNumberInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Numbers::V1::PortingPortInPhoneNumberInstance
- Defined in:
- lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
Account Sid or subaccount where the phone number(s) will be Ported.
-
#context ⇒ PortingPortInPhoneNumberContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#country ⇒ String
The ISO country code that this number is associated with.
-
#date_created ⇒ Time
The timestamp for when this port in phone number was created.
-
#delete ⇒ Boolean
Delete the PortingPortInPhoneNumberInstance.
-
#fetch ⇒ PortingPortInPhoneNumberInstance
Fetch the PortingPortInPhoneNumberInstance.
-
#initialize(version, payload, port_in_request_sid: nil, phone_number_sid: nil) ⇒ PortingPortInPhoneNumberInstance
constructor
Initialize the PortingPortInPhoneNumberInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#last_updated ⇒ Time
Timestamp indicating when the Port In Phone Number resource was last modified.
-
#missing_required_fields ⇒ Boolean
Indicates if the phone number is missing required fields such as a PIN or account number.
-
#not_portability_reason ⇒ String
The not portability reason code description.
-
#not_portability_reason_code ⇒ String
The not portability reason code.
-
#phone_number ⇒ String
Phone number to be ported.
-
#phone_number_sid ⇒ String
The unique identifier for this phone number associated with this port in request.
-
#phone_number_type ⇒ String
The number type of the phone number.
-
#port_date ⇒ Time
The timestamp the phone number will be ported.
-
#port_in_phone_number_status ⇒ String
The status of the port in phone number.
-
#port_in_request_sid ⇒ String
The unique identifier for the port in request that this phone number is associated with.
-
#port_out_pin ⇒ String
The pin required by the losing carrier to do the port out.
-
#portable ⇒ Boolean
If the number is portable by Twilio or not.
-
#rejection_reason ⇒ String
The description of the rejection reason provided by the losing carrier.
-
#rejection_reason_code ⇒ String
The code for the rejection reason provided by the losing carrier.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
URL reference for this resource.
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_sid ⇒ String
Returns 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 account_sid @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
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 |
#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.
381 382 383 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 381 def country @properties['country'] end |
#date_created ⇒ Time
Returns 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 |
#delete ⇒ Boolean
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 |
#fetch ⇒ PortingPortInPhoneNumberInstance
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 |
#inspect ⇒ Object
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_updated ⇒ Time
Returns 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_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.
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_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.
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_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.
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_number ⇒ String
Returns 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_sid ⇒ String
Returns 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_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.
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_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.
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_status ⇒ String
Returns 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_sid ⇒ String
Returns 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_pin ⇒ String
Returns 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 |
#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.
405 406 407 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 405 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.
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_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.
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_s ⇒ Object
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 |
#url ⇒ String
Returns 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 |