class Twilio::REST::Verify::V2::ServiceContext::EntityInstance

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Public Class Methods

new(version, payload, service_sid: nil, identity: nil) click to toggle source

Initialize the EntityInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] service_sid The unique SID identifier of the Service. @param [String] identity The unique external identifier for the Entity of the

Service. This identifier should be immutable, not PII, length between 8 and 64
characters, and generated by your external system, such as your user's UUID,
GUID, or SID. It can only contain dash (-) separated alphanumeric characters.

@return [EntityInstance] EntityInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/verify/v2/service/entity.rb
297 def initialize(version, payload, service_sid: nil, identity: nil)
298   super(version)
299 
300   # Marshaled Properties
301   @properties = {
302       'sid' => payload['sid'],
303       'identity' => payload['identity'],
304       'account_sid' => payload['account_sid'],
305       'service_sid' => payload['service_sid'],
306       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
307       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
308       'url' => payload['url'],
309       'links' => payload['links'],
310   }
311 
312   # Context
313   @instance_context = nil
314   @params = {'service_sid' => service_sid, 'identity' => identity || @properties['identity'], }
315 end

Public Instance Methods

account_sid() click to toggle source

@return [String] Account Sid.

    # File lib/twilio-ruby/rest/verify/v2/service/entity.rb
342 def account_sid
343   @properties['account_sid']
344 end
challenges() click to toggle source

Access the challenges @return [challenges] challenges

    # File lib/twilio-ruby/rest/verify/v2/service/entity.rb
407 def challenges
408   context.challenges
409 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [EntityContext] EntityContext for this EntityInstance

    # File lib/twilio-ruby/rest/verify/v2/service/entity.rb
321 def context
322   unless @instance_context
323     @instance_context = EntityContext.new(@version, @params['service_sid'], @params['identity'], )
324   end
325   @instance_context
326 end
date_created() click to toggle source

@return [Time] The date this Entity was created

    # File lib/twilio-ruby/rest/verify/v2/service/entity.rb
354 def date_created
355   @properties['date_created']
356 end
date_updated() click to toggle source

@return [Time] The date this Entity was updated

    # File lib/twilio-ruby/rest/verify/v2/service/entity.rb
360 def date_updated
361   @properties['date_updated']
362 end
delete() click to toggle source

Delete the EntityInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/verify/v2/service/entity.rb
379 def delete
380   context.delete
381 end
factors() click to toggle source

Access the factors @return [factors] factors

    # File lib/twilio-ruby/rest/verify/v2/service/entity.rb
393 def factors
394   context.factors
395 end
fetch() click to toggle source

Fetch the EntityInstance @return [EntityInstance] Fetched EntityInstance

    # File lib/twilio-ruby/rest/verify/v2/service/entity.rb
386 def fetch
387   context.fetch
388 end
identity() click to toggle source

@return [String] Unique external identifier of the Entity

    # File lib/twilio-ruby/rest/verify/v2/service/entity.rb
336 def identity
337   @properties['identity']
338 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/verify/v2/service/entity.rb
420 def inspect
421   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
422   "<Twilio.Verify.V2.EntityInstance #{values}>"
423 end
new_factors() click to toggle source

Access the new_factors @return [new_factors] new_factors

    # File lib/twilio-ruby/rest/verify/v2/service/entity.rb
400 def new_factors
401   context.new_factors
402 end
service_sid() click to toggle source

@return [String] Service Sid.

    # File lib/twilio-ruby/rest/verify/v2/service/entity.rb
348 def service_sid
349   @properties['service_sid']
350 end
sid() click to toggle source

@return [String] A string that uniquely identifies this Entity.

    # File lib/twilio-ruby/rest/verify/v2/service/entity.rb
330 def sid
331   @properties['sid']
332 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/verify/v2/service/entity.rb
413 def to_s
414   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
415   "<Twilio.Verify.V2.EntityInstance #{values}>"
416 end
url() click to toggle source

@return [String] The URL of this resource.

    # File lib/twilio-ruby/rest/verify/v2/service/entity.rb
366 def url
367   @properties['url']
368 end