Class: Twilio::REST::Lookups::V2::PhoneNumberInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/lookups/v2/phone_number.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, phone_number: nil) ⇒ PhoneNumberInstance

Initialize the PhoneNumberInstance



172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 172

def initialize(version, payload , phone_number: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'calling_country_code' => payload['calling_country_code'],
        'country_code' => payload['country_code'],
        'phone_number' => payload['phone_number'],
        'national_format' => payload['national_format'],
        'valid' => payload['valid'],
        'validation_errors' => payload['validation_errors'],
        'caller_name' => payload['caller_name'],
        'sim_swap' => payload['sim_swap'],
        'call_forwarding' => payload['call_forwarding'],
        'line_status' => payload['line_status'],
        'line_type_intelligence' => payload['line_type_intelligence'],
        'identity_match' => payload['identity_match'],
        'reassigned_number' => payload['reassigned_number'],
        'sms_pumping_risk' => payload['sms_pumping_risk'],
        'phone_number_quality_score' => payload['phone_number_quality_score'],
        'pre_fill' => payload['pre_fill'],
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = { 'phone_number' => phone_number  || @properties['phone_number']  , }
end

Instance Method Details

#call_forwardingHash



262
263
264
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 262

def call_forwarding
    @properties['call_forwarding']
end

#caller_nameHash



250
251
252
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 250

def caller_name
    @properties['caller_name']
end

#calling_country_codeString



214
215
216
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 214

def calling_country_code
    @properties['calling_country_code']
end

#contextPhoneNumberContext

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



205
206
207
208
209
210
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 205

def context
    unless @instance_context
        @instance_context = PhoneNumberContext.new(@version , @params['phone_number'])
    end
    @instance_context
end

#country_codeString



220
221
222
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 220

def country_code
    @properties['country_code']
end

#fetch(fields: :unset, country_code: :unset, first_name: :unset, last_name: :unset, address_line1: :unset, address_line2: :unset, city: :unset, state: :unset, postal_code: :unset, address_country_code: :unset, national_id: :unset, date_of_birth: :unset, last_verified_date: :unset, verification_sid: :unset) ⇒ PhoneNumberInstance

Fetch the PhoneNumberInstance



331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 331

def fetch(
    fields: :unset, 
    country_code: :unset, 
    first_name: :unset, 
    last_name: :unset, 
    address_line1: :unset, 
    address_line2: :unset, 
    city: :unset, 
    state: :unset, 
    postal_code: :unset, 
    address_country_code: :unset, 
    national_id: :unset, 
    date_of_birth: :unset, 
    last_verified_date: :unset, 
    verification_sid: :unset
)

    context.fetch(
        fields: fields, 
        country_code: country_code, 
        first_name: first_name, 
        last_name: last_name, 
        address_line1: address_line1, 
        address_line2: address_line2, 
        city: city, 
        state: state, 
        postal_code: postal_code, 
        address_country_code: address_country_code, 
        national_id: national_id, 
        date_of_birth: date_of_birth, 
        last_verified_date: last_verified_date, 
        verification_sid: verification_sid, 
    )
end

#identity_matchHash



280
281
282
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 280

def identity_match
    @properties['identity_match']
end

#inspectObject

Provide a detailed, user friendly representation



375
376
377
378
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 375

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

#line_statusHash



268
269
270
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 268

def line_status
    @properties['line_status']
end

#line_type_intelligenceHash



274
275
276
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 274

def line_type_intelligence
    @properties['line_type_intelligence']
end

#national_formatString



232
233
234
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 232

def national_format
    @properties['national_format']
end

#phone_numberString



226
227
228
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 226

def phone_number
    @properties['phone_number']
end

#phone_number_quality_scoreHash



298
299
300
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 298

def phone_number_quality_score
    @properties['phone_number_quality_score']
end

#pre_fillHash



304
305
306
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 304

def pre_fill
    @properties['pre_fill']
end

#reassigned_numberHash



286
287
288
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 286

def reassigned_number
    @properties['reassigned_number']
end

#sim_swapHash



256
257
258
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 256

def sim_swap
    @properties['sim_swap']
end

#sms_pumping_riskHash



292
293
294
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 292

def sms_pumping_risk
    @properties['sms_pumping_risk']
end

#to_sObject

Provide a user friendly representation



368
369
370
371
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 368

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

#urlString



310
311
312
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 310

def url
    @properties['url']
end

#validBoolean



238
239
240
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 238

def valid
    @properties['valid']
end

#validation_errorsArray<ValidationError>



244
245
246
# File 'lib/twilio-ruby/rest/lookups/v2/phone_number.rb', line 244

def validation_errors
    @properties['validation_errors']
end