Module: Auth0::Api::V2::Guardian
Overview
Methods to use the guardian endpoints
Instance Method Summary collapse
-
#delete_guardian_enrollment(enrollment_id) ⇒ Object
Deletes a single Guardian enrollment given its id.
-
#guardian_create_enrollment_ticket(body) ⇒ json
Creates a Guardian enrollment ticket.
-
#guardian_enrollment(enrollment_id) ⇒ json
(also: #get_guardian_enrollment)
Retrieves a single Guardian enrollment.
-
#guardian_factors ⇒ json
(also: #get_guardian_factors)
Retrieves a list of Guardian factors.
-
#guardian_sms_templates ⇒ json
(also: #get_guardian_sms_templates)
Retrieves SMS enrollment and verification templates.
-
#guardian_sns_provider_config ⇒ json
(also: #get_guardian_sns_provider_config)
Retrieves provider configuration for AWS SNS.
-
#guardian_twillo_provider_config ⇒ json
(also: #get_guardian_twillo_provider_config)
Retrieves provider configuration for Twilio.
-
#guardian_update_enrollment_verification_templates(body) ⇒ json
Updates SMS enrollment and verification SMS templates.
-
#guardian_update_factor(name, body) ⇒ json
Updates a Guardian factor.
-
#guardian_update_sns_provider_config(body) ⇒ json
Updates provider configuration for AWS SNS.
-
#guardian_update_twillo_provider_config(body) ⇒ json
Updates provider configuration for Twilio.
Methods included from Mixins::Validation
#validate_permissions_array, #validate_strings_array
Instance Method Details
#delete_guardian_enrollment(enrollment_id) ⇒ Object
Deletes a single Guardian enrollment given its id.
31 32 33 34 35 36 |
# File 'lib/auth0/api/v2/guardian.rb', line 31 def delete_guardian_enrollment(enrollment_id) raise Auth0::MissingParameter, 'Must supply a valid enrollment_id' if enrollment_id.to_s.empty? path = "#{guardian_enrollments_path}/#{enrollment_id}" delete(path) end |
#guardian_create_enrollment_ticket(body) ⇒ json
Creates a Guardian enrollment ticket.
105 106 107 108 109 110 |
# File 'lib/auth0/api/v2/guardian.rb', line 105 def guardian_create_enrollment_ticket(body) raise Auth0::InvalidParameter, 'Must supply a valid body' if body.to_s.empty? path = "#{guardian_enrollments_path}/ticket" post(path, body) end |
#guardian_enrollment(enrollment_id) ⇒ json Also known as: get_guardian_enrollment
Retrieves a single Guardian enrollment.
20 21 22 23 24 25 |
# File 'lib/auth0/api/v2/guardian.rb', line 20 def guardian_enrollment(enrollment_id) raise Auth0::MissingParameter, 'Must supply a valid enrollment_id' if enrollment_id.to_s.empty? path = "#{guardian_enrollments_path}/#{enrollment_id}" get(path) end |
#guardian_factors ⇒ json Also known as: get_guardian_factors
Retrieves a list of Guardian factors.
11 12 13 |
# File 'lib/auth0/api/v2/guardian.rb', line 11 def guardian_factors get(guardian_factors_path) end |
#guardian_sms_templates ⇒ json Also known as: get_guardian_sms_templates
Retrieves SMS enrollment and verification templates.
41 42 43 44 |
# File 'lib/auth0/api/v2/guardian.rb', line 41 def guardian_sms_templates path = "#{guardian_factors_path}/sms/templates" get(path) end |
#guardian_sns_provider_config ⇒ json Also known as: get_guardian_sns_provider_config
Retrieves provider configuration for AWS SNS.
62 63 64 65 |
# File 'lib/auth0/api/v2/guardian.rb', line 62 def guardian_sns_provider_config path = "#{guardian_factors_path}/push-notification/providers/sns" get(path) end |
#guardian_twillo_provider_config ⇒ json Also known as: get_guardian_twillo_provider_config
Retrieves provider configuration for Twilio.
83 84 85 86 |
# File 'lib/auth0/api/v2/guardian.rb', line 83 def guardian_twillo_provider_config path = "#{guardian_factors_path}/sms/providers/twilio" get(path) end |
#guardian_update_enrollment_verification_templates(body) ⇒ json
Updates SMS enrollment and verification SMS templates.
52 53 54 55 56 57 |
# File 'lib/auth0/api/v2/guardian.rb', line 52 def guardian_update_enrollment_verification_templates(body) raise Auth0::InvalidParameter, 'Must supply a valid body' if body.to_s.empty? path = "#{guardian_factors_path}/sms/templates" put(path, body) end |
#guardian_update_factor(name, body) ⇒ json
Updates a Guardian factor.
117 118 119 120 121 122 123 |
# File 'lib/auth0/api/v2/guardian.rb', line 117 def guardian_update_factor(name, body) raise Auth0::MissingParameter, 'Must supply a valid name' if name.to_s.empty? raise Auth0::InvalidParameter, 'Must supply a valid body' if body.to_s.empty? path = "#{guardian_factors_path}/#{name}" put(path, body) end |
#guardian_update_sns_provider_config(body) ⇒ json
Updates provider configuration for AWS SNS.
73 74 75 76 77 78 |
# File 'lib/auth0/api/v2/guardian.rb', line 73 def guardian_update_sns_provider_config(body) raise Auth0::InvalidParameter, 'Must supply a valid body' if body.to_s.empty? path = "#{guardian_factors_path}/push-notification/providers/sns" put(path, body) end |
#guardian_update_twillo_provider_config(body) ⇒ json
Updates provider configuration for Twilio.
94 95 96 97 98 99 |
# File 'lib/auth0/api/v2/guardian.rb', line 94 def guardian_update_twillo_provider_config(body) raise Auth0::InvalidParameter, 'Must supply a valid body' if body.to_s.empty? path = "#{guardian_factors_path}/sms/providers/twilio" put(path, body) end |