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
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 225 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
Returns Account Sid that the phone number belongs to in Twilio. This is only returned for phone numbers that already exist in Twilio’s inventory and belong to your account or sub account.
266 267 268 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 266 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
251 252 253 254 255 256 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 251 def context unless @instance_context @instance_context = PortingPortabilityContext.new(@version , @params['phone_number']) end @instance_context end |
#country ⇒ String
Returns Country the phone number belongs to.
302 303 304 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 302 def country @properties['country'] end |
#fetch(target_account_sid: :unset, address_sid: :unset) ⇒ PortingPortabilityInstance
Fetch the PortingPortabilityInstance
317 318 319 320 321 322 323 324 325 326 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 317 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
337 338 339 340 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 337 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Numbers.V1.PortingPortabilityInstance #{values}>" end |
#not_portable_reason ⇒ String
Returns Reason why the phone number cannot be ported into Twilio, null otherwise.
284 285 286 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 284 def not_portable_reason @properties['not_portable_reason'] end |
#not_portable_reason_code ⇒ String
Returns The Portability Reason Code for the phone number if it cannot be ported into Twilio, null otherwise.
290 291 292 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 290 def not_portable_reason_code @properties['not_portable_reason_code'] end |
#number_type ⇒ NumberType
296 297 298 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 296 def number_type @properties['number_type'] end |
#phone_number ⇒ String
Returns The phone number which portability is to be checked. Phone numbers are in E.164 format (e.g. +16175551212).
260 261 262 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 260 def phone_number @properties['phone_number'] end |
#pin_and_account_number_required ⇒ Boolean
Returns Indicates if the port in process will require a personal identification number (PIN) and an account number for this phone number. If this is true you will be required to submit both a PIN and account number from the losing carrier for this number when opening a port in request. These fields will be required in order to complete the port in process to Twilio.
278 279 280 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 278 def pin_and_account_number_required @properties['pin_and_account_number_required'] end |
#portable ⇒ Boolean
Returns Boolean flag indicates if the phone number can be ported into Twilio through the Porting API or not.
272 273 274 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 272 def portable @properties['portable'] end |
#to_s ⇒ Object
Provide a user friendly representation
330 331 332 333 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 330 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Numbers.V1.PortingPortabilityInstance #{values}>" end |
#url ⇒ String
Returns This is the url of the request that you're trying to reach out to locate the resource.
308 309 310 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 308 def url @properties['url'] end |