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
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
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
@return [String] Account Sid.
# File lib/twilio-ruby/rest/verify/v2/service/entity.rb 342 def account_sid 343 @properties['account_sid'] 344 end
Access the challenges @return [challenges] challenges
# File lib/twilio-ruby/rest/verify/v2/service/entity.rb 407 def challenges 408 context.challenges 409 end
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
@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
@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 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
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 the EntityInstance
@return [EntityInstance] Fetched EntityInstance
# File lib/twilio-ruby/rest/verify/v2/service/entity.rb 386 def fetch 387 context.fetch 388 end
@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
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
@return [String] Nested resource URLs.
# File lib/twilio-ruby/rest/verify/v2/service/entity.rb 372 def links 373 @properties['links'] 374 end
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
@return [String] Service Sid.
# File lib/twilio-ruby/rest/verify/v2/service/entity.rb 348 def service_sid 349 @properties['service_sid'] 350 end
@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
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
@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