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
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 145 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.
206 207 208 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 206 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
179 180 181 182 183 184 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 179 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.
224 225 226 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 224 def country @properties['country'] end |
#date_created ⇒ Time
Returns The timestamp for when this port in phone number was created.
218 219 220 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 218 def date_created @properties['date_created'] end |
#delete ⇒ Boolean
Delete the PortingPortInPhoneNumberInstance
297 298 299 300 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 297 def delete context.delete end |
#fetch ⇒ PortingPortInPhoneNumberInstance
Fetch the PortingPortInPhoneNumberInstance
305 306 307 308 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 305 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
319 320 321 322 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 319 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.
236 237 238 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 236 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.
230 231 232 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 230 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.
254 255 256 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 254 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.
260 261 262 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 260 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.
242 243 244 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 242 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.
194 195 196 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 194 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.
212 213 214 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 212 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.
290 291 292 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 290 def port_date @properties['port_date'] end |
#port_in_phone_number_status ⇒ String
Returns The status of the port in phone number.
266 267 268 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 266 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.
188 189 190 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 188 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.
272 273 274 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 272 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.
248 249 250 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 248 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.
278 279 280 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 278 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.
284 285 286 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 284 def rejection_reason_code @properties['rejection_reason_code'] end |
#to_s ⇒ Object
Provide a user friendly representation
312 313 314 315 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 312 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.
200 201 202 |
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 200 def url @properties['url'] end |