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
data/lib/auth0/agents/client.rb
CHANGED
|
@@ -22,6 +22,12 @@ module Auth0
|
|
|
22
22
|
# @option params [String, nil] :from
|
|
23
23
|
# @option params [Integer, nil] :take
|
|
24
24
|
#
|
|
25
|
+
# @example
|
|
26
|
+
# client.agents.list(
|
|
27
|
+
# from: "from",
|
|
28
|
+
# take: 1
|
|
29
|
+
# )
|
|
30
|
+
#
|
|
25
31
|
# @return [Auth0::Types::ListAgentsResponseContent]
|
|
26
32
|
def list(request_options: {}, **params)
|
|
27
33
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -49,7 +55,7 @@ module Auth0
|
|
|
49
55
|
end
|
|
50
56
|
code = response.code.to_i
|
|
51
57
|
if code.between?(200, 299)
|
|
52
|
-
parsed_response = Auth0::Types::ListAgentsResponseContent.load(response.body)
|
|
58
|
+
parsed_response = (response.body.to_s.empty? ? nil : Auth0::Types::ListAgentsResponseContent.load(response.body))
|
|
53
59
|
[parsed_response, response]
|
|
54
60
|
else
|
|
55
61
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
@@ -68,6 +74,9 @@ module Auth0
|
|
|
68
74
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
69
75
|
# @option request_options [Integer] :timeout_in_seconds
|
|
70
76
|
#
|
|
77
|
+
# @example
|
|
78
|
+
# client.agents.create(name: "name")
|
|
79
|
+
#
|
|
71
80
|
# @return [Auth0::Types::AgentResponseContent]
|
|
72
81
|
def create(request_options: {}, **params)
|
|
73
82
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -85,7 +94,7 @@ module Auth0
|
|
|
85
94
|
end
|
|
86
95
|
code = response.code.to_i
|
|
87
96
|
if code.between?(200, 299)
|
|
88
|
-
Auth0::Types::AgentResponseContent.load(response.body)
|
|
97
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::AgentResponseContent.load(response.body))
|
|
89
98
|
else
|
|
90
99
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
91
100
|
raise error_class.new(response.body, code: code)
|
|
@@ -103,6 +112,9 @@ module Auth0
|
|
|
103
112
|
# @option request_options [Integer] :timeout_in_seconds
|
|
104
113
|
# @option params [String] :id
|
|
105
114
|
#
|
|
115
|
+
# @example
|
|
116
|
+
# client.agents.read(id: "id")
|
|
117
|
+
#
|
|
106
118
|
# @return [Auth0::Types::AgentResponseContent]
|
|
107
119
|
def read(request_options: {}, **params)
|
|
108
120
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -119,7 +131,7 @@ module Auth0
|
|
|
119
131
|
end
|
|
120
132
|
code = response.code.to_i
|
|
121
133
|
if code.between?(200, 299)
|
|
122
|
-
Auth0::Types::AgentResponseContent.load(response.body)
|
|
134
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::AgentResponseContent.load(response.body))
|
|
123
135
|
else
|
|
124
136
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
125
137
|
raise error_class.new(response.body, code: code)
|
|
@@ -137,6 +149,9 @@ module Auth0
|
|
|
137
149
|
# @option request_options [Integer] :timeout_in_seconds
|
|
138
150
|
# @option params [String] :id
|
|
139
151
|
#
|
|
152
|
+
# @example
|
|
153
|
+
# client.agents.delete(id: "id")
|
|
154
|
+
#
|
|
140
155
|
# @return [untyped]
|
|
141
156
|
def delete(request_options: {}, **params)
|
|
142
157
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -169,6 +184,9 @@ module Auth0
|
|
|
169
184
|
# @option request_options [Integer] :timeout_in_seconds
|
|
170
185
|
# @option params [String] :id
|
|
171
186
|
#
|
|
187
|
+
# @example
|
|
188
|
+
# client.agents.update(id: "id")
|
|
189
|
+
#
|
|
172
190
|
# @return [Auth0::Types::AgentResponseContent]
|
|
173
191
|
def update(request_options: {}, **params)
|
|
174
192
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -190,7 +208,7 @@ module Auth0
|
|
|
190
208
|
end
|
|
191
209
|
code = response.code.to_i
|
|
192
210
|
if code.between?(200, 299)
|
|
193
|
-
Auth0::Types::AgentResponseContent.load(response.body)
|
|
211
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::AgentResponseContent.load(response.body))
|
|
194
212
|
else
|
|
195
213
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
196
214
|
raise error_class.new(response.body, code: code)
|
|
@@ -24,6 +24,9 @@ module Auth0
|
|
|
24
24
|
# @option request_options [Integer] :timeout_in_seconds
|
|
25
25
|
# @option params [Auth0::Types::AnomalyIPFormat] :id
|
|
26
26
|
#
|
|
27
|
+
# @example
|
|
28
|
+
# client.anomaly.blocks.check_ip(id: "id")
|
|
29
|
+
#
|
|
27
30
|
# @return [untyped]
|
|
28
31
|
def check_ip(request_options: {}, **params)
|
|
29
32
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -58,6 +61,9 @@ module Auth0
|
|
|
58
61
|
# @option request_options [Integer] :timeout_in_seconds
|
|
59
62
|
# @option params [Auth0::Types::AnomalyIPFormat] :id
|
|
60
63
|
#
|
|
64
|
+
# @example
|
|
65
|
+
# client.anomaly.blocks.unblock_ip(id: "id")
|
|
66
|
+
#
|
|
61
67
|
# @return [untyped]
|
|
62
68
|
def unblock_ip(request_options: {}, **params)
|
|
63
69
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -74,6 +74,46 @@ module Auth0
|
|
|
74
74
|
::Auth0::AccessToken.from_response request_with_retry(:post, '/oauth/token', request_params)
|
|
75
75
|
end
|
|
76
76
|
|
|
77
|
+
# Start a Device Authorization flow.
|
|
78
|
+
#
|
|
79
|
+
# Device flow runs as a public client: no client_secret or client assertion is
|
|
80
|
+
# sent, and Auth0 rejects the request with `unauthorized_client` if one is.
|
|
81
|
+
# @see https://auth0.com/docs/api/authentication#device-authorization-flow
|
|
82
|
+
# @param scope [string] Space-separated list of requested scopes.
|
|
83
|
+
# @param audience [string] Unique identifier of the target API.
|
|
84
|
+
# @param client_id [string] Client ID for the application
|
|
85
|
+
# @return [json] Returns device_code, user_code, verification_uri,
|
|
86
|
+
# verification_uri_complete, expires_in and interval.
|
|
87
|
+
def start_device_flow(scope: nil, audience: nil, client_id: @client_id)
|
|
88
|
+
request_params = {
|
|
89
|
+
client_id: client_id,
|
|
90
|
+
scope: scope,
|
|
91
|
+
audience: audience
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
request_with_retry(:post, '/oauth/device/code', request_params)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Get access and ID tokens using a device code.
|
|
98
|
+
#
|
|
99
|
+
# Device flow runs as a public client: no client_secret or client assertion is
|
|
100
|
+
# sent, and Auth0 rejects the request with `unauthorized_client` if one is.
|
|
101
|
+
# @see https://auth0.com/docs/api/authentication#device-authorization-flow
|
|
102
|
+
# @param device_code [string] The device code returned by start_device_flow.
|
|
103
|
+
# @param client_id [string] Client ID for the application
|
|
104
|
+
# @return [Auth0::AccessToken] Returns the access_token and id_token
|
|
105
|
+
def exchange_device_code_for_tokens(device_code, client_id: @client_id)
|
|
106
|
+
raise Auth0::InvalidParameter, 'Must provide a device code' if device_code.to_s.empty?
|
|
107
|
+
|
|
108
|
+
request_params = {
|
|
109
|
+
grant_type: 'urn:ietf:params:oauth:grant-type:device_code',
|
|
110
|
+
client_id: client_id,
|
|
111
|
+
device_code: device_code
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
::Auth0::AccessToken.from_response request_with_retry(:post, '/oauth/token', request_params)
|
|
115
|
+
end
|
|
116
|
+
|
|
77
117
|
# Get access and ID tokens using a refresh token.
|
|
78
118
|
# @see https://auth0.com/docs/api/authentication#refresh-token
|
|
79
119
|
# @param refresh_token [string] Refresh token to use. Request this with
|
|
@@ -21,6 +21,9 @@ module Auth0
|
|
|
21
21
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
22
22
|
# @option request_options [Integer] :timeout_in_seconds
|
|
23
23
|
#
|
|
24
|
+
# @example
|
|
25
|
+
# client.attack_protection.bot_detection.get
|
|
26
|
+
#
|
|
24
27
|
# @return [Auth0::Types::GetBotDetectionSettingsResponseContent]
|
|
25
28
|
def get(request_options: {}, **_params)
|
|
26
29
|
request = Auth0::Internal::JSON::Request.new(
|
|
@@ -36,7 +39,7 @@ module Auth0
|
|
|
36
39
|
end
|
|
37
40
|
code = response.code.to_i
|
|
38
41
|
if code.between?(200, 299)
|
|
39
|
-
Auth0::Types::GetBotDetectionSettingsResponseContent.load(response.body)
|
|
42
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetBotDetectionSettingsResponseContent.load(response.body))
|
|
40
43
|
else
|
|
41
44
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
42
45
|
raise error_class.new(response.body, code: code)
|
|
@@ -53,6 +56,9 @@ module Auth0
|
|
|
53
56
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
54
57
|
# @option request_options [Integer] :timeout_in_seconds
|
|
55
58
|
#
|
|
59
|
+
# @example
|
|
60
|
+
# client.attack_protection.bot_detection.update
|
|
61
|
+
#
|
|
56
62
|
# @return [Auth0::Types::UpdateBotDetectionSettingsResponseContent]
|
|
57
63
|
def update(request_options: {}, **params)
|
|
58
64
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -70,7 +76,7 @@ module Auth0
|
|
|
70
76
|
end
|
|
71
77
|
code = response.code.to_i
|
|
72
78
|
if code.between?(200, 299)
|
|
73
|
-
Auth0::Types::UpdateBotDetectionSettingsResponseContent.load(response.body)
|
|
79
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::UpdateBotDetectionSettingsResponseContent.load(response.body))
|
|
74
80
|
else
|
|
75
81
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
76
82
|
raise error_class.new(response.body, code: code)
|
|
@@ -21,6 +21,9 @@ module Auth0
|
|
|
21
21
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
22
22
|
# @option request_options [Integer] :timeout_in_seconds
|
|
23
23
|
#
|
|
24
|
+
# @example
|
|
25
|
+
# client.attack_protection.breached_password_detection.get
|
|
26
|
+
#
|
|
24
27
|
# @return [Auth0::Types::GetBreachedPasswordDetectionSettingsResponseContent]
|
|
25
28
|
def get(request_options: {}, **_params)
|
|
26
29
|
request = Auth0::Internal::JSON::Request.new(
|
|
@@ -36,7 +39,7 @@ module Auth0
|
|
|
36
39
|
end
|
|
37
40
|
code = response.code.to_i
|
|
38
41
|
if code.between?(200, 299)
|
|
39
|
-
Auth0::Types::GetBreachedPasswordDetectionSettingsResponseContent.load(response.body)
|
|
42
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetBreachedPasswordDetectionSettingsResponseContent.load(response.body))
|
|
40
43
|
else
|
|
41
44
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
42
45
|
raise error_class.new(response.body, code: code)
|
|
@@ -53,6 +56,9 @@ module Auth0
|
|
|
53
56
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
54
57
|
# @option request_options [Integer] :timeout_in_seconds
|
|
55
58
|
#
|
|
59
|
+
# @example
|
|
60
|
+
# client.attack_protection.breached_password_detection.update
|
|
61
|
+
#
|
|
56
62
|
# @return [Auth0::Types::UpdateBreachedPasswordDetectionSettingsResponseContent]
|
|
57
63
|
def update(request_options: {}, **params)
|
|
58
64
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -70,7 +76,7 @@ module Auth0
|
|
|
70
76
|
end
|
|
71
77
|
code = response.code.to_i
|
|
72
78
|
if code.between?(200, 299)
|
|
73
|
-
Auth0::Types::UpdateBreachedPasswordDetectionSettingsResponseContent.load(response.body)
|
|
79
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::UpdateBreachedPasswordDetectionSettingsResponseContent.load(response.body))
|
|
74
80
|
else
|
|
75
81
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
76
82
|
raise error_class.new(response.body, code: code)
|
|
@@ -21,6 +21,9 @@ module Auth0
|
|
|
21
21
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
22
22
|
# @option request_options [Integer] :timeout_in_seconds
|
|
23
23
|
#
|
|
24
|
+
# @example
|
|
25
|
+
# client.attack_protection.brute_force_protection.get
|
|
26
|
+
#
|
|
24
27
|
# @return [Auth0::Types::GetBruteForceSettingsResponseContent]
|
|
25
28
|
def get(request_options: {}, **_params)
|
|
26
29
|
request = Auth0::Internal::JSON::Request.new(
|
|
@@ -36,7 +39,7 @@ module Auth0
|
|
|
36
39
|
end
|
|
37
40
|
code = response.code.to_i
|
|
38
41
|
if code.between?(200, 299)
|
|
39
|
-
Auth0::Types::GetBruteForceSettingsResponseContent.load(response.body)
|
|
42
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetBruteForceSettingsResponseContent.load(response.body))
|
|
40
43
|
else
|
|
41
44
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
42
45
|
raise error_class.new(response.body, code: code)
|
|
@@ -53,6 +56,9 @@ module Auth0
|
|
|
53
56
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
54
57
|
# @option request_options [Integer] :timeout_in_seconds
|
|
55
58
|
#
|
|
59
|
+
# @example
|
|
60
|
+
# client.attack_protection.brute_force_protection.update
|
|
61
|
+
#
|
|
56
62
|
# @return [Auth0::Types::UpdateBruteForceSettingsResponseContent]
|
|
57
63
|
def update(request_options: {}, **params)
|
|
58
64
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -70,7 +76,7 @@ module Auth0
|
|
|
70
76
|
end
|
|
71
77
|
code = response.code.to_i
|
|
72
78
|
if code.between?(200, 299)
|
|
73
|
-
Auth0::Types::UpdateBruteForceSettingsResponseContent.load(response.body)
|
|
79
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::UpdateBruteForceSettingsResponseContent.load(response.body))
|
|
74
80
|
else
|
|
75
81
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
76
82
|
raise error_class.new(response.body, code: code)
|
|
@@ -21,6 +21,9 @@ module Auth0
|
|
|
21
21
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
22
22
|
# @option request_options [Integer] :timeout_in_seconds
|
|
23
23
|
#
|
|
24
|
+
# @example
|
|
25
|
+
# client.attack_protection.captcha.get
|
|
26
|
+
#
|
|
24
27
|
# @return [Auth0::Types::GetAttackProtectionCaptchaResponseContent]
|
|
25
28
|
def get(request_options: {}, **_params)
|
|
26
29
|
request = Auth0::Internal::JSON::Request.new(
|
|
@@ -36,7 +39,7 @@ module Auth0
|
|
|
36
39
|
end
|
|
37
40
|
code = response.code.to_i
|
|
38
41
|
if code.between?(200, 299)
|
|
39
|
-
Auth0::Types::GetAttackProtectionCaptchaResponseContent.load(response.body)
|
|
42
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetAttackProtectionCaptchaResponseContent.load(response.body))
|
|
40
43
|
else
|
|
41
44
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
42
45
|
raise error_class.new(response.body, code: code)
|
|
@@ -53,6 +56,9 @@ module Auth0
|
|
|
53
56
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
54
57
|
# @option request_options [Integer] :timeout_in_seconds
|
|
55
58
|
#
|
|
59
|
+
# @example
|
|
60
|
+
# client.attack_protection.captcha.update
|
|
61
|
+
#
|
|
56
62
|
# @return [Auth0::Types::UpdateAttackProtectionCaptchaResponseContent]
|
|
57
63
|
def update(request_options: {}, **params)
|
|
58
64
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -70,7 +76,7 @@ module Auth0
|
|
|
70
76
|
end
|
|
71
77
|
code = response.code.to_i
|
|
72
78
|
if code.between?(200, 299)
|
|
73
|
-
Auth0::Types::UpdateAttackProtectionCaptchaResponseContent.load(response.body)
|
|
79
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::UpdateAttackProtectionCaptchaResponseContent.load(response.body))
|
|
74
80
|
else
|
|
75
81
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
76
82
|
raise error_class.new(response.body, code: code)
|
|
@@ -21,6 +21,9 @@ module Auth0
|
|
|
21
21
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
22
22
|
# @option request_options [Integer] :timeout_in_seconds
|
|
23
23
|
#
|
|
24
|
+
# @example
|
|
25
|
+
# client.attack_protection.phone_provider_protection.get
|
|
26
|
+
#
|
|
24
27
|
# @return [Auth0::Types::GetPhoneProviderProtectionResponseContent]
|
|
25
28
|
def get(request_options: {}, **_params)
|
|
26
29
|
request = Auth0::Internal::JSON::Request.new(
|
|
@@ -36,7 +39,7 @@ module Auth0
|
|
|
36
39
|
end
|
|
37
40
|
code = response.code.to_i
|
|
38
41
|
if code.between?(200, 299)
|
|
39
|
-
Auth0::Types::GetPhoneProviderProtectionResponseContent.load(response.body)
|
|
42
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetPhoneProviderProtectionResponseContent.load(response.body))
|
|
40
43
|
else
|
|
41
44
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
42
45
|
raise error_class.new(response.body, code: code)
|
|
@@ -53,6 +56,9 @@ module Auth0
|
|
|
53
56
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
54
57
|
# @option request_options [Integer] :timeout_in_seconds
|
|
55
58
|
#
|
|
59
|
+
# @example
|
|
60
|
+
# client.attack_protection.phone_provider_protection.patch(type: "exponential")
|
|
61
|
+
#
|
|
56
62
|
# @return [Auth0::Types::PatchPhoneProviderProtectionResponseContent]
|
|
57
63
|
def patch(request_options: {}, **params)
|
|
58
64
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -70,7 +76,7 @@ module Auth0
|
|
|
70
76
|
end
|
|
71
77
|
code = response.code.to_i
|
|
72
78
|
if code.between?(200, 299)
|
|
73
|
-
Auth0::Types::PatchPhoneProviderProtectionResponseContent.load(response.body)
|
|
79
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::PatchPhoneProviderProtectionResponseContent.load(response.body))
|
|
74
80
|
else
|
|
75
81
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
76
82
|
raise error_class.new(response.body, code: code)
|
|
@@ -21,6 +21,9 @@ module Auth0
|
|
|
21
21
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
22
22
|
# @option request_options [Integer] :timeout_in_seconds
|
|
23
23
|
#
|
|
24
|
+
# @example
|
|
25
|
+
# client.attack_protection.suspicious_ip_throttling.get
|
|
26
|
+
#
|
|
24
27
|
# @return [Auth0::Types::GetSuspiciousIPThrottlingSettingsResponseContent]
|
|
25
28
|
def get(request_options: {}, **_params)
|
|
26
29
|
request = Auth0::Internal::JSON::Request.new(
|
|
@@ -36,7 +39,7 @@ module Auth0
|
|
|
36
39
|
end
|
|
37
40
|
code = response.code.to_i
|
|
38
41
|
if code.between?(200, 299)
|
|
39
|
-
Auth0::Types::GetSuspiciousIPThrottlingSettingsResponseContent.load(response.body)
|
|
42
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetSuspiciousIPThrottlingSettingsResponseContent.load(response.body))
|
|
40
43
|
else
|
|
41
44
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
42
45
|
raise error_class.new(response.body, code: code)
|
|
@@ -53,6 +56,9 @@ module Auth0
|
|
|
53
56
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
54
57
|
# @option request_options [Integer] :timeout_in_seconds
|
|
55
58
|
#
|
|
59
|
+
# @example
|
|
60
|
+
# client.attack_protection.suspicious_ip_throttling.update
|
|
61
|
+
#
|
|
56
62
|
# @return [Auth0::Types::UpdateSuspiciousIPThrottlingSettingsResponseContent]
|
|
57
63
|
def update(request_options: {}, **params)
|
|
58
64
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -70,7 +76,7 @@ module Auth0
|
|
|
70
76
|
end
|
|
71
77
|
code = response.code.to_i
|
|
72
78
|
if code.between?(200, 299)
|
|
73
|
-
Auth0::Types::UpdateSuspiciousIPThrottlingSettingsResponseContent.load(response.body)
|
|
79
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::UpdateSuspiciousIPThrottlingSettingsResponseContent.load(response.body))
|
|
74
80
|
else
|
|
75
81
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
76
82
|
raise error_class.new(response.body, code: code)
|
|
@@ -20,6 +20,9 @@ module Auth0
|
|
|
20
20
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
21
21
|
# @option request_options [Integer] :timeout_in_seconds
|
|
22
22
|
#
|
|
23
|
+
# @example
|
|
24
|
+
# client.branding.get
|
|
25
|
+
#
|
|
23
26
|
# @return [Auth0::Types::GetBrandingResponseContent]
|
|
24
27
|
def get(request_options: {}, **_params)
|
|
25
28
|
request = Auth0::Internal::JSON::Request.new(
|
|
@@ -35,7 +38,7 @@ module Auth0
|
|
|
35
38
|
end
|
|
36
39
|
code = response.code.to_i
|
|
37
40
|
if code.between?(200, 299)
|
|
38
|
-
Auth0::Types::GetBrandingResponseContent.load(response.body)
|
|
41
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetBrandingResponseContent.load(response.body))
|
|
39
42
|
else
|
|
40
43
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
41
44
|
raise error_class.new(response.body, code: code)
|
|
@@ -52,6 +55,9 @@ module Auth0
|
|
|
52
55
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
53
56
|
# @option request_options [Integer] :timeout_in_seconds
|
|
54
57
|
#
|
|
58
|
+
# @example
|
|
59
|
+
# client.branding.update
|
|
60
|
+
#
|
|
55
61
|
# @return [Auth0::Types::UpdateBrandingResponseContent]
|
|
56
62
|
def update(request_options: {}, **params)
|
|
57
63
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -69,7 +75,7 @@ module Auth0
|
|
|
69
75
|
end
|
|
70
76
|
code = response.code.to_i
|
|
71
77
|
if code.between?(200, 299)
|
|
72
|
-
Auth0::Types::UpdateBrandingResponseContent.load(response.body)
|
|
78
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::UpdateBrandingResponseContent.load(response.body))
|
|
73
79
|
else
|
|
74
80
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
75
81
|
raise error_class.new(response.body, code: code)
|
|
@@ -25,6 +25,9 @@ module Auth0
|
|
|
25
25
|
# @option request_options [Integer] :timeout_in_seconds
|
|
26
26
|
# @option params [Boolean, nil] :disabled
|
|
27
27
|
#
|
|
28
|
+
# @example
|
|
29
|
+
# client.branding.phone.providers.list(disabled: true)
|
|
30
|
+
#
|
|
28
31
|
# @return [Auth0::Types::ListBrandingPhoneProvidersResponseContent]
|
|
29
32
|
def list(request_options: {}, **params)
|
|
30
33
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -45,7 +48,7 @@ module Auth0
|
|
|
45
48
|
end
|
|
46
49
|
code = response.code.to_i
|
|
47
50
|
if code.between?(200, 299)
|
|
48
|
-
Auth0::Types::ListBrandingPhoneProvidersResponseContent.load(response.body)
|
|
51
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::ListBrandingPhoneProvidersResponseContent.load(response.body))
|
|
49
52
|
else
|
|
50
53
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
51
54
|
raise error_class.new(response.body, code: code)
|
|
@@ -65,6 +68,14 @@ module Auth0
|
|
|
65
68
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
66
69
|
# @option request_options [Integer] :timeout_in_seconds
|
|
67
70
|
#
|
|
71
|
+
# @example
|
|
72
|
+
# client.branding.phone.providers.create(
|
|
73
|
+
# name: "twilio",
|
|
74
|
+
# credentials: {
|
|
75
|
+
# auth_token: "auth_token"
|
|
76
|
+
# }
|
|
77
|
+
# )
|
|
78
|
+
#
|
|
68
79
|
# @return [Auth0::Types::CreateBrandingPhoneProviderResponseContent]
|
|
69
80
|
def create(request_options: {}, **params)
|
|
70
81
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -82,7 +93,7 @@ module Auth0
|
|
|
82
93
|
end
|
|
83
94
|
code = response.code.to_i
|
|
84
95
|
if code.between?(200, 299)
|
|
85
|
-
Auth0::Types::CreateBrandingPhoneProviderResponseContent.load(response.body)
|
|
96
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::CreateBrandingPhoneProviderResponseContent.load(response.body))
|
|
86
97
|
else
|
|
87
98
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
88
99
|
raise error_class.new(response.body, code: code)
|
|
@@ -102,6 +113,9 @@ module Auth0
|
|
|
102
113
|
# @option request_options [Integer] :timeout_in_seconds
|
|
103
114
|
# @option params [String] :id
|
|
104
115
|
#
|
|
116
|
+
# @example
|
|
117
|
+
# client.branding.phone.providers.get(id: "id")
|
|
118
|
+
#
|
|
105
119
|
# @return [Auth0::Types::GetBrandingPhoneProviderResponseContent]
|
|
106
120
|
def get(request_options: {}, **params)
|
|
107
121
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -118,7 +132,7 @@ module Auth0
|
|
|
118
132
|
end
|
|
119
133
|
code = response.code.to_i
|
|
120
134
|
if code.between?(200, 299)
|
|
121
|
-
Auth0::Types::GetBrandingPhoneProviderResponseContent.load(response.body)
|
|
135
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetBrandingPhoneProviderResponseContent.load(response.body))
|
|
122
136
|
else
|
|
123
137
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
124
138
|
raise error_class.new(response.body, code: code)
|
|
@@ -136,6 +150,9 @@ module Auth0
|
|
|
136
150
|
# @option request_options [Integer] :timeout_in_seconds
|
|
137
151
|
# @option params [String] :id
|
|
138
152
|
#
|
|
153
|
+
# @example
|
|
154
|
+
# client.branding.phone.providers.delete(id: "id")
|
|
155
|
+
#
|
|
139
156
|
# @return [untyped]
|
|
140
157
|
def delete(request_options: {}, **params)
|
|
141
158
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -171,6 +188,9 @@ module Auth0
|
|
|
171
188
|
# @option request_options [Integer] :timeout_in_seconds
|
|
172
189
|
# @option params [String] :id
|
|
173
190
|
#
|
|
191
|
+
# @example
|
|
192
|
+
# client.branding.phone.providers.update(id: "id")
|
|
193
|
+
#
|
|
174
194
|
# @return [Auth0::Types::UpdateBrandingPhoneProviderResponseContent]
|
|
175
195
|
def update(request_options: {}, **params)
|
|
176
196
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -192,7 +212,7 @@ module Auth0
|
|
|
192
212
|
end
|
|
193
213
|
code = response.code.to_i
|
|
194
214
|
if code.between?(200, 299)
|
|
195
|
-
Auth0::Types::UpdateBrandingPhoneProviderResponseContent.load(response.body)
|
|
215
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::UpdateBrandingPhoneProviderResponseContent.load(response.body))
|
|
196
216
|
else
|
|
197
217
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
198
218
|
raise error_class.new(response.body, code: code)
|
|
@@ -208,6 +228,12 @@ module Auth0
|
|
|
208
228
|
# @option request_options [Integer] :timeout_in_seconds
|
|
209
229
|
# @option params [String] :id
|
|
210
230
|
#
|
|
231
|
+
# @example
|
|
232
|
+
# client.branding.phone.providers.test(
|
|
233
|
+
# id: "id",
|
|
234
|
+
# to: "to"
|
|
235
|
+
# )
|
|
236
|
+
#
|
|
211
237
|
# @return [Auth0::Types::CreatePhoneProviderSendTestResponseContent]
|
|
212
238
|
def test(request_options: {}, **params)
|
|
213
239
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -229,7 +255,7 @@ module Auth0
|
|
|
229
255
|
end
|
|
230
256
|
code = response.code.to_i
|
|
231
257
|
if code.between?(200, 299)
|
|
232
|
-
Auth0::Types::CreatePhoneProviderSendTestResponseContent.load(response.body)
|
|
258
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::CreatePhoneProviderSendTestResponseContent.load(response.body))
|
|
233
259
|
else
|
|
234
260
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
235
261
|
raise error_class.new(response.body, code: code)
|
|
@@ -21,6 +21,9 @@ module Auth0
|
|
|
21
21
|
# @option request_options [Integer] :timeout_in_seconds
|
|
22
22
|
# @option params [Boolean, nil] :disabled
|
|
23
23
|
#
|
|
24
|
+
# @example
|
|
25
|
+
# client.branding.phone.templates.list(disabled: true)
|
|
26
|
+
#
|
|
24
27
|
# @return [Auth0::Types::ListPhoneTemplatesResponseContent]
|
|
25
28
|
def list(request_options: {}, **params)
|
|
26
29
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -41,7 +44,7 @@ module Auth0
|
|
|
41
44
|
end
|
|
42
45
|
code = response.code.to_i
|
|
43
46
|
if code.between?(200, 299)
|
|
44
|
-
Auth0::Types::ListPhoneTemplatesResponseContent.load(response.body)
|
|
47
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::ListPhoneTemplatesResponseContent.load(response.body))
|
|
45
48
|
else
|
|
46
49
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
47
50
|
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.branding.phone.templates.create
|
|
64
|
+
#
|
|
59
65
|
# @return [Auth0::Types::CreatePhoneTemplateResponseContent]
|
|
60
66
|
def create(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::CreatePhoneTemplateResponseContent.load(response.body)
|
|
82
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::CreatePhoneTemplateResponseContent.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)
|
|
@@ -89,6 +95,9 @@ module Auth0
|
|
|
89
95
|
# @option request_options [Integer] :timeout_in_seconds
|
|
90
96
|
# @option params [String] :id
|
|
91
97
|
#
|
|
98
|
+
# @example
|
|
99
|
+
# client.branding.phone.templates.get(id: "id")
|
|
100
|
+
#
|
|
92
101
|
# @return [Auth0::Types::GetPhoneTemplateResponseContent]
|
|
93
102
|
def get(request_options: {}, **params)
|
|
94
103
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -105,7 +114,7 @@ module Auth0
|
|
|
105
114
|
end
|
|
106
115
|
code = response.code.to_i
|
|
107
116
|
if code.between?(200, 299)
|
|
108
|
-
Auth0::Types::GetPhoneTemplateResponseContent.load(response.body)
|
|
117
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetPhoneTemplateResponseContent.load(response.body))
|
|
109
118
|
else
|
|
110
119
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
111
120
|
raise error_class.new(response.body, code: code)
|
|
@@ -121,6 +130,9 @@ module Auth0
|
|
|
121
130
|
# @option request_options [Integer] :timeout_in_seconds
|
|
122
131
|
# @option params [String] :id
|
|
123
132
|
#
|
|
133
|
+
# @example
|
|
134
|
+
# client.branding.phone.templates.delete(id: "id")
|
|
135
|
+
#
|
|
124
136
|
# @return [untyped]
|
|
125
137
|
def delete(request_options: {}, **params)
|
|
126
138
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -151,6 +163,9 @@ module Auth0
|
|
|
151
163
|
# @option request_options [Integer] :timeout_in_seconds
|
|
152
164
|
# @option params [String] :id
|
|
153
165
|
#
|
|
166
|
+
# @example
|
|
167
|
+
# client.branding.phone.templates.update(id: "id")
|
|
168
|
+
#
|
|
154
169
|
# @return [Auth0::Types::UpdatePhoneTemplateResponseContent]
|
|
155
170
|
def update(request_options: {}, **params)
|
|
156
171
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -172,7 +187,7 @@ module Auth0
|
|
|
172
187
|
end
|
|
173
188
|
code = response.code.to_i
|
|
174
189
|
if code.between?(200, 299)
|
|
175
|
-
Auth0::Types::UpdatePhoneTemplateResponseContent.load(response.body)
|
|
190
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::UpdatePhoneTemplateResponseContent.load(response.body))
|
|
176
191
|
else
|
|
177
192
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
178
193
|
raise error_class.new(response.body, code: code)
|
|
@@ -188,14 +203,25 @@ module Auth0
|
|
|
188
203
|
# @option request_options [Integer] :timeout_in_seconds
|
|
189
204
|
# @option params [String] :id
|
|
190
205
|
#
|
|
206
|
+
# @example
|
|
207
|
+
# client.branding.phone.templates.reset(
|
|
208
|
+
# id: "id",
|
|
209
|
+
# request: {
|
|
210
|
+
# key: "value"
|
|
211
|
+
# }
|
|
212
|
+
# )
|
|
213
|
+
#
|
|
191
214
|
# @return [Auth0::Types::ResetPhoneTemplateResponseContent]
|
|
192
215
|
def reset(request_options: {}, **params)
|
|
193
216
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
217
|
+
path_param_names = %i[id]
|
|
218
|
+
body_params = params.except(*path_param_names)
|
|
219
|
+
|
|
194
220
|
request = Auth0::Internal::JSON::Request.new(
|
|
195
221
|
base_url: request_options[:base_url],
|
|
196
222
|
method: "PATCH",
|
|
197
223
|
path: "branding/phone/templates/#{URI.encode_uri_component(params[:id].to_s)}/reset",
|
|
198
|
-
body:
|
|
224
|
+
body: body_params,
|
|
199
225
|
request_options: request_options
|
|
200
226
|
)
|
|
201
227
|
begin
|
|
@@ -205,7 +231,7 @@ module Auth0
|
|
|
205
231
|
end
|
|
206
232
|
code = response.code.to_i
|
|
207
233
|
if code.between?(200, 299)
|
|
208
|
-
Auth0::Types::ResetPhoneTemplateResponseContent.load(response.body)
|
|
234
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::ResetPhoneTemplateResponseContent.load(response.body))
|
|
209
235
|
else
|
|
210
236
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
211
237
|
raise error_class.new(response.body, code: code)
|
|
@@ -221,6 +247,12 @@ module Auth0
|
|
|
221
247
|
# @option request_options [Integer] :timeout_in_seconds
|
|
222
248
|
# @option params [String] :id
|
|
223
249
|
#
|
|
250
|
+
# @example
|
|
251
|
+
# client.branding.phone.templates.test(
|
|
252
|
+
# id: "id",
|
|
253
|
+
# to: "to"
|
|
254
|
+
# )
|
|
255
|
+
#
|
|
224
256
|
# @return [Auth0::Types::CreatePhoneTemplateTestNotificationResponseContent]
|
|
225
257
|
def test(request_options: {}, **params)
|
|
226
258
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -242,7 +274,7 @@ module Auth0
|
|
|
242
274
|
end
|
|
243
275
|
code = response.code.to_i
|
|
244
276
|
if code.between?(200, 299)
|
|
245
|
-
Auth0::Types::CreatePhoneTemplateTestNotificationResponseContent.load(response.body)
|
|
277
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::CreatePhoneTemplateTestNotificationResponseContent.load(response.body))
|
|
246
278
|
else
|
|
247
279
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
248
280
|
raise error_class.new(response.body, code: code)
|