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
-
#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 ⇒ PortingPortabilityInstance
Fetch the PortingPortabilityInstance.
-
#initialize(version, payload, phone_number: nil) ⇒ PortingPortabilityInstance
constructor
Initialize the PortingPortabilityInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#messaging_carrier ⇒ String
Current messaging carrier of the phone number.
-
#not_portable_reason ⇒ String
Reason why the phone number cannot be ported into Twilio, ‘null` otherwise.
-
#not_portable_reason_code ⇒ String
The Portability Reason Code for the phone number if it cannot be ported into Twilio, ‘null` otherwise.
- #number_type ⇒ NumberType
-
#phone_number ⇒ String
The phone number which portability is to be checked.
-
#pin_and_account_number_required ⇒ Boolean
Boolean flag specifying if PIN and account number is required for the phone number.
-
#portable ⇒ Boolean
Boolean flag specifying if phone number is portable 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.
-
#voice_carrier ⇒ String
Current voice carrier of the phone number.
Constructor Details
#initialize(version, payload, phone_number: nil) ⇒ PortingPortabilityInstance
Initialize the PortingPortabilityInstance
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 126 def initialize(version, payload , phone_number: nil) super(version) # Marshaled Properties @properties = { 'phone_number' => payload['phone_number'], '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'], 'messaging_carrier' => payload['messaging_carrier'], 'voice_carrier' => payload['voice_carrier'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'phone_number' => phone_number || @properties['phone_number'] , } end |
Instance Method Details
#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
152 153 154 155 156 157 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 152 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.
197 198 199 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 197 def country @properties['country'] end |
#fetch ⇒ PortingPortabilityInstance
Fetch the PortingPortabilityInstance
222 223 224 225 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 222 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
236 237 238 239 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 236 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Numbers.V1.PortingPortabilityInstance #{values}>" end |
#messaging_carrier ⇒ String
Returns Current messaging carrier of the phone number.
203 204 205 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 203 def messaging_carrier @properties['messaging_carrier'] end |
#not_portable_reason ⇒ String
Returns Reason why the phone number cannot be ported into Twilio, ‘null` otherwise.
179 180 181 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 179 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. One of `22131`, `22132`, `22130`, `22133`, `22102` or `22135`.
185 186 187 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 185 def not_portable_reason_code @properties['not_portable_reason_code'] end |
#number_type ⇒ NumberType
191 192 193 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 191 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).
161 162 163 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 161 def phone_number @properties['phone_number'] end |
#pin_and_account_number_required ⇒ Boolean
Returns Boolean flag specifying if PIN and account number is required for the phone number.
173 174 175 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 173 def pin_and_account_number_required @properties['pin_and_account_number_required'] end |
#portable ⇒ Boolean
Returns Boolean flag specifying if phone number is portable or not.
167 168 169 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 167 def portable @properties['portable'] end |
#to_s ⇒ Object
Provide a user friendly representation
229 230 231 232 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 229 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.
215 216 217 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 215 def url @properties['url'] end |
#voice_carrier ⇒ String
Returns Current voice carrier of the phone number.
209 210 211 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_portability.rb', line 209 def voice_carrier @properties['voice_carrier'] end |