Class: Twilio::REST::Verify::V2::ServiceContext::EntityContext::ChallengeContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Verify::V2::ServiceContext::EntityContext::ChallengeContext
- Defined in:
- lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb,
lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb
Defined Under Namespace
Classes: NotificationInstance, NotificationList, NotificationPage
Instance Method Summary collapse
-
#fetch ⇒ ChallengeInstance
Fetch the ChallengeInstance.
-
#initialize(version, service_sid, identity, sid) ⇒ ChallengeContext
constructor
Initialize the ChallengeContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#notifications ⇒ NotificationList, NotificationContext
Access the notifications.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(auth_payload: :unset, metadata: :unset) ⇒ ChallengeInstance
Update the ChallengeInstance.
Constructor Details
#initialize(version, service_sid, identity, sid) ⇒ ChallengeContext
Initialize the ChallengeContext
201 202 203 204 205 206 207 208 209 210 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb', line 201 def initialize(version, service_sid, identity, sid) super(version) # Path Solution @solution = { service_sid: service_sid, identity: identity, sid: sid, } @uri = "/Services/#{@solution[:service_sid]}/Entities/#{@solution[:identity]}/Challenges/#{@solution[:sid]}" # Dependents @notifications = nil end |
Instance Method Details
#fetch ⇒ ChallengeInstance
Fetch the ChallengeInstance
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb', line 214 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) ChallengeInstance.new( @version, payload, service_sid: @solution[:service_sid], identity: @solution[:identity], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
284 285 286 287 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb', line 284 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.ChallengeContext #{context}>" end |
#notifications ⇒ NotificationList, NotificationContext
Access the notifications
267 268 269 270 271 272 273 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb', line 267 def notifications unless @notifications @notifications = NotificationList.new( @version, service_sid: @solution[:service_sid], identity: @solution[:identity], challenge_sid: @solution[:sid], ) end @notifications end |
#to_s ⇒ Object
Provide a user friendly representation
277 278 279 280 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb', line 277 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.ChallengeContext #{context}>" end |
#update(auth_payload: :unset, metadata: :unset) ⇒ ChallengeInstance
Update the ChallengeInstance
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb', line 237 def update( auth_payload: :unset, metadata: :unset ) data = Twilio::Values.of({ 'AuthPayload' => auth_payload, 'Metadata' => Twilio.serialize_object(), }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) ChallengeInstance.new( @version, payload, service_sid: @solution[:service_sid], identity: @solution[:identity], sid: @solution[:sid], ) end |