class Twilio::REST::Verify::V2::ServiceContext::EntityContext
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Public Class Methods
Initialize the EntityContext
@param [Version] version Version
that contains the resource @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 [EntityContext] EntityContext
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/verify/v2/service/entity.rb 175 def initialize(version, service_sid, identity) 176 super(version) 177 178 # Path Solution 179 @solution = {service_sid: service_sid, identity: identity, } 180 @uri = "/Services/#{@solution[:service_sid]}/Entities/#{@solution[:identity]}" 181 182 # Dependents 183 @factors = nil 184 @new_factors = nil 185 @challenges = nil 186 end
Public Instance Methods
Access the challenges @return [ChallengeList] @return [ChallengeContext] if sid was passed.
# File lib/twilio-ruby/rest/verify/v2/service/entity.rb 251 def challenges(sid=:unset) 252 raise ArgumentError, 'sid cannot be nil' if sid.nil? 253 254 if sid != :unset 255 return ChallengeContext.new(@version, @solution[:service_sid], @solution[:identity], sid, ) 256 end 257 258 unless @challenges 259 @challenges = ChallengeList.new( 260 @version, 261 service_sid: @solution[:service_sid], 262 identity: @solution[:identity], 263 ) 264 end 265 266 @challenges 267 end
Delete the EntityInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/verify/v2/service/entity.rb 191 def delete 192 @version.delete('DELETE', @uri) 193 end
Access the factors @return [FactorList] @return [FactorContext] if sid was passed.
# File lib/twilio-ruby/rest/verify/v2/service/entity.rb 213 def factors(sid=:unset) 214 raise ArgumentError, 'sid cannot be nil' if sid.nil? 215 216 if sid != :unset 217 return FactorContext.new(@version, @solution[:service_sid], @solution[:identity], sid, ) 218 end 219 220 unless @factors 221 @factors = FactorList.new( 222 @version, 223 service_sid: @solution[:service_sid], 224 identity: @solution[:identity], 225 ) 226 end 227 228 @factors 229 end
Fetch the EntityInstance
@return [EntityInstance] Fetched EntityInstance
# File lib/twilio-ruby/rest/verify/v2/service/entity.rb 198 def fetch 199 payload = @version.fetch('GET', @uri) 200 201 EntityInstance.new( 202 @version, 203 payload, 204 service_sid: @solution[:service_sid], 205 identity: @solution[:identity], 206 ) 207 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/verify/v2/service/entity.rb 278 def inspect 279 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 280 "#<Twilio.Verify.V2.EntityContext #{context}>" 281 end
Access the new_factors
@return [NewFactorList] @return [NewFactorContext]
# File lib/twilio-ruby/rest/verify/v2/service/entity.rb 235 def new_factors 236 unless @new_factors 237 @new_factors = NewFactorList.new( 238 @version, 239 service_sid: @solution[:service_sid], 240 identity: @solution[:identity], 241 ) 242 end 243 244 @new_factors 245 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/verify/v2/service/entity.rb 271 def to_s 272 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 273 "#<Twilio.Verify.V2.EntityContext #{context}>" 274 end