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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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

def url
    @properties['url']
end