Class: Twilio::REST::Authy::V1::ServiceContext::EntityContext::FactorContext::ChallengeContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Authy::V1::ServiceContext::EntityContext::FactorContext::ChallengeContext
- Defined in:
- 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].
Instance Method Summary collapse
-
#delete ⇒ Boolean
Deletes the ChallengeInstance.
-
#fetch ⇒ ChallengeInstance
Fetch a ChallengeInstance.
-
#initialize(version, service_sid, identity, factor_sid, sid) ⇒ ChallengeContext
constructor
Initialize the ChallengeContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(auth_payload: :unset) ⇒ ChallengeInstance
Update the ChallengeInstance.
Constructor Details
#initialize(version, service_sid, identity, factor_sid, sid) ⇒ ChallengeContext
Initialize the ChallengeContext
125 126 127 128 129 130 131 |
# File 'lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb', line 125 def initialize(version, service_sid, identity, factor_sid, sid) super(version) # Path Solution @solution = {service_sid: service_sid, identity: identity, factor_sid: factor_sid, sid: sid, } @uri = "/Services/#{@solution[:service_sid]}/Entities/#{@solution[:identity]}/Factors/#{@solution[:factor_sid]}/Challenges/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Deletes the ChallengeInstance
136 137 138 |
# File 'lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb', line 136 def delete @version.delete('delete', @uri) end |
#fetch ⇒ ChallengeInstance
Fetch a ChallengeInstance
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb', line 143 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) ChallengeInstance.new( @version, payload, service_sid: @solution[:service_sid], identity: @solution[:identity], factor_sid: @solution[:factor_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
195 196 197 198 |
# File 'lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb', line 195 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Authy.V1.ChallengeContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
188 189 190 191 |
# File 'lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb', line 188 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Authy.V1.ChallengeContext #{context}>" end |
#update(auth_payload: :unset) ⇒ ChallengeInstance
Update the ChallengeInstance
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb', line 167 def update(auth_payload: :unset) data = Twilio::Values.of({'AuthPayload' => auth_payload, }) payload = @version.update( 'POST', @uri, data: data, ) ChallengeInstance.new( @version, payload, service_sid: @solution[:service_sid], identity: @solution[:identity], factor_sid: @solution[:factor_sid], sid: @solution[:sid], ) end |