auth0 6.2.0 → 6.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.fern/metadata.json +3 -3
- data/.fern/replay.lock +7 -1
- data/.version +1 -1
- data/CHANGELOG.md +7 -0
- data/EXAMPLES.md +44 -0
- data/examples/ruby-api/Gemfile.lock +1 -1
- data/lib/auth0/actions/client.rb +47 -6
- data/lib/auth0/actions/executions/client.rb +4 -1
- data/lib/auth0/actions/modules/client.rb +40 -6
- data/lib/auth0/actions/modules/versions/client.rb +19 -3
- data/lib/auth0/actions/triggers/bindings/client.rb +12 -2
- data/lib/auth0/actions/triggers/client.rb +4 -1
- data/lib/auth0/actions/versions/client.rb +27 -4
- data/lib/auth0/agents/client.rb +22 -4
- data/lib/auth0/anomaly/blocks/client.rb +6 -0
- data/lib/auth0/api/authentication_endpoints.rb +40 -0
- data/lib/auth0/attack_protection/bot_detection/client.rb +8 -2
- data/lib/auth0/attack_protection/breached_password_detection/client.rb +8 -2
- data/lib/auth0/attack_protection/brute_force_protection/client.rb +8 -2
- data/lib/auth0/attack_protection/captcha/client.rb +8 -2
- data/lib/auth0/attack_protection/phone_provider_protection/client.rb +8 -2
- data/lib/auth0/attack_protection/suspicious_ip_throttling/client.rb +8 -2
- data/lib/auth0/branding/client.rb +8 -2
- data/lib/auth0/branding/phone/providers/client.rb +31 -5
- data/lib/auth0/branding/phone/templates/client.rb +39 -7
- data/lib/auth0/branding/templates/client.rb +10 -1
- data/lib/auth0/branding/themes/client.rb +162 -4
- data/lib/auth0/client.rb +8 -8
- data/lib/auth0/client_grants/client.rb +28 -4
- data/lib/auth0/client_grants/organizations/client.rb +9 -1
- data/lib/auth0/clients/client.rb +46 -7
- data/lib/auth0/clients/connections/client.rb +11 -1
- data/lib/auth0/clients/credentials/client.rb +36 -7
- data/lib/auth0/clients/types/create_client_request_content.rb +2 -0
- data/lib/auth0/clients/types/update_client_request_content.rb +2 -0
- data/lib/auth0/connection_profiles/client.rb +30 -6
- data/lib/auth0/connections/client.rb +37 -4
- data/lib/auth0/connections/clients/client.rb +21 -2
- data/lib/auth0/connections/directory_provisioning/client.rb +73 -8
- data/lib/auth0/connections/directory_provisioning/synchronizations/client.rb +4 -1
- data/lib/auth0/connections/keys/client.rb +31 -8
- data/lib/auth0/connections/scim_configuration/client.rb +37 -6
- data/lib/auth0/connections/scim_configuration/tokens/client.rb +14 -2
- data/lib/auth0/connections/users/client.rb +6 -0
- data/lib/auth0/custom_domains/client.rb +43 -8
- data/lib/auth0/device_credentials/client.rb +25 -2
- data/lib/auth0/email_templates/client.rb +19 -4
- data/lib/auth0/emails/provider/client.rb +23 -3
- data/lib/auth0/event_streams/client.rb +38 -5
- data/lib/auth0/event_streams/deliveries/client.rb +19 -2
- data/lib/auth0/event_streams/redeliveries/client.rb +10 -1
- data/lib/auth0/events/client.rb +7 -0
- data/lib/auth0/experimentation/client.rb +19 -0
- data/lib/auth0/experimentation/experiments/client.rb +63 -0
- data/lib/auth0/experimentation/experiments/types/advance_ramp_request_content.rb +15 -0
- data/lib/auth0/flows/client.rb +28 -4
- data/lib/auth0/flows/executions/client.rb +23 -2
- data/lib/auth0/flows/vault/connections/client.rb +31 -4
- data/lib/auth0/forms/client.rb +27 -4
- data/lib/auth0/groups/client.rb +21 -2
- data/lib/auth0/groups/members/client.rb +10 -1
- data/lib/auth0/groups/roles/client.rb +20 -1
- data/lib/auth0/guardian/client.rb +77 -0
- data/lib/auth0/guardian/enrollments/client.rb +11 -2
- data/lib/auth0/guardian/factors/client.rb +21 -5
- data/lib/auth0/guardian/factors/duo/settings/client.rb +12 -3
- data/lib/auth0/guardian/factors/email/client.rb +93 -0
- data/lib/auth0/guardian/factors/email/types/set_email_factor_settings_request_content.rb +17 -0
- data/lib/auth0/guardian/factors/phone/client.rb +110 -8
- data/lib/auth0/guardian/factors/phone/types/set_phone_factor_settings_request_content.rb +17 -0
- data/lib/auth0/guardian/factors/push_notification/client.rb +48 -12
- data/lib/auth0/guardian/factors/sms/client.rb +32 -9
- data/lib/auth0/guardian/policies/client.rb +8 -2
- data/lib/auth0/guardian/types/set_guardian_settings_request_content.rb +17 -0
- data/lib/auth0/hooks/client.rb +33 -4
- data/lib/auth0/hooks/secrets/client.rb +38 -4
- data/lib/auth0/jobs/client.rb +4 -1
- data/lib/auth0/jobs/errors/client.rb +9 -4
- data/lib/auth0/jobs/users_exports/client.rb +4 -1
- data/lib/auth0/jobs/users_imports/client.rb +14 -6
- data/lib/auth0/jobs/verification_email/client.rb +4 -1
- data/lib/auth0/keys/custom_signing/client.rb +13 -2
- data/lib/auth0/keys/encryption/client.rb +33 -5
- data/lib/auth0/keys/network_acls/client.rb +19 -3
- data/lib/auth0/keys/signing/client.rb +21 -7
- data/lib/auth0/log_streams/client.rb +29 -7
- data/lib/auth0/logs/client.rb +16 -2
- data/lib/auth0/network_acls/client.rb +41 -4
- data/lib/auth0/organizations/client.rb +109 -5
- data/lib/auth0/organizations/client_grants/client.rb +25 -2
- data/lib/auth0/organizations/clients/client.rb +38 -4
- data/lib/auth0/organizations/connections/client.rb +37 -4
- data/lib/auth0/organizations/connections/types/create_organization_all_connection_request_parameters.rb +2 -0
- data/lib/auth0/organizations/connections/types/update_organization_connection_request_parameters.rb +2 -0
- data/lib/auth0/organizations/discovery_domains/client.rb +42 -5
- data/lib/auth0/organizations/enabled_connections/client.rb +36 -4
- data/lib/auth0/organizations/groups/client.rb +8 -1
- data/lib/auth0/organizations/groups/roles/client.rb +23 -1
- data/lib/auth0/organizations/invitations/client.rb +40 -3
- data/lib/auth0/organizations/members/client.rb +23 -1
- data/lib/auth0/organizations/members/effective_roles/client.rb +9 -1
- data/lib/auth0/organizations/members/effective_roles/sources/groups/client.rb +10 -1
- data/lib/auth0/organizations/members/roles/client.rb +24 -1
- data/lib/auth0/organizations/organization_template/client.rb +16 -1
- data/lib/auth0/organizations/roles/groups/client.rb +9 -1
- data/lib/auth0/organizations/roles/members/client.rb +11 -1
- data/lib/auth0/organizations/types/search_organizations_request_parameters.rb +19 -0
- data/lib/auth0/prompts/client.rb +8 -2
- data/lib/auth0/prompts/custom_text/client.rb +20 -2
- data/lib/auth0/prompts/partials/client.rb +16 -2
- data/lib/auth0/prompts/rendering/client.rb +34 -4
- data/lib/auth0/rate_limit_policies/client.rb +37 -4
- data/lib/auth0/refresh_tokens/client.rb +25 -3
- data/lib/auth0/resource_servers/client.rb +102 -4
- data/lib/auth0/resource_servers/types/create_resource_server_request_content.rb +4 -0
- data/lib/auth0/resource_servers/types/search_resource_servers_request_parameters.rb +23 -0
- data/lib/auth0/resource_servers/types/update_resource_server_request_content.rb +4 -0
- data/lib/auth0/risk_assessments/settings/client.rb +8 -2
- data/lib/auth0/risk_assessments/settings/new_device/client.rb +8 -2
- data/lib/auth0/roles/client.rb +26 -4
- data/lib/auth0/roles/groups/client.rb +20 -1
- data/lib/auth0/roles/permissions/client.rb +27 -1
- data/lib/auth0/roles/users/client.rb +15 -1
- data/lib/auth0/rules/client.rb +33 -4
- data/lib/auth0/rules_configs/client.rb +19 -5
- data/lib/auth0/self_service_profiles/client.rb +23 -4
- data/lib/auth0/self_service_profiles/custom_text/client.rb +23 -3
- data/lib/auth0/self_service_profiles/sso_ticket/client.rb +10 -1
- data/lib/auth0/sessions/client.rb +14 -2
- data/lib/auth0/stats/client.rb +16 -5
- data/lib/auth0/supplemental_signals/client.rb +8 -2
- data/lib/auth0/tenants/settings/client.rb +11 -2
- data/lib/auth0/tenants/settings/types/update_tenant_settings_request_content.rb +2 -0
- data/lib/auth0/tickets/client.rb +8 -2
- data/lib/auth0/token_exchange_profiles/client.rb +26 -3
- data/lib/auth0/types/advance_ramp_response_content.rb +15 -0
- data/lib/auth0/types/anonymous_sessions.rb +10 -0
- data/lib/auth0/types/client.rb +6 -0
- data/lib/auth0/types/client_my_organization_patch_configuration.rb +4 -0
- data/lib/auth0/types/client_my_organization_post_configuration.rb +4 -0
- data/lib/auth0/types/client_my_organization_response_configuration.rb +4 -0
- data/lib/auth0/types/connection_identity_provider_enum.rb +4 -13
- data/lib/auth0/types/connection_options_ad.rb +2 -0
- data/lib/auth0/types/connection_options_adfs.rb +2 -0
- data/lib/auth0/types/connection_options_azure_ad.rb +2 -0
- data/lib/auth0/types/connection_options_common_saml.rb +2 -0
- data/lib/auth0/types/connection_options_ping_federate.rb +2 -0
- data/lib/auth0/types/connection_options_saml.rb +2 -0
- data/lib/auth0/types/connection_properties_options.rb +4 -0
- data/lib/auth0/types/connection_strategy_enum.rb +4 -13
- data/lib/auth0/types/connection_thumbprints_sha384.rb +23 -0
- data/lib/auth0/types/connection_thumbprints_sha384ad.rb +23 -0
- data/lib/auth0/types/connection_thumbprints_sha384saml.rb +23 -0
- data/lib/auth0/types/create_anonymous_sessions.rb +10 -0
- data/lib/auth0/types/create_client_response_content.rb +6 -0
- data/lib/auth0/types/create_organization_all_connection_response_content.rb +2 -0
- data/lib/auth0/types/create_resource_server_response_content.rb +4 -0
- data/lib/auth0/types/get_client_response_content.rb +6 -0
- data/lib/auth0/types/get_email_factor_settings_response_content.rb +11 -0
- data/lib/auth0/types/get_guardian_settings_response_content.rb +15 -0
- data/lib/auth0/types/get_organization_all_connection_response_content.rb +2 -0
- data/lib/auth0/types/get_phone_factor_settings_response_content.rb +11 -0
- data/lib/auth0/types/get_resource_server_response_content.rb +4 -0
- data/lib/auth0/types/get_tenant_settings_response_content.rb +2 -0
- data/lib/auth0/types/oauth_scope.rb +1 -2
- data/lib/auth0/types/organization_all_connection_post.rb +2 -0
- data/lib/auth0/types/organization_member_access_level_enum.rb +14 -0
- data/lib/auth0/types/organization_member_access_level_enum_with_null.rb +14 -0
- data/lib/auth0/types/organization_sort_field_enum.rb +13 -0
- data/lib/auth0/types/resource_server.rb +4 -0
- data/lib/auth0/types/resource_server_access_token.rb +10 -0
- data/lib/auth0/types/resource_server_access_token_claims_mapping.rb +10 -0
- data/lib/auth0/types/resource_server_access_token_custom_claims_mapping.rb +23 -0
- data/lib/auth0/types/resource_server_access_token_custom_claims_mapping_rule.rb +11 -0
- data/lib/auth0/types/resource_server_search_response.rb +53 -0
- data/lib/auth0/types/resource_server_sort_field_enum.rb +13 -0
- data/lib/auth0/types/resource_server_subject_type_authorization.rb +2 -0
- data/lib/auth0/types/resource_server_subject_type_authorization_anonymous_user.rb +10 -0
- data/lib/auth0/types/resource_server_subject_type_authorization_anonymous_user_policy_enum.rb +12 -0
- data/lib/auth0/types/rotate_client_secret_response_content.rb +6 -0
- data/lib/auth0/types/search_organization.rb +23 -0
- data/lib/auth0/types/{list_template_organizations_paginated_response_content.rb → search_organizations_paginated_response_content.rb} +3 -3
- data/lib/auth0/types/search_parser_enum.rb +12 -0
- data/lib/auth0/types/search_resource_servers_response_content.rb +11 -0
- data/lib/auth0/types/set_email_factor_settings_response_content.rb +11 -0
- data/lib/auth0/types/set_guardian_settings_response_content.rb +15 -0
- data/lib/auth0/types/set_phone_factor_settings_response_content.rb +11 -0
- data/lib/auth0/types/tenant_settings_sessions.rb +2 -0
- data/lib/auth0/types/tenant_settings_sessions_anonymous.rb +12 -0
- data/lib/auth0/types/update_anonymous_sessions.rb +10 -0
- data/lib/auth0/types/update_client_response_content.rb +6 -0
- data/lib/auth0/types/update_connection_options.rb +4 -0
- data/lib/auth0/types/update_organization_all_connection_response_content.rb +2 -0
- data/lib/auth0/types/update_resource_server_response_content.rb +4 -0
- data/lib/auth0/types/update_tenant_settings_response_content.rb +2 -0
- data/lib/auth0/user_attribute_profiles/client.rb +40 -6
- data/lib/auth0/user_blocks/client.rb +20 -2
- data/lib/auth0/user_grants/client.rb +17 -1
- data/lib/auth0/users/authentication_methods/client.rb +57 -9
- data/lib/auth0/users/authenticators/client.rb +3 -0
- data/lib/auth0/users/client.rb +54 -9
- data/lib/auth0/users/connected_accounts/client.rb +8 -1
- data/lib/auth0/users/effective_permissions/client.rb +9 -1
- data/lib/auth0/users/effective_permissions/sources/roles/client.rb +10 -1
- data/lib/auth0/users/effective_roles/client.rb +8 -1
- data/lib/auth0/users/effective_roles/sources/groups/client.rb +9 -1
- data/lib/auth0/users/enrollments/client.rb +9 -4
- data/lib/auth0/users/groups/client.rb +11 -1
- data/lib/auth0/users/identities/client.rb +17 -5
- data/lib/auth0/users/logs/client.rb +10 -1
- data/lib/auth0/users/multifactor/client.rb +9 -0
- data/lib/auth0/users/organizations/client.rb +9 -1
- data/lib/auth0/users/permissions/client.rb +27 -1
- data/lib/auth0/users/refresh_token/client.rb +12 -1
- data/lib/auth0/users/risk_assessments/client.rb +7 -0
- data/lib/auth0/users/roles/client.rb +21 -1
- data/lib/auth0/users/sessions/client.rb +12 -1
- data/lib/auth0/verifiable_credentials/verification/templates/client.rb +32 -4
- data/lib/auth0/version.rb +1 -1
- data/lib/auth0.rb +46 -16
- data/wiremock/wiremock-mappings.json +333 -191
- metadata +40 -10
- data/lib/auth0/organization_templates/client.rb +0 -220
- data/lib/auth0/organization_templates/types/create_organization_template_request_content.rb +0 -35
- data/lib/auth0/organization_templates/types/list_organization_templates_request_parameters.rb +0 -13
- data/lib/auth0/organization_templates/types/list_template_organizations_request_parameters.rb +0 -15
- data/lib/auth0/organization_templates/types/update_organization_template_request_content.rb +0 -37
- data/lib/auth0/types/list_organization_templates_paginated_response_content.rb +0 -11
- data/lib/auth0/types/organization_template_assigned_organization.rb +0 -10
|
@@ -24,6 +24,9 @@ module Auth0
|
|
|
24
24
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
25
25
|
# @option request_options [Integer] :timeout_in_seconds
|
|
26
26
|
#
|
|
27
|
+
# @example
|
|
28
|
+
# client.guardian.factors.phone.get_message_types
|
|
29
|
+
#
|
|
27
30
|
# @return [Auth0::Types::GetGuardianFactorPhoneMessageTypesResponseContent]
|
|
28
31
|
def get_message_types(request_options: {}, **_params)
|
|
29
32
|
request = Auth0::Internal::JSON::Request.new(
|
|
@@ -39,7 +42,7 @@ module Auth0
|
|
|
39
42
|
end
|
|
40
43
|
code = response.code.to_i
|
|
41
44
|
if code.between?(200, 299)
|
|
42
|
-
Auth0::Types::GetGuardianFactorPhoneMessageTypesResponseContent.load(response.body)
|
|
45
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetGuardianFactorPhoneMessageTypesResponseContent.load(response.body))
|
|
43
46
|
else
|
|
44
47
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
45
48
|
raise error_class.new(response.body, code: code)
|
|
@@ -58,6 +61,9 @@ module Auth0
|
|
|
58
61
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
59
62
|
# @option request_options [Integer] :timeout_in_seconds
|
|
60
63
|
#
|
|
64
|
+
# @example
|
|
65
|
+
# client.guardian.factors.phone.set_message_types(message_types: ["sms"])
|
|
66
|
+
#
|
|
61
67
|
# @return [Auth0::Types::SetGuardianFactorPhoneMessageTypesResponseContent]
|
|
62
68
|
def set_message_types(request_options: {}, **params)
|
|
63
69
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -75,7 +81,7 @@ module Auth0
|
|
|
75
81
|
end
|
|
76
82
|
code = response.code.to_i
|
|
77
83
|
if code.between?(200, 299)
|
|
78
|
-
Auth0::Types::SetGuardianFactorPhoneMessageTypesResponseContent.load(response.body)
|
|
84
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::SetGuardianFactorPhoneMessageTypesResponseContent.load(response.body))
|
|
79
85
|
else
|
|
80
86
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
81
87
|
raise error_class.new(response.body, code: code)
|
|
@@ -95,6 +101,9 @@ module Auth0
|
|
|
95
101
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
96
102
|
# @option request_options [Integer] :timeout_in_seconds
|
|
97
103
|
#
|
|
104
|
+
# @example
|
|
105
|
+
# client.guardian.factors.phone.get_twilio_provider
|
|
106
|
+
#
|
|
98
107
|
# @return [Auth0::Types::GetGuardianFactorsProviderPhoneTwilioResponseContent]
|
|
99
108
|
def get_twilio_provider(request_options: {}, **_params)
|
|
100
109
|
request = Auth0::Internal::JSON::Request.new(
|
|
@@ -110,7 +119,7 @@ module Auth0
|
|
|
110
119
|
end
|
|
111
120
|
code = response.code.to_i
|
|
112
121
|
if code.between?(200, 299)
|
|
113
|
-
Auth0::Types::GetGuardianFactorsProviderPhoneTwilioResponseContent.load(response.body)
|
|
122
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetGuardianFactorsProviderPhoneTwilioResponseContent.load(response.body))
|
|
114
123
|
else
|
|
115
124
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
116
125
|
raise error_class.new(response.body, code: code)
|
|
@@ -130,6 +139,9 @@ module Auth0
|
|
|
130
139
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
131
140
|
# @option request_options [Integer] :timeout_in_seconds
|
|
132
141
|
#
|
|
142
|
+
# @example
|
|
143
|
+
# client.guardian.factors.phone.set_twilio_provider
|
|
144
|
+
#
|
|
133
145
|
# @return [Auth0::Types::SetGuardianFactorsProviderPhoneTwilioResponseContent]
|
|
134
146
|
def set_twilio_provider(request_options: {}, **params)
|
|
135
147
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -147,7 +159,7 @@ module Auth0
|
|
|
147
159
|
end
|
|
148
160
|
code = response.code.to_i
|
|
149
161
|
if code.between?(200, 299)
|
|
150
|
-
Auth0::Types::SetGuardianFactorsProviderPhoneTwilioResponseContent.load(response.body)
|
|
162
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::SetGuardianFactorsProviderPhoneTwilioResponseContent.load(response.body))
|
|
151
163
|
else
|
|
152
164
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
153
165
|
raise error_class.new(response.body, code: code)
|
|
@@ -164,6 +176,9 @@ module Auth0
|
|
|
164
176
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
165
177
|
# @option request_options [Integer] :timeout_in_seconds
|
|
166
178
|
#
|
|
179
|
+
# @example
|
|
180
|
+
# client.guardian.factors.phone.get_selected_provider
|
|
181
|
+
#
|
|
167
182
|
# @return [Auth0::Types::GetGuardianFactorsProviderPhoneResponseContent]
|
|
168
183
|
def get_selected_provider(request_options: {}, **_params)
|
|
169
184
|
request = Auth0::Internal::JSON::Request.new(
|
|
@@ -179,7 +194,7 @@ module Auth0
|
|
|
179
194
|
end
|
|
180
195
|
code = response.code.to_i
|
|
181
196
|
if code.between?(200, 299)
|
|
182
|
-
Auth0::Types::GetGuardianFactorsProviderPhoneResponseContent.load(response.body)
|
|
197
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetGuardianFactorsProviderPhoneResponseContent.load(response.body))
|
|
183
198
|
else
|
|
184
199
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
185
200
|
raise error_class.new(response.body, code: code)
|
|
@@ -194,6 +209,9 @@ module Auth0
|
|
|
194
209
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
195
210
|
# @option request_options [Integer] :timeout_in_seconds
|
|
196
211
|
#
|
|
212
|
+
# @example
|
|
213
|
+
# client.guardian.factors.phone.set_provider(provider: "auth0")
|
|
214
|
+
#
|
|
197
215
|
# @return [Auth0::Types::SetGuardianFactorsProviderPhoneResponseContent]
|
|
198
216
|
def set_provider(request_options: {}, **params)
|
|
199
217
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -211,7 +229,82 @@ module Auth0
|
|
|
211
229
|
end
|
|
212
230
|
code = response.code.to_i
|
|
213
231
|
if code.between?(200, 299)
|
|
214
|
-
Auth0::Types::SetGuardianFactorsProviderPhoneResponseContent.load(response.body)
|
|
232
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::SetGuardianFactorsProviderPhoneResponseContent.load(response.body))
|
|
233
|
+
else
|
|
234
|
+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
235
|
+
raise error_class.new(response.body, code: code)
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
# TODO: Link this endpoint to relevant documentation when available.
|
|
240
|
+
#
|
|
241
|
+
# @param request_options [Hash]
|
|
242
|
+
# @param _params [Hash]
|
|
243
|
+
# @option request_options [String] :base_url
|
|
244
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
245
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
246
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
247
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
248
|
+
#
|
|
249
|
+
# @example
|
|
250
|
+
# client.guardian.factors.phone.get
|
|
251
|
+
#
|
|
252
|
+
# @return [Auth0::Types::GetPhoneFactorSettingsResponseContent]
|
|
253
|
+
def get(request_options: {}, **_params)
|
|
254
|
+
request = Auth0::Internal::JSON::Request.new(
|
|
255
|
+
base_url: request_options[:base_url],
|
|
256
|
+
method: "GET",
|
|
257
|
+
path: "guardian/factors/phone/settings",
|
|
258
|
+
request_options: request_options
|
|
259
|
+
)
|
|
260
|
+
begin
|
|
261
|
+
response = @client.send(request)
|
|
262
|
+
rescue Net::HTTPRequestTimeout
|
|
263
|
+
raise Auth0::Errors::TimeoutError
|
|
264
|
+
end
|
|
265
|
+
code = response.code.to_i
|
|
266
|
+
if code.between?(200, 299)
|
|
267
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetPhoneFactorSettingsResponseContent.load(response.body))
|
|
268
|
+
else
|
|
269
|
+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
270
|
+
raise error_class.new(response.body, code: code)
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# TODO: Link this endpoint to relevant documentation when available.
|
|
275
|
+
#
|
|
276
|
+
# @param request_options [Hash]
|
|
277
|
+
# @param params [Auth0::Guardian::Factors::Phone::Types::SetPhoneFactorSettingsRequestContent]
|
|
278
|
+
# @option request_options [String] :base_url
|
|
279
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
280
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
281
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
282
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
283
|
+
#
|
|
284
|
+
# @example
|
|
285
|
+
# client.guardian.factors.phone.set(
|
|
286
|
+
# otp_length: 1,
|
|
287
|
+
# otp_expiration_time: 1
|
|
288
|
+
# )
|
|
289
|
+
#
|
|
290
|
+
# @return [Auth0::Types::SetPhoneFactorSettingsResponseContent]
|
|
291
|
+
def set(request_options: {}, **params)
|
|
292
|
+
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
293
|
+
request = Auth0::Internal::JSON::Request.new(
|
|
294
|
+
base_url: request_options[:base_url],
|
|
295
|
+
method: "PUT",
|
|
296
|
+
path: "guardian/factors/phone/settings",
|
|
297
|
+
body: Auth0::Guardian::Factors::Phone::Types::SetPhoneFactorSettingsRequestContent.new(params).to_h,
|
|
298
|
+
request_options: request_options
|
|
299
|
+
)
|
|
300
|
+
begin
|
|
301
|
+
response = @client.send(request)
|
|
302
|
+
rescue Net::HTTPRequestTimeout
|
|
303
|
+
raise Auth0::Errors::TimeoutError
|
|
304
|
+
end
|
|
305
|
+
code = response.code.to_i
|
|
306
|
+
if code.between?(200, 299)
|
|
307
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::SetPhoneFactorSettingsResponseContent.load(response.body))
|
|
215
308
|
else
|
|
216
309
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
217
310
|
raise error_class.new(response.body, code: code)
|
|
@@ -229,6 +322,9 @@ module Auth0
|
|
|
229
322
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
230
323
|
# @option request_options [Integer] :timeout_in_seconds
|
|
231
324
|
#
|
|
325
|
+
# @example
|
|
326
|
+
# client.guardian.factors.phone.get_templates
|
|
327
|
+
#
|
|
232
328
|
# @return [Auth0::Types::GetGuardianFactorPhoneTemplatesResponseContent]
|
|
233
329
|
def get_templates(request_options: {}, **_params)
|
|
234
330
|
request = Auth0::Internal::JSON::Request.new(
|
|
@@ -244,7 +340,7 @@ module Auth0
|
|
|
244
340
|
end
|
|
245
341
|
code = response.code.to_i
|
|
246
342
|
if code.between?(200, 299)
|
|
247
|
-
Auth0::Types::GetGuardianFactorPhoneTemplatesResponseContent.load(response.body)
|
|
343
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetGuardianFactorPhoneTemplatesResponseContent.load(response.body))
|
|
248
344
|
else
|
|
249
345
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
250
346
|
raise error_class.new(response.body, code: code)
|
|
@@ -261,6 +357,12 @@ module Auth0
|
|
|
261
357
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
262
358
|
# @option request_options [Integer] :timeout_in_seconds
|
|
263
359
|
#
|
|
360
|
+
# @example
|
|
361
|
+
# client.guardian.factors.phone.set_templates(
|
|
362
|
+
# enrollment_message: "enrollment_message",
|
|
363
|
+
# verification_message: "verification_message"
|
|
364
|
+
# )
|
|
365
|
+
#
|
|
264
366
|
# @return [Auth0::Types::SetGuardianFactorPhoneTemplatesResponseContent]
|
|
265
367
|
def set_templates(request_options: {}, **params)
|
|
266
368
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -278,7 +380,7 @@ module Auth0
|
|
|
278
380
|
end
|
|
279
381
|
code = response.code.to_i
|
|
280
382
|
if code.between?(200, 299)
|
|
281
|
-
Auth0::Types::SetGuardianFactorPhoneTemplatesResponseContent.load(response.body)
|
|
383
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::SetGuardianFactorPhoneTemplatesResponseContent.load(response.body))
|
|
282
384
|
else
|
|
283
385
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
284
386
|
raise error_class.new(response.body, code: code)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Auth0
|
|
4
|
+
module Guardian
|
|
5
|
+
module Factors
|
|
6
|
+
module Phone
|
|
7
|
+
module Types
|
|
8
|
+
class SetPhoneFactorSettingsRequestContent < Internal::Types::Model
|
|
9
|
+
field :otp_length, -> { Integer }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :otp_expiration_time, -> { Integer }, optional: false, nullable: false
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -23,6 +23,9 @@ module Auth0
|
|
|
23
23
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
24
24
|
# @option request_options [Integer] :timeout_in_seconds
|
|
25
25
|
#
|
|
26
|
+
# @example
|
|
27
|
+
# client.guardian.factors.push_notification.get_apns_provider
|
|
28
|
+
#
|
|
26
29
|
# @return [Auth0::Types::GetGuardianFactorsProviderApnsResponseContent]
|
|
27
30
|
def get_apns_provider(request_options: {}, **_params)
|
|
28
31
|
request = Auth0::Internal::JSON::Request.new(
|
|
@@ -38,7 +41,7 @@ module Auth0
|
|
|
38
41
|
end
|
|
39
42
|
code = response.code.to_i
|
|
40
43
|
if code.between?(200, 299)
|
|
41
|
-
Auth0::Types::GetGuardianFactorsProviderApnsResponseContent.load(response.body)
|
|
44
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetGuardianFactorsProviderApnsResponseContent.load(response.body))
|
|
42
45
|
else
|
|
43
46
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
44
47
|
raise error_class.new(response.body, code: code)
|
|
@@ -56,6 +59,9 @@ module Auth0
|
|
|
56
59
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
57
60
|
# @option request_options [Integer] :timeout_in_seconds
|
|
58
61
|
#
|
|
62
|
+
# @example
|
|
63
|
+
# client.guardian.factors.push_notification.set_apns_provider
|
|
64
|
+
#
|
|
59
65
|
# @return [Auth0::Types::SetGuardianFactorsProviderPushNotificationApnsResponseContent]
|
|
60
66
|
def set_apns_provider(request_options: {}, **params)
|
|
61
67
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -73,7 +79,7 @@ module Auth0
|
|
|
73
79
|
end
|
|
74
80
|
code = response.code.to_i
|
|
75
81
|
if code.between?(200, 299)
|
|
76
|
-
Auth0::Types::SetGuardianFactorsProviderPushNotificationApnsResponseContent.load(response.body)
|
|
82
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::SetGuardianFactorsProviderPushNotificationApnsResponseContent.load(response.body))
|
|
77
83
|
else
|
|
78
84
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
79
85
|
raise error_class.new(response.body, code: code)
|
|
@@ -90,6 +96,9 @@ module Auth0
|
|
|
90
96
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
91
97
|
# @option request_options [Integer] :timeout_in_seconds
|
|
92
98
|
#
|
|
99
|
+
# @example
|
|
100
|
+
# client.guardian.factors.push_notification.update_apns_provider
|
|
101
|
+
#
|
|
93
102
|
# @return [Auth0::Types::UpdateGuardianFactorsProviderPushNotificationApnsResponseContent]
|
|
94
103
|
def update_apns_provider(request_options: {}, **params)
|
|
95
104
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -107,7 +116,7 @@ module Auth0
|
|
|
107
116
|
end
|
|
108
117
|
code = response.code.to_i
|
|
109
118
|
if code.between?(200, 299)
|
|
110
|
-
Auth0::Types::UpdateGuardianFactorsProviderPushNotificationApnsResponseContent.load(response.body)
|
|
119
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::UpdateGuardianFactorsProviderPushNotificationApnsResponseContent.load(response.body))
|
|
111
120
|
else
|
|
112
121
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
113
122
|
raise error_class.new(response.body, code: code)
|
|
@@ -125,6 +134,9 @@ module Auth0
|
|
|
125
134
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
126
135
|
# @option request_options [Integer] :timeout_in_seconds
|
|
127
136
|
#
|
|
137
|
+
# @example
|
|
138
|
+
# client.guardian.factors.push_notification.set_fcm_provider
|
|
139
|
+
#
|
|
128
140
|
# @return [Hash[String, Object]]
|
|
129
141
|
def set_fcm_provider(request_options: {}, **params)
|
|
130
142
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -142,7 +154,7 @@ module Auth0
|
|
|
142
154
|
end
|
|
143
155
|
code = response.code.to_i
|
|
144
156
|
if code.between?(200, 299)
|
|
145
|
-
Auth0::Types::SetGuardianFactorsProviderPushNotificationFcmResponseContent.load(response.body)
|
|
157
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::SetGuardianFactorsProviderPushNotificationFcmResponseContent.load(response.body))
|
|
146
158
|
else
|
|
147
159
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
148
160
|
raise error_class.new(response.body, code: code)
|
|
@@ -159,6 +171,9 @@ module Auth0
|
|
|
159
171
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
160
172
|
# @option request_options [Integer] :timeout_in_seconds
|
|
161
173
|
#
|
|
174
|
+
# @example
|
|
175
|
+
# client.guardian.factors.push_notification.update_fcm_provider
|
|
176
|
+
#
|
|
162
177
|
# @return [Hash[String, Object]]
|
|
163
178
|
def update_fcm_provider(request_options: {}, **params)
|
|
164
179
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -176,7 +191,7 @@ module Auth0
|
|
|
176
191
|
end
|
|
177
192
|
code = response.code.to_i
|
|
178
193
|
if code.between?(200, 299)
|
|
179
|
-
Auth0::Types::UpdateGuardianFactorsProviderPushNotificationFcmResponseContent.load(response.body)
|
|
194
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::UpdateGuardianFactorsProviderPushNotificationFcmResponseContent.load(response.body))
|
|
180
195
|
else
|
|
181
196
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
182
197
|
raise error_class.new(response.body, code: code)
|
|
@@ -194,6 +209,9 @@ module Auth0
|
|
|
194
209
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
195
210
|
# @option request_options [Integer] :timeout_in_seconds
|
|
196
211
|
#
|
|
212
|
+
# @example
|
|
213
|
+
# client.guardian.factors.push_notification.set_fcmv1provider
|
|
214
|
+
#
|
|
197
215
|
# @return [Hash[String, Object]]
|
|
198
216
|
def set_fcmv1provider(request_options: {}, **params)
|
|
199
217
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -211,7 +229,7 @@ module Auth0
|
|
|
211
229
|
end
|
|
212
230
|
code = response.code.to_i
|
|
213
231
|
if code.between?(200, 299)
|
|
214
|
-
Auth0::Types::SetGuardianFactorsProviderPushNotificationFcmv1ResponseContent.load(response.body)
|
|
232
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::SetGuardianFactorsProviderPushNotificationFcmv1ResponseContent.load(response.body))
|
|
215
233
|
else
|
|
216
234
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
217
235
|
raise error_class.new(response.body, code: code)
|
|
@@ -228,6 +246,9 @@ module Auth0
|
|
|
228
246
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
229
247
|
# @option request_options [Integer] :timeout_in_seconds
|
|
230
248
|
#
|
|
249
|
+
# @example
|
|
250
|
+
# client.guardian.factors.push_notification.update_fcmv1provider
|
|
251
|
+
#
|
|
231
252
|
# @return [Hash[String, Object]]
|
|
232
253
|
def update_fcmv1provider(request_options: {}, **params)
|
|
233
254
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -245,7 +266,7 @@ module Auth0
|
|
|
245
266
|
end
|
|
246
267
|
code = response.code.to_i
|
|
247
268
|
if code.between?(200, 299)
|
|
248
|
-
Auth0::Types::UpdateGuardianFactorsProviderPushNotificationFcmv1ResponseContent.load(response.body)
|
|
269
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::UpdateGuardianFactorsProviderPushNotificationFcmv1ResponseContent.load(response.body))
|
|
249
270
|
else
|
|
250
271
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
251
272
|
raise error_class.new(response.body, code: code)
|
|
@@ -264,6 +285,9 @@ module Auth0
|
|
|
264
285
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
265
286
|
# @option request_options [Integer] :timeout_in_seconds
|
|
266
287
|
#
|
|
288
|
+
# @example
|
|
289
|
+
# client.guardian.factors.push_notification.get_sns_provider
|
|
290
|
+
#
|
|
267
291
|
# @return [Auth0::Types::GetGuardianFactorsProviderSnsResponseContent]
|
|
268
292
|
def get_sns_provider(request_options: {}, **_params)
|
|
269
293
|
request = Auth0::Internal::JSON::Request.new(
|
|
@@ -279,7 +303,7 @@ module Auth0
|
|
|
279
303
|
end
|
|
280
304
|
code = response.code.to_i
|
|
281
305
|
if code.between?(200, 299)
|
|
282
|
-
Auth0::Types::GetGuardianFactorsProviderSnsResponseContent.load(response.body)
|
|
306
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetGuardianFactorsProviderSnsResponseContent.load(response.body))
|
|
283
307
|
else
|
|
284
308
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
285
309
|
raise error_class.new(response.body, code: code)
|
|
@@ -298,6 +322,9 @@ module Auth0
|
|
|
298
322
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
299
323
|
# @option request_options [Integer] :timeout_in_seconds
|
|
300
324
|
#
|
|
325
|
+
# @example
|
|
326
|
+
# client.guardian.factors.push_notification.set_sns_provider
|
|
327
|
+
#
|
|
301
328
|
# @return [Auth0::Types::SetGuardianFactorsProviderPushNotificationSnsResponseContent]
|
|
302
329
|
def set_sns_provider(request_options: {}, **params)
|
|
303
330
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -315,7 +342,7 @@ module Auth0
|
|
|
315
342
|
end
|
|
316
343
|
code = response.code.to_i
|
|
317
344
|
if code.between?(200, 299)
|
|
318
|
-
Auth0::Types::SetGuardianFactorsProviderPushNotificationSnsResponseContent.load(response.body)
|
|
345
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::SetGuardianFactorsProviderPushNotificationSnsResponseContent.load(response.body))
|
|
319
346
|
else
|
|
320
347
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
321
348
|
raise error_class.new(response.body, code: code)
|
|
@@ -334,6 +361,9 @@ module Auth0
|
|
|
334
361
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
335
362
|
# @option request_options [Integer] :timeout_in_seconds
|
|
336
363
|
#
|
|
364
|
+
# @example
|
|
365
|
+
# client.guardian.factors.push_notification.update_sns_provider
|
|
366
|
+
#
|
|
337
367
|
# @return [Auth0::Types::UpdateGuardianFactorsProviderPushNotificationSnsResponseContent]
|
|
338
368
|
def update_sns_provider(request_options: {}, **params)
|
|
339
369
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -351,7 +381,7 @@ module Auth0
|
|
|
351
381
|
end
|
|
352
382
|
code = response.code.to_i
|
|
353
383
|
if code.between?(200, 299)
|
|
354
|
-
Auth0::Types::UpdateGuardianFactorsProviderPushNotificationSnsResponseContent.load(response.body)
|
|
384
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::UpdateGuardianFactorsProviderPushNotificationSnsResponseContent.load(response.body))
|
|
355
385
|
else
|
|
356
386
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
357
387
|
raise error_class.new(response.body, code: code)
|
|
@@ -370,6 +400,9 @@ module Auth0
|
|
|
370
400
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
371
401
|
# @option request_options [Integer] :timeout_in_seconds
|
|
372
402
|
#
|
|
403
|
+
# @example
|
|
404
|
+
# client.guardian.factors.push_notification.get_selected_provider
|
|
405
|
+
#
|
|
373
406
|
# @return [Auth0::Types::GetGuardianFactorsProviderPushNotificationResponseContent]
|
|
374
407
|
def get_selected_provider(request_options: {}, **_params)
|
|
375
408
|
request = Auth0::Internal::JSON::Request.new(
|
|
@@ -385,7 +418,7 @@ module Auth0
|
|
|
385
418
|
end
|
|
386
419
|
code = response.code.to_i
|
|
387
420
|
if code.between?(200, 299)
|
|
388
|
-
Auth0::Types::GetGuardianFactorsProviderPushNotificationResponseContent.load(response.body)
|
|
421
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetGuardianFactorsProviderPushNotificationResponseContent.load(response.body))
|
|
389
422
|
else
|
|
390
423
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
391
424
|
raise error_class.new(response.body, code: code)
|
|
@@ -404,6 +437,9 @@ module Auth0
|
|
|
404
437
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
405
438
|
# @option request_options [Integer] :timeout_in_seconds
|
|
406
439
|
#
|
|
440
|
+
# @example
|
|
441
|
+
# client.guardian.factors.push_notification.set_provider(provider: "guardian")
|
|
442
|
+
#
|
|
407
443
|
# @return [Auth0::Types::SetGuardianFactorsProviderPushNotificationResponseContent]
|
|
408
444
|
def set_provider(request_options: {}, **params)
|
|
409
445
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -421,7 +457,7 @@ module Auth0
|
|
|
421
457
|
end
|
|
422
458
|
code = response.code.to_i
|
|
423
459
|
if code.between?(200, 299)
|
|
424
|
-
Auth0::Types::SetGuardianFactorsProviderPushNotificationResponseContent.load(response.body)
|
|
460
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::SetGuardianFactorsProviderPushNotificationResponseContent.load(response.body))
|
|
425
461
|
else
|
|
426
462
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
427
463
|
raise error_class.new(response.body, code: code)
|
|
@@ -27,6 +27,9 @@ module Auth0
|
|
|
27
27
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
28
28
|
# @option request_options [Integer] :timeout_in_seconds
|
|
29
29
|
#
|
|
30
|
+
# @example
|
|
31
|
+
# client.guardian.factors.sms.get_twilio_provider
|
|
32
|
+
#
|
|
30
33
|
# @return [Auth0::Types::GetGuardianFactorsProviderSmsTwilioResponseContent]
|
|
31
34
|
def get_twilio_provider(request_options: {}, **_params)
|
|
32
35
|
request = Auth0::Internal::JSON::Request.new(
|
|
@@ -42,7 +45,7 @@ module Auth0
|
|
|
42
45
|
end
|
|
43
46
|
code = response.code.to_i
|
|
44
47
|
if code.between?(200, 299)
|
|
45
|
-
Auth0::Types::GetGuardianFactorsProviderSmsTwilioResponseContent.load(response.body)
|
|
48
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetGuardianFactorsProviderSmsTwilioResponseContent.load(response.body))
|
|
46
49
|
else
|
|
47
50
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
48
51
|
raise error_class.new(response.body, code: code)
|
|
@@ -63,6 +66,9 @@ module Auth0
|
|
|
63
66
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
64
67
|
# @option request_options [Integer] :timeout_in_seconds
|
|
65
68
|
#
|
|
69
|
+
# @example
|
|
70
|
+
# client.guardian.factors.sms.set_twilio_provider
|
|
71
|
+
#
|
|
66
72
|
# @return [Auth0::Types::SetGuardianFactorsProviderSmsTwilioResponseContent]
|
|
67
73
|
def set_twilio_provider(request_options: {}, **params)
|
|
68
74
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -80,7 +86,7 @@ module Auth0
|
|
|
80
86
|
end
|
|
81
87
|
code = response.code.to_i
|
|
82
88
|
if code.between?(200, 299)
|
|
83
|
-
Auth0::Types::SetGuardianFactorsProviderSmsTwilioResponseContent.load(response.body)
|
|
89
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::SetGuardianFactorsProviderSmsTwilioResponseContent.load(response.body))
|
|
84
90
|
else
|
|
85
91
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
86
92
|
raise error_class.new(response.body, code: code)
|
|
@@ -102,6 +108,9 @@ module Auth0
|
|
|
102
108
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
103
109
|
# @option request_options [Integer] :timeout_in_seconds
|
|
104
110
|
#
|
|
111
|
+
# @example
|
|
112
|
+
# client.guardian.factors.sms.get_selected_provider
|
|
113
|
+
#
|
|
105
114
|
# @return [Auth0::Types::GetGuardianFactorsProviderSmsResponseContent]
|
|
106
115
|
def get_selected_provider(request_options: {}, **_params)
|
|
107
116
|
request = Auth0::Internal::JSON::Request.new(
|
|
@@ -117,7 +126,7 @@ module Auth0
|
|
|
117
126
|
end
|
|
118
127
|
code = response.code.to_i
|
|
119
128
|
if code.between?(200, 299)
|
|
120
|
-
Auth0::Types::GetGuardianFactorsProviderSmsResponseContent.load(response.body)
|
|
129
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetGuardianFactorsProviderSmsResponseContent.load(response.body))
|
|
121
130
|
else
|
|
122
131
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
123
132
|
raise error_class.new(response.body, code: code)
|
|
@@ -139,6 +148,9 @@ module Auth0
|
|
|
139
148
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
140
149
|
# @option request_options [Integer] :timeout_in_seconds
|
|
141
150
|
#
|
|
151
|
+
# @example
|
|
152
|
+
# client.guardian.factors.sms.set_provider(provider: "auth0")
|
|
153
|
+
#
|
|
142
154
|
# @return [Auth0::Types::SetGuardianFactorsProviderSmsResponseContent]
|
|
143
155
|
def set_provider(request_options: {}, **params)
|
|
144
156
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -156,7 +168,7 @@ module Auth0
|
|
|
156
168
|
end
|
|
157
169
|
code = response.code.to_i
|
|
158
170
|
if code.between?(200, 299)
|
|
159
|
-
Auth0::Types::SetGuardianFactorsProviderSmsResponseContent.load(response.body)
|
|
171
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::SetGuardianFactorsProviderSmsResponseContent.load(response.body))
|
|
160
172
|
else
|
|
161
173
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
162
174
|
raise error_class.new(response.body, code: code)
|
|
@@ -178,6 +190,9 @@ module Auth0
|
|
|
178
190
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
179
191
|
# @option request_options [Integer] :timeout_in_seconds
|
|
180
192
|
#
|
|
193
|
+
# @example
|
|
194
|
+
# client.guardian.factors.sms.get_templates
|
|
195
|
+
#
|
|
181
196
|
# @return [Auth0::Types::GetGuardianFactorSmsTemplatesResponseContent, nil]
|
|
182
197
|
def get_templates(request_options: {}, **_params)
|
|
183
198
|
request = Auth0::Internal::JSON::Request.new(
|
|
@@ -192,10 +207,12 @@ module Auth0
|
|
|
192
207
|
raise Auth0::Errors::TimeoutError
|
|
193
208
|
end
|
|
194
209
|
code = response.code.to_i
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
210
|
+
if code.between?(200, 299)
|
|
211
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetGuardianFactorSmsTemplatesResponseContent.load(response.body))
|
|
212
|
+
else
|
|
213
|
+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
214
|
+
raise error_class.new(response.body, code: code)
|
|
215
|
+
end
|
|
199
216
|
end
|
|
200
217
|
|
|
201
218
|
# This endpoint has been deprecated. To complete this action, use the <a
|
|
@@ -212,6 +229,12 @@ module Auth0
|
|
|
212
229
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
213
230
|
# @option request_options [Integer] :timeout_in_seconds
|
|
214
231
|
#
|
|
232
|
+
# @example
|
|
233
|
+
# client.guardian.factors.sms.set_templates(
|
|
234
|
+
# enrollment_message: "enrollment_message",
|
|
235
|
+
# verification_message: "verification_message"
|
|
236
|
+
# )
|
|
237
|
+
#
|
|
215
238
|
# @return [Auth0::Types::SetGuardianFactorSmsTemplatesResponseContent]
|
|
216
239
|
def set_templates(request_options: {}, **params)
|
|
217
240
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -229,7 +252,7 @@ module Auth0
|
|
|
229
252
|
end
|
|
230
253
|
code = response.code.to_i
|
|
231
254
|
if code.between?(200, 299)
|
|
232
|
-
Auth0::Types::SetGuardianFactorSmsTemplatesResponseContent.load(response.body)
|
|
255
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::SetGuardianFactorSmsTemplatesResponseContent.load(response.body))
|
|
233
256
|
else
|
|
234
257
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
235
258
|
raise error_class.new(response.body, code: code)
|
|
@@ -31,6 +31,9 @@ module Auth0
|
|
|
31
31
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
32
32
|
# @option request_options [Integer] :timeout_in_seconds
|
|
33
33
|
#
|
|
34
|
+
# @example
|
|
35
|
+
# client.guardian.policies.list
|
|
36
|
+
#
|
|
34
37
|
# @return [Array[Auth0::Types::MfaPolicyEnum]]
|
|
35
38
|
def list(request_options: {}, **_params)
|
|
36
39
|
request = Auth0::Internal::JSON::Request.new(
|
|
@@ -46,7 +49,7 @@ module Auth0
|
|
|
46
49
|
end
|
|
47
50
|
code = response.code.to_i
|
|
48
51
|
if code.between?(200, 299)
|
|
49
|
-
Auth0::Types::ListGuardianPoliciesResponseContent.load(response.body)
|
|
52
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::ListGuardianPoliciesResponseContent.load(response.body))
|
|
50
53
|
else
|
|
51
54
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
52
55
|
raise error_class.new(response.body, code: code)
|
|
@@ -73,6 +76,9 @@ module Auth0
|
|
|
73
76
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
74
77
|
# @option request_options [Integer] :timeout_in_seconds
|
|
75
78
|
#
|
|
79
|
+
# @example
|
|
80
|
+
# client.guardian.policies.set(request: ["all-applications"])
|
|
81
|
+
#
|
|
76
82
|
# @return [Array[Auth0::Types::MfaPolicyEnum]]
|
|
77
83
|
def set(request_options: {}, **params)
|
|
78
84
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -90,7 +96,7 @@ module Auth0
|
|
|
90
96
|
end
|
|
91
97
|
code = response.code.to_i
|
|
92
98
|
if code.between?(200, 299)
|
|
93
|
-
Auth0::Types::SetGuardianPoliciesResponseContent.load(response.body)
|
|
99
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::SetGuardianPoliciesResponseContent.load(response.body))
|
|
94
100
|
else
|
|
95
101
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
96
102
|
raise error_class.new(response.body, code: code)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Auth0
|
|
4
|
+
module Guardian
|
|
5
|
+
module Types
|
|
6
|
+
class SetGuardianSettingsRequestContent < Internal::Types::Model
|
|
7
|
+
field :display_remember_me_checkbox, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
8
|
+
|
|
9
|
+
field :remember_me_default_value, -> { Internal::Types::Boolean }, optional: false, nullable: false
|
|
10
|
+
|
|
11
|
+
field :mfa_session_inactivity_timeout, -> { Integer }, optional: false, nullable: false
|
|
12
|
+
|
|
13
|
+
field :mfa_session_overall_timeout, -> { Integer }, optional: false, nullable: false
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|