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.



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 139

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,
    }

    # 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 The SID of the account that the phone number belongs to.

Returns:

  • (String)

    The SID of the account that the phone number belongs to.



199
200
201
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 199

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:



172
173
174
175
176
177
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 172

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 country of the phone number.

Returns:

  • (String)

    The country of the phone number.



217
218
219
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 217

def country
    @properties['country']
end

#date_createdTime

Returns The date when the phone number was created.

Returns:

  • (Time)

    The date when the phone number was created.



211
212
213
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 211

def date_created
    @properties['date_created']
end

#deleteBoolean

Delete the PortingPortInPhoneNumberInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



284
285
286
287
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 284

def delete

    context.delete
end

#fetchPortingPortInPhoneNumberInstance

Fetch the PortingPortInPhoneNumberInstance

Returns:



292
293
294
295
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 292

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



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

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Numbers.V1.PortingPortInPhoneNumberInstance #{values}>"
end

#last_updatedTime

Returns The timestamp when the status was last updated.

Returns:

  • (Time)

    The timestamp when the status was last updated.



229
230
231
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 229

def last_updated
    @properties['last_updated']
end

#missing_required_fieldsBoolean

Returns The phone number is missing required fields.

Returns:

  • (Boolean)

    The phone number is missing required fields.



223
224
225
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 223

def missing_required_fields
    @properties['missing_required_fields']
end

#not_portability_reasonString

Returns The reason why the phone number is not portable.

Returns:

  • (String)

    The reason why the phone number is not portable.



247
248
249
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 247

def not_portability_reason
    @properties['not_portability_reason']
end

#not_portability_reason_codeString

Returns The code of the reason why the phone number is not portable.

Returns:

  • (String)

    The code of the reason why the phone number is not portable.



253
254
255
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 253

def not_portability_reason_code
    @properties['not_portability_reason_code']
end

#phone_numberString

Returns The phone number.

Returns:

  • (String)

    The phone number.



235
236
237
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 235

def phone_number
    @properties['phone_number']
end

#phone_number_sidString

Returns The SID of the Port In request phone number. This is a unique identifier of the phone number.

Returns:

  • (String)

    The SID of the Port In request phone number. This is a unique identifier of the phone number.



187
188
189
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 187

def phone_number_sid
    @properties['phone_number_sid']
end

#phone_number_typeString

Returns The type of the phone number.

Returns:

  • (String)

    The type of the phone number.



205
206
207
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 205

def phone_number_type
    @properties['phone_number_type']
end

#port_in_phone_number_statusString

Returns The status of the phone number in the port in request.

Returns:

  • (String)

    The status of the phone number in the port in request.



259
260
261
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 259

def port_in_phone_number_status
    @properties['port_in_phone_number_status']
end

#port_in_request_sidString

Returns The SID of the Port In request. This is a unique identifier of the port in request.

Returns:

  • (String)

    The SID of the Port In request. This is a unique identifier of the port in request.



181
182
183
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 181

def port_in_request_sid
    @properties['port_in_request_sid']
end

#port_out_pinString

Returns The pin required for the losing carrier to port out the phone number.

Returns:

  • (String)

    The pin required for the losing carrier to port out the phone number.



265
266
267
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 265

def port_out_pin
    @properties['port_out_pin']
end

#portableBoolean

Returns The phone number is portable.

Returns:

  • (Boolean)

    The phone number is portable.



241
242
243
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 241

def portable
    @properties['portable']
end

#rejection_reasonString

Returns The rejection reason returned by the vendor.

Returns:

  • (String)

    The rejection reason returned by the vendor.



271
272
273
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 271

def rejection_reason
    @properties['rejection_reason']
end

#rejection_reason_codeString

Returns The rejection reason code returned by the vendor.

Returns:

  • (String)

    The rejection reason code returned by the vendor.



277
278
279
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 277

def rejection_reason_code
    @properties['rejection_reason_code']
end

#to_sObject

Provide a user friendly representation



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

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Numbers.V1.PortingPortInPhoneNumberInstance #{values}>"
end

#urlString

Returns:

  • (String)


193
194
195
# File 'lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb', line 193

def url
    @properties['url']
end