Class: Twilio::REST::Authy::V1::ServiceContext::EntityContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Authy::V1::ServiceContext::EntityContext
- Defined in:
- lib/twilio-ruby/rest/authy/v1/service/entity.rb,
lib/twilio-ruby/rest/authy/v1/service/entity/factor.rb,
lib/twilio-ruby/rest/authy/v1/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: FactorContext, FactorInstance, FactorList, FactorPage
Instance Method Summary collapse
-
#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 |
# File 'lib/twilio-ruby/rest/authy/v1/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 end |
Instance Method Details
#delete ⇒ Boolean
Deletes the EntityInstance
190 191 192 |
# File 'lib/twilio-ruby/rest/authy/v1/service/entity.rb', line 190 def delete @version.delete('delete', @uri) end |
#factors(sid = :unset) ⇒ FactorList, FactorContext
Access the factors
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/twilio-ruby/rest/authy/v1/service/entity.rb', line 218 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
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/twilio-ruby/rest/authy/v1/service/entity.rb', line 197 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
245 246 247 248 |
# File 'lib/twilio-ruby/rest/authy/v1/service/entity.rb', line 245 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Authy.V1.EntityContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
238 239 240 241 |
# File 'lib/twilio-ruby/rest/authy/v1/service/entity.rb', line 238 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Authy.V1.EntityContext #{context}>" end |