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/access_token.rb,
lib/twilio-ruby/rest/verify/v2/service/entity/factor/challenge.rb
Overview
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].
Defined Under Namespace
Classes: AccessTokenInstance, AccessTokenList, AccessTokenPage, FactorContext, FactorInstance, FactorList, FactorPage
Instance Method Summary collapse
-
#access_tokens ⇒ AccessTokenList, AccessTokenContext
Access the access_tokens.
-
#delete ⇒ Boolean
Deletes the EntityInstance.
-
#factors(sid = :unset) ⇒ FactorList, FactorContext
Access the factors.
-
#fetch ⇒ EntityInstance
Fetch a 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
176 177 178 179 180 181 182 183 184 185 186 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 176 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 @access_tokens = nil end |
Instance Method Details
#access_tokens ⇒ AccessTokenList, AccessTokenContext
Access the access_tokens
241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 241 def access_tokens unless @access_tokens @access_tokens = AccessTokenList.new( @version, service_sid: @solution[:service_sid], identity: @solution[:identity], ) end @access_tokens end |
#delete ⇒ Boolean
Deletes the EntityInstance
191 192 193 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 191 def delete @version.delete('delete', @uri) end |
#factors(sid = :unset) ⇒ FactorList, FactorContext
Access the factors
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 219 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 a EntityInstance
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 198 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) EntityInstance.new( @version, payload, service_sid: @solution[:service_sid], identity: @solution[:identity], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
262 263 264 265 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 262 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.EntityContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
255 256 257 258 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity.rb', line 255 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.EntityContext #{context}>" end |