Class: Twilio::REST::Verify::V2::ServiceContext::EntityContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Verify::V2::ServiceContext::EntityContext
- Defined in:
- lib/twilio-ruby/rest/verify/v2/service/entity.rb,
lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb,
lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Defined Under Namespace
Classes: ChallengeContext, ChallengeInstance, ChallengeList, ChallengePage, FactorContext, FactorInstance, FactorList, FactorPage
Instance Method Summary collapse
-
#challenges(sid = :unset) ⇒ ChallengeList, ChallengeContext
Access the challenges.
-
#delete ⇒ Boolean
Delete the EntityInstance.
-
#factors(sid = :unset) ⇒ FactorList, FactorContext
Access the factors.
-
#fetch ⇒ EntityInstance
Fetch the EntityInstance.
-
#initialize(version, service_sid, identity) ⇒ EntityContext
constructor
Initialize the EntityContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, service_sid, identity) ⇒ EntityContext
Initialize the EntityContext
173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 173 def initialize(version, service_sid, identity) super(version) # Path Solution @solution = {service_sid: service_sid, identity: identity, } @uri = "/Services/#{@solution[:service_sid]}/Entities/#{@solution[:identity]}" # Dependents @factors = nil @challenges = nil end |
Instance Method Details
#challenges(sid = :unset) ⇒ ChallengeList, ChallengeContext
Access the challenges
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 232 def challenges(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return ChallengeContext.new(@version, @solution[:service_sid], @solution[:identity], sid, ) end unless @challenges @challenges = ChallengeList.new( @version, service_sid: @solution[:service_sid], identity: @solution[:identity], ) end @challenges end |
#delete ⇒ Boolean
Delete the EntityInstance
188 189 190 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 188 def delete @version.delete('DELETE', @uri) end |
#factors(sid = :unset) ⇒ FactorList, FactorContext
Access the factors
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 210 def factors(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return FactorContext.new(@version, @solution[:service_sid], @solution[:identity], sid, ) end unless @factors @factors = FactorList.new( @version, service_sid: @solution[:service_sid], identity: @solution[:identity], ) end @factors end |
#fetch ⇒ EntityInstance
Fetch the EntityInstance
195 196 197 198 199 200 201 202 203 204 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 195 def fetch payload = @version.fetch('GET', @uri) EntityInstance.new( @version, payload, service_sid: @solution[:service_sid], identity: @solution[:identity], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
259 260 261 262 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 259 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.EntityContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
252 253 254 255 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 252 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.EntityContext #{context}>" end |