Class: Twilio::REST::Numbers::V1::PortingPortInPhoneNumberInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, port_in_request_sid: nil, phone_number_sid: nil) ⇒ PortingPortInPhoneNumberInstance

Initialize the PortingPortInPhoneNumberInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this PortingPortInPhoneNumber resource.

  • sid (String)

    The SID of the Call resource to fetch.



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_sidString

Returns Account Sid or subaccount where the phone number(s) will be Ported.

Returns:

  • (String)

    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 
    @properties['account_sid']
end

#contextPortingPortInPhoneNumberContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



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

#countryString

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.

Returns:

  • (String)

    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_createdTime

Returns The timestamp for when this port in phone number was created.

Returns:

  • (Time)

    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

#deleteBoolean

Delete the PortingPortInPhoneNumberInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



297
298
299
300
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 297

def delete

    context.delete
end

#fetchPortingPortInPhoneNumberInstance

Fetch the PortingPortInPhoneNumberInstance

Returns:



305
306
307
308
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 305

def fetch

    context.fetch
end

#inspectObject

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_updatedTime

Returns Timestamp indicating when the Port In Phone Number resource was last modified.

Returns:

  • (Time)

    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_fieldsBoolean

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.

Returns:

  • (Boolean)

    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_reasonString

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.

Returns:

  • (String)

    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_codeString

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.

Returns:

  • (String)

    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_numberString

Returns Phone number to be ported. This will be in the E164 Format.

Returns:

  • (String)

    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_sidString

Returns The unique identifier for this phone number associated with this port in request.

Returns:

  • (String)

    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_typeString

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.

Returns:

  • (String)

    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_dateTime

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.

Returns:

  • (Time)

    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_statusString

Returns The status of the port in phone number.

Returns:

  • (String)

    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_sidString

Returns The unique identifier for the port in request that this phone number is associated with.

Returns:

  • (String)

    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_pinString

Returns The pin required by the losing carrier to do the port out.

Returns:

  • (String)

    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

#portableBoolean

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.

Returns:

  • (Boolean)

    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_reasonString

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.

Returns:

  • (String)

    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_codeString

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.

Returns:

  • (String)

    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_sObject

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

#urlString

Returns URL reference for this resource.

Returns:

  • (String)

    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