Class: Twilio::REST::Numbers::V1::PortingPortabilityInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Numbers::V1::PortingPortabilityInstance
- Defined in:
- lib/twilio-ruby/rest/numbers/v1/porting_portability.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
Account Sid that the phone number belongs to in Twilio.
-
#context ⇒ PortingPortabilityContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#country ⇒ String
Country the phone number belongs to.
-
#fetch(target_account_sid: :unset, address_sid: :unset) ⇒ PortingPortabilityInstance
Fetch the PortingPortabilityInstance.
-
#initialize(version, payload, phone_number: nil) ⇒ PortingPortabilityInstance
constructor
Initialize the PortingPortabilityInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#not_portable_reason ⇒ String
Reason why the phone number cannot be ported into Twilio,
nullotherwise. -
#not_portable_reason_code ⇒ String
The Portability Reason Code for the phone number if it cannot be ported into Twilio,
nullotherwise. - #number_type ⇒ NumberType
-
#phone_number ⇒ String
The phone number which portability is to be checked.
-
#pin_and_account_number_required ⇒ Boolean
Indicates if the port in process will require a personal identification number (PIN) and an account number for this phone number.
-
#portable ⇒ Boolean
Boolean flag indicates if the phone number can be ported into Twilio through the Porting API or not.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
This is the url of the request that you’re trying to reach out to locate the resource.
Constructor Details
#initialize(version, payload, phone_number: nil) ⇒ PortingPortabilityInstance
Initialize the PortingPortabilityInstance
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 284 def initialize(version, payload , phone_number: nil) super(version) # Marshaled Properties @properties = { 'phone_number' => payload['phone_number'], 'account_sid' => payload['account_sid'], 'portable' => payload['portable'], 'pin_and_account_number_required' => payload['pin_and_account_number_required'], 'not_portable_reason' => payload['not_portable_reason'], 'not_portable_reason_code' => payload['not_portable_reason_code'] == nil ? payload['not_portable_reason_code'] : payload['not_portable_reason_code'].to_i, 'number_type' => payload['number_type'], 'country' => payload['country'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'phone_number' => phone_number || @properties['phone_number'] , } end |
Instance Method Details
#account_sid ⇒ String
325 326 327 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 325 def account_sid @properties['account_sid'] end |
#context ⇒ PortingPortabilityContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
310 311 312 313 314 315 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 310 def context unless @instance_context @instance_context = PortingPortabilityContext.new(@version , @params['phone_number']) end @instance_context end |
#country ⇒ String
361 362 363 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 361 def country @properties['country'] end |
#fetch(target_account_sid: :unset, address_sid: :unset) ⇒ PortingPortabilityInstance
Fetch the PortingPortabilityInstance
376 377 378 379 380 381 382 383 384 385 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 376 def fetch( target_account_sid: :unset, address_sid: :unset ) context.fetch( target_account_sid: target_account_sid, address_sid: address_sid, ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
396 397 398 399 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 396 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Numbers.V1.PortingPortabilityInstance #{values}>" end |
#not_portable_reason ⇒ String
343 344 345 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 343 def not_portable_reason @properties['not_portable_reason'] end |
#not_portable_reason_code ⇒ String
349 350 351 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 349 def not_portable_reason_code @properties['not_portable_reason_code'] end |
#number_type ⇒ NumberType
355 356 357 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 355 def number_type @properties['number_type'] end |
#phone_number ⇒ String
319 320 321 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 319 def phone_number @properties['phone_number'] end |
#pin_and_account_number_required ⇒ Boolean
337 338 339 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 337 def pin_and_account_number_required @properties['pin_and_account_number_required'] end |
#portable ⇒ Boolean
331 332 333 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 331 def portable @properties['portable'] end |
#to_s ⇒ Object
Provide a user friendly representation
389 390 391 392 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 389 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Numbers.V1.PortingPortabilityInstance #{values}>" end |
#url ⇒ String
367 368 369 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 367 def url @properties['url'] end |