Class: Twilio::REST::Verify::V2::ServiceContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Verify::V2::ServiceContext
- Defined in:
- lib/twilio-ruby/rest/verify/v2/service.rb,
lib/twilio-ruby/rest/verify/v2/service/entity.rb,
lib/twilio-ruby/rest/verify/v2/service/webhook.rb,
lib/twilio-ruby/rest/verify/v2/service/new_factor.rb,
lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb,
lib/twilio-ruby/rest/verify/v2/service/access_token.rb,
lib/twilio-ruby/rest/verify/v2/service/verification.rb,
lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb,
lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb,
lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb,
lib/twilio-ruby/rest/verify/v2/service/rate_limit/bucket.rb,
lib/twilio-ruby/rest/verify/v2/service/verification_check.rb,
lib/twilio-ruby/rest/verify/v2/service/messaging_configuration.rb,
lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb
Defined Under Namespace
Classes: AccessTokenContext, AccessTokenInstance, AccessTokenList, AccessTokenPage, EntityContext, EntityInstance, EntityList, EntityPage, MessagingConfigurationContext, MessagingConfigurationInstance, MessagingConfigurationList, MessagingConfigurationPage, NewFactorInstance, NewFactorList, NewFactorPage, RateLimitContext, RateLimitInstance, RateLimitList, RateLimitPage, VerificationCheckInstance, VerificationCheckList, VerificationCheckPage, VerificationContext, VerificationInstance, VerificationList, VerificationPage, WebhookContext, WebhookInstance, WebhookList, WebhookPage
Instance Method Summary collapse
-
#access_tokens(sid = :unset) ⇒ AccessTokenList, AccessTokenContext
Access the access_tokens.
-
#delete ⇒ Boolean
Delete the ServiceInstance.
-
#entities(identity = :unset) ⇒ EntityList, EntityContext
Access the entities.
-
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance.
-
#initialize(version, sid) ⇒ ServiceContext
constructor
Initialize the ServiceContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#messaging_configurations(country = :unset) ⇒ MessagingConfigurationList, MessagingConfigurationContext
Access the messaging_configurations.
-
#new_factors ⇒ NewFactorList, NewFactorContext
Access the new_factors.
-
#rate_limits(sid = :unset) ⇒ RateLimitList, RateLimitContext
Access the rate_limits.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push_include_date: :unset, push_apn_credential_sid: :unset, push_fcm_credential_sid: :unset, totp_issuer: :unset, totp_time_step: :unset, totp_code_length: :unset, totp_skew: :unset, default_template_sid: :unset, whatsapp_msg_service_sid: :unset, whatsapp_from: :unset, passkeys_relying_party_id: :unset, passkeys_relying_party_name: :unset, passkeys_relying_party_origins: :unset, passkeys_authenticator_attachment: :unset, passkeys_discoverable_credentials: :unset, passkeys_user_verification: :unset, verify_event_subscription_enabled: :unset) ⇒ ServiceInstance
Update the ServiceInstance.
-
#verification_checks ⇒ VerificationCheckList, VerificationCheckContext
Access the verification_checks.
-
#verifications(sid = :unset) ⇒ VerificationList, VerificationContext
Access the verifications.
-
#verify_factor ⇒ VerifyFactorList, VerifyFactorContext
Access the verify_factor.
-
#webhooks(sid = :unset) ⇒ WebhookList, WebhookContext
Access the webhooks.
Constructor Details
#initialize(version, sid) ⇒ ServiceContext
Initialize the ServiceContext
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 236 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Services/#{@solution[:sid]}" # Dependents @verification_checks = nil @new_factors = nil @verify_factor = nil @verifications = nil @access_tokens = nil @webhooks = nil @messaging_configurations = nil @entities = nil @rate_limits = nil end |
Instance Method Details
#access_tokens(sid = :unset) ⇒ AccessTokenList, AccessTokenContext
Access the access_tokens
442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 442 def access_tokens(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return AccessTokenContext.new(@version, @solution[:sid],sid ) end unless @access_tokens @access_tokens = AccessTokenList.new( @version, service_sid: @solution[:sid], ) end @access_tokens end |
#delete ⇒ Boolean
Delete the ServiceInstance
257 258 259 260 261 262 263 264 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 257 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#entities(identity = :unset) ⇒ EntityList, EntityContext
Access the entities
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 499 def entities(identity=:unset) raise ArgumentError, 'identity cannot be nil' if identity.nil? if identity != :unset return EntityContext.new(@version, @solution[:sid],identity ) end unless @entities @entities = EntityList.new( @version, service_sid: @solution[:sid], ) end @entities end |
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 269 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) ServiceInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
543 544 545 546 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 543 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.ServiceContext #{context}>" end |
#messaging_configurations(country = :unset) ⇒ MessagingConfigurationList, MessagingConfigurationContext
Access the messaging_configurations
480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 480 def messaging_configurations(country=:unset) raise ArgumentError, 'country cannot be nil' if country.nil? if country != :unset return MessagingConfigurationContext.new(@version, @solution[:sid],country ) end unless @messaging_configurations @messaging_configurations = MessagingConfigurationList.new( @version, service_sid: @solution[:sid], ) end @messaging_configurations end |
#new_factors ⇒ NewFactorList, NewFactorContext
Access the new_factors
401 402 403 404 405 406 407 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 401 def new_factors unless @new_factors @new_factors = NewFactorList.new( @version, ) end @new_factors end |
#rate_limits(sid = :unset) ⇒ RateLimitList, RateLimitContext
Access the rate_limits
518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 518 def rate_limits(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return RateLimitContext.new(@version, @solution[:sid],sid ) end unless @rate_limits @rate_limits = RateLimitList.new( @version, service_sid: @solution[:sid], ) end @rate_limits end |
#to_s ⇒ Object
Provide a user friendly representation
536 537 538 539 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 536 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Verify.V2.ServiceContext #{context}>" end |
#update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push_include_date: :unset, push_apn_credential_sid: :unset, push_fcm_credential_sid: :unset, totp_issuer: :unset, totp_time_step: :unset, totp_code_length: :unset, totp_skew: :unset, default_template_sid: :unset, whatsapp_msg_service_sid: :unset, whatsapp_from: :unset, passkeys_relying_party_id: :unset, passkeys_relying_party_name: :unset, passkeys_relying_party_origins: :unset, passkeys_authenticator_attachment: :unset, passkeys_discoverable_credentials: :unset, passkeys_user_verification: :unset, verify_event_subscription_enabled: :unset) ⇒ ServiceInstance
Update the ServiceInstance
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 314 def update( friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push_include_date: :unset, push_apn_credential_sid: :unset, push_fcm_credential_sid: :unset, totp_issuer: :unset, totp_time_step: :unset, totp_code_length: :unset, totp_skew: :unset, default_template_sid: :unset, whatsapp_msg_service_sid: :unset, whatsapp_from: :unset, passkeys_relying_party_id: :unset, passkeys_relying_party_name: :unset, passkeys_relying_party_origins: :unset, passkeys_authenticator_attachment: :unset, passkeys_discoverable_credentials: :unset, passkeys_user_verification: :unset, verify_event_subscription_enabled: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'CodeLength' => code_length, 'LookupEnabled' => lookup_enabled, 'SkipSmsToLandlines' => skip_sms_to_landlines, 'DtmfInputRequired' => dtmf_input_required, 'TtsName' => tts_name, 'Psd2Enabled' => psd2_enabled, 'DoNotShareWarningEnabled' => do_not_share_warning_enabled, 'CustomCodeEnabled' => custom_code_enabled, 'Push.IncludeDate' => push_include_date, 'Push.ApnCredentialSid' => push_apn_credential_sid, 'Push.FcmCredentialSid' => push_fcm_credential_sid, 'Totp.Issuer' => totp_issuer, 'Totp.TimeStep' => totp_time_step, 'Totp.CodeLength' => totp_code_length, 'Totp.Skew' => totp_skew, 'DefaultTemplateSid' => default_template_sid, 'Whatsapp.MsgServiceSid' => whatsapp_msg_service_sid, 'Whatsapp.From' => whatsapp_from, 'Passkeys.RelyingParty.Id' => , 'Passkeys.RelyingParty.Name' => , 'Passkeys.RelyingParty.Origins' => , 'Passkeys.AuthenticatorAttachment' => , 'Passkeys.DiscoverableCredentials' => passkeys_discoverable_credentials, 'Passkeys.UserVerification' => passkeys_user_verification, 'VerifyEventSubscriptionEnabled' => verify_event_subscription_enabled, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) ServiceInstance.new( @version, payload, sid: @solution[:sid], ) end |
#verification_checks ⇒ VerificationCheckList, VerificationCheckContext
Access the verification_checks
390 391 392 393 394 395 396 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 390 def verification_checks unless @verification_checks @verification_checks = VerificationCheckList.new( @version, service_sid: @solution[:sid], ) end @verification_checks end |
#verifications(sid = :unset) ⇒ VerificationList, VerificationContext
Access the verifications
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 423 def verifications(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return VerificationContext.new(@version, @solution[:sid],sid ) end unless @verifications @verifications = VerificationList.new( @version, service_sid: @solution[:sid], ) end @verifications end |
#verify_factor ⇒ VerifyFactorList, VerifyFactorContext
Access the verify_factor
412 413 414 415 416 417 418 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 412 def verify_factor unless @verify_factor @verify_factor = VerifyFactorList.new( @version, ) end @verify_factor end |
#webhooks(sid = :unset) ⇒ WebhookList, WebhookContext
Access the webhooks
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 |
# File 'lib/twilio-ruby/rest/verify/v2/service.rb', line 461 def webhooks(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return WebhookContext.new(@version, @solution[:sid],sid ) end unless @webhooks @webhooks = WebhookList.new( @version, service_sid: @solution[:sid], ) end @webhooks end |