auth0 6.2.0 → 6.4.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 +6 -5
- data/.fern/replay.lock +13 -1
- data/.version +1 -1
- data/CHANGELOG.md +13 -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 +4 -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 +29 -0
- data/lib/auth0/experimentation/experiments/client.rb +367 -0
- data/lib/auth0/experimentation/experiments/types/advance_ramp_request_content.rb +15 -0
- data/lib/auth0/experimentation/experiments/types/create_experiment_request_content.rb +27 -0
- data/lib/auth0/experimentation/experiments/types/list_experiments_request_parameters.rb +21 -0
- data/lib/auth0/experimentation/experiments/types/update_experiment_request_parameters.rb +25 -0
- data/lib/auth0/experimentation/experiments/types/update_experiment_status_request_content.rb +15 -0
- data/lib/auth0/experimentation/feature_flags/client.rb +280 -0
- data/lib/auth0/experimentation/feature_flags/types/create_feature_flag_request_content.rb +17 -0
- data/lib/auth0/experimentation/feature_flags/types/list_feature_flags_request_parameters.rb +19 -0
- data/lib/auth0/experimentation/feature_flags/types/update_feature_flag_request_content.rb +19 -0
- data/lib/auth0/experimentation/feature_flags/types/update_feature_flag_status_request_content.rb +15 -0
- data/lib/auth0/experimentation/feature_flags/variations/client.rb +230 -0
- data/lib/auth0/experimentation/feature_flags/variations/types/create_variation_request_content.rb +21 -0
- data/lib/auth0/experimentation/feature_flags/variations/types/update_variation_request_content.rb +23 -0
- data/lib/auth0/experimentation/segments/client.rb +228 -0
- data/lib/auth0/experimentation/segments/types/create_segment_request_content.rb +17 -0
- data/lib/auth0/experimentation/segments/types/list_segments_request_parameters.rb +17 -0
- data/lib/auth0/experimentation/segments/types/update_segment_request_content.rb +19 -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 -10
- 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/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 +6 -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 +6 -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/allocation_item.rb +27 -0
- data/lib/auth0/types/allocation_request_item.rb +19 -0
- data/lib/auth0/types/{connection_deletion_behavior_enum.rb → allocation_strategy_enum.rb} +3 -3
- data/lib/auth0/types/anonymous_sessions.rb +10 -0
- data/lib/auth0/types/async_approval_notifications_channels_enum.rb +1 -0
- data/lib/auth0/types/authentication_flow_enum.rb +16 -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/client_oidc_backchannel_logout_initiators_enum.rb +1 -0
- data/lib/auth0/types/client_oidc_support_allowed_scopes_enum.rb +14 -0
- data/lib/auth0/types/client_oidc_support_post.rb +15 -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_experiment_response_content.rb +45 -0
- data/lib/auth0/types/create_feature_flag_parameters.rb +23 -0
- data/lib/auth0/types/create_feature_flag_response_content.rb +23 -0
- data/lib/auth0/types/create_organization_all_connection_response_content.rb +2 -0
- data/lib/auth0/types/create_resource_server_response_content.rb +6 -0
- data/lib/auth0/types/create_segment_response_content.rb +21 -0
- data/lib/auth0/types/create_variation_response_content.rb +21 -0
- data/lib/auth0/types/{organization_deletion_behavior_enum.rb → default_config_enum.rb} +3 -3
- data/lib/auth0/types/experiment_list_item.rb +45 -0
- data/lib/auth0/types/experiment_status_enum.rb +15 -0
- data/lib/auth0/types/experiment_transition_status_enum.rb +14 -0
- data/lib/auth0/types/experiment_validation_error.rb +11 -0
- data/lib/auth0/types/feature_flag.rb +23 -0
- data/lib/auth0/types/feature_flag_config_param.rb +13 -0
- data/lib/auth0/types/feature_flag_config_param_type_enum.rb +15 -0
- data/lib/auth0/types/feature_flag_config_params.rb +23 -0
- data/lib/auth0/types/feature_flag_status_enum.rb +13 -0
- data/lib/auth0/types/feature_flag_type_enum.rb +12 -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_experiment_response_content.rb +45 -0
- data/lib/auth0/types/get_feature_flag_response_content.rb +23 -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 +6 -0
- data/lib/auth0/types/get_segment_response_content.rb +21 -0
- data/lib/auth0/types/get_tenant_settings_response_content.rb +2 -0
- data/lib/auth0/types/get_variation_response_content.rb +21 -0
- data/lib/auth0/types/list_experiments_response_content.rb +11 -0
- data/lib/auth0/types/list_feature_flags_response_content.rb +11 -0
- data/lib/auth0/types/list_segments_response_content.rb +11 -0
- data/lib/auth0/types/list_variations_response_content.rb +9 -0
- data/lib/auth0/types/oauth_scope.rb +4 -3
- 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 +6 -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 +55 -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/segment.rb +21 -0
- data/lib/auth0/types/segment_contains_expression.rb +9 -0
- data/lib/auth0/types/segment_ends_with_expression.rb +9 -0
- data/lib/auth0/types/segment_exists_expression.rb +9 -0
- data/lib/auth0/types/segment_match_conditions.rb +30 -0
- data/lib/auth0/types/segment_match_expression.rb +19 -0
- data/lib/auth0/types/segment_not_match_conditions.rb +30 -0
- data/lib/auth0/types/segment_rule.rb +11 -0
- data/lib/auth0/types/segment_starts_with_expression.rb +9 -0
- data/lib/auth0/types/segment_type_enum.rb +12 -0
- data/lib/auth0/types/segment_type_filter_enum.rb +12 -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_experiment_response_content.rb +45 -0
- data/lib/auth0/types/update_experiment_status_response_content.rb +45 -0
- data/lib/auth0/types/update_feature_flag_parameters.rb +23 -0
- data/lib/auth0/types/update_feature_flag_response_content.rb +23 -0
- data/lib/auth0/types/update_feature_flag_status_response_content.rb +23 -0
- data/lib/auth0/types/update_organization_all_connection_response_content.rb +2 -0
- data/lib/auth0/types/update_resource_server_response_content.rb +6 -0
- data/lib/auth0/types/update_segment_response_content.rb +21 -0
- data/lib/auth0/types/update_tenant_settings_response_content.rb +2 -0
- data/lib/auth0/types/update_variation_overrides_map.rb +23 -0
- data/lib/auth0/types/update_variation_response_content.rb +21 -0
- data/lib/auth0/types/validate_experiment_response_content.rb +11 -0
- data/lib/auth0/types/variation.rb +21 -0
- data/lib/auth0/types/variation_overrides_map.rb +23 -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 +75 -23
- 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 +107 -18
- data/wiremock/wiremock-mappings.json +1246 -366
- metadata +108 -19
- 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/organizations/organization_template/client.rb +0 -117
- data/lib/auth0/types/list_organization_templates_paginated_response_content.rb +0 -11
- data/lib/auth0/types/organization_template.rb +0 -39
- data/lib/auth0/types/organization_template_allowed_strategy_enum.rb +0 -17
- data/lib/auth0/types/organization_template_assigned_organization.rb +0 -10
- data/lib/auth0/types/organization_template_role_visibility_enum.rb +0 -13
- data/lib/auth0/types/organization_template_role_visibility_override.rb +0 -12
- data/lib/auth0/types/organization_template_role_visibility_policy.rb +0 -12
- data/lib/auth0/types/organization_template_use_for_organization_discovery.rb +0 -12
|
@@ -20,6 +20,12 @@ module Auth0
|
|
|
20
20
|
# @option params [String, nil] :from
|
|
21
21
|
# @option params [Integer, nil] :take
|
|
22
22
|
#
|
|
23
|
+
# @example
|
|
24
|
+
# client.event_streams.list(
|
|
25
|
+
# from: "from",
|
|
26
|
+
# take: 1
|
|
27
|
+
# )
|
|
28
|
+
#
|
|
23
29
|
# @return [Auth0::Types::ListEventStreamsResponseContent]
|
|
24
30
|
def list(request_options: {}, **params)
|
|
25
31
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -47,7 +53,7 @@ module Auth0
|
|
|
47
53
|
end
|
|
48
54
|
code = response.code.to_i
|
|
49
55
|
if code.between?(200, 299)
|
|
50
|
-
parsed_response = Auth0::Types::ListEventStreamsResponseContent.load(response.body)
|
|
56
|
+
parsed_response = (response.body.to_s.empty? ? nil : Auth0::Types::ListEventStreamsResponseContent.load(response.body))
|
|
51
57
|
[parsed_response, response]
|
|
52
58
|
else
|
|
53
59
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
@@ -64,6 +70,18 @@ module Auth0
|
|
|
64
70
|
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
65
71
|
# @option request_options [Integer] :timeout_in_seconds
|
|
66
72
|
#
|
|
73
|
+
# @example
|
|
74
|
+
# client.event_streams.create(destination: {
|
|
75
|
+
# type: "webhook",
|
|
76
|
+
# configuration: {
|
|
77
|
+
# webhook_endpoint: "webhook_endpoint",
|
|
78
|
+
# webhook_authorization: {
|
|
79
|
+
# method_: "basic",
|
|
80
|
+
# username: "username"
|
|
81
|
+
# }
|
|
82
|
+
# }
|
|
83
|
+
# })
|
|
84
|
+
#
|
|
67
85
|
# @return [Auth0::Types::CreateEventStreamResponseContent]
|
|
68
86
|
def create(request_options: {}, **params)
|
|
69
87
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -81,7 +99,7 @@ module Auth0
|
|
|
81
99
|
end
|
|
82
100
|
code = response.code.to_i
|
|
83
101
|
if code.between?(200, 299)
|
|
84
|
-
Auth0::Types::CreateEventStreamResponseContent.load(response.body)
|
|
102
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::CreateEventStreamResponseContent.load(response.body))
|
|
85
103
|
else
|
|
86
104
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
87
105
|
raise error_class.new(response.body, code: code)
|
|
@@ -97,6 +115,9 @@ module Auth0
|
|
|
97
115
|
# @option request_options [Integer] :timeout_in_seconds
|
|
98
116
|
# @option params [String] :id
|
|
99
117
|
#
|
|
118
|
+
# @example
|
|
119
|
+
# client.event_streams.get(id: "id")
|
|
120
|
+
#
|
|
100
121
|
# @return [Auth0::Types::GetEventStreamResponseContent]
|
|
101
122
|
def get(request_options: {}, **params)
|
|
102
123
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -113,7 +134,7 @@ module Auth0
|
|
|
113
134
|
end
|
|
114
135
|
code = response.code.to_i
|
|
115
136
|
if code.between?(200, 299)
|
|
116
|
-
Auth0::Types::GetEventStreamResponseContent.load(response.body)
|
|
137
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetEventStreamResponseContent.load(response.body))
|
|
117
138
|
else
|
|
118
139
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
119
140
|
raise error_class.new(response.body, code: code)
|
|
@@ -129,6 +150,9 @@ module Auth0
|
|
|
129
150
|
# @option request_options [Integer] :timeout_in_seconds
|
|
130
151
|
# @option params [String] :id
|
|
131
152
|
#
|
|
153
|
+
# @example
|
|
154
|
+
# client.event_streams.delete(id: "id")
|
|
155
|
+
#
|
|
132
156
|
# @return [untyped]
|
|
133
157
|
def delete(request_options: {}, **params)
|
|
134
158
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -159,6 +183,9 @@ module Auth0
|
|
|
159
183
|
# @option request_options [Integer] :timeout_in_seconds
|
|
160
184
|
# @option params [String] :id
|
|
161
185
|
#
|
|
186
|
+
# @example
|
|
187
|
+
# client.event_streams.update(id: "id")
|
|
188
|
+
#
|
|
162
189
|
# @return [Auth0::Types::UpdateEventStreamResponseContent]
|
|
163
190
|
def update(request_options: {}, **params)
|
|
164
191
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -180,7 +207,7 @@ module Auth0
|
|
|
180
207
|
end
|
|
181
208
|
code = response.code.to_i
|
|
182
209
|
if code.between?(200, 299)
|
|
183
|
-
Auth0::Types::UpdateEventStreamResponseContent.load(response.body)
|
|
210
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::UpdateEventStreamResponseContent.load(response.body))
|
|
184
211
|
else
|
|
185
212
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
186
213
|
raise error_class.new(response.body, code: code)
|
|
@@ -196,6 +223,12 @@ module Auth0
|
|
|
196
223
|
# @option request_options [Integer] :timeout_in_seconds
|
|
197
224
|
# @option params [String] :id
|
|
198
225
|
#
|
|
226
|
+
# @example
|
|
227
|
+
# client.event_streams.test(
|
|
228
|
+
# id: "id",
|
|
229
|
+
# event_type: "connection.created"
|
|
230
|
+
# )
|
|
231
|
+
#
|
|
199
232
|
# @return [Auth0::Types::CreateEventStreamTestEventResponseContent]
|
|
200
233
|
def test(request_options: {}, **params)
|
|
201
234
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -217,7 +250,7 @@ module Auth0
|
|
|
217
250
|
end
|
|
218
251
|
code = response.code.to_i
|
|
219
252
|
if code.between?(200, 299)
|
|
220
|
-
Auth0::Types::CreateEventStreamTestEventResponseContent.load(response.body)
|
|
253
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::CreateEventStreamTestEventResponseContent.load(response.body))
|
|
221
254
|
else
|
|
222
255
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
223
256
|
raise error_class.new(response.body, code: code)
|
|
@@ -26,6 +26,17 @@ module Auth0
|
|
|
26
26
|
# @option params [String, nil] :from
|
|
27
27
|
# @option params [Integer, nil] :take
|
|
28
28
|
#
|
|
29
|
+
# @example
|
|
30
|
+
# client.event_streams.deliveries.list(
|
|
31
|
+
# id: "id",
|
|
32
|
+
# statuses: "statuses",
|
|
33
|
+
# event_types: "event_types",
|
|
34
|
+
# date_from: "date_from",
|
|
35
|
+
# date_to: "date_to",
|
|
36
|
+
# from: "from",
|
|
37
|
+
# take: 1
|
|
38
|
+
# )
|
|
39
|
+
#
|
|
29
40
|
# @return [Auth0::Types::ListEventStreamDeliveriesResponseContent]
|
|
30
41
|
def list(request_options: {}, **params)
|
|
31
42
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -57,7 +68,7 @@ module Auth0
|
|
|
57
68
|
end
|
|
58
69
|
code = response.code.to_i
|
|
59
70
|
if code.between?(200, 299)
|
|
60
|
-
parsed_response = Auth0::Types::ListEventStreamDeliveriesResponseContent.load(response.body)
|
|
71
|
+
parsed_response = (response.body.to_s.empty? ? nil : Auth0::Types::ListEventStreamDeliveriesResponseContent.load(response.body))
|
|
61
72
|
[parsed_response, response]
|
|
62
73
|
else
|
|
63
74
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
@@ -76,6 +87,12 @@ module Auth0
|
|
|
76
87
|
# @option params [String] :id
|
|
77
88
|
# @option params [String] :event_id
|
|
78
89
|
#
|
|
90
|
+
# @example
|
|
91
|
+
# client.event_streams.deliveries.get_history(
|
|
92
|
+
# id: "id",
|
|
93
|
+
# event_id: "event_id"
|
|
94
|
+
# )
|
|
95
|
+
#
|
|
79
96
|
# @return [Auth0::Types::GetEventStreamDeliveryHistoryResponseContent]
|
|
80
97
|
def get_history(request_options: {}, **params)
|
|
81
98
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -92,7 +109,7 @@ module Auth0
|
|
|
92
109
|
end
|
|
93
110
|
code = response.code.to_i
|
|
94
111
|
if code.between?(200, 299)
|
|
95
|
-
Auth0::Types::GetEventStreamDeliveryHistoryResponseContent.load(response.body)
|
|
112
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetEventStreamDeliveryHistoryResponseContent.load(response.body))
|
|
96
113
|
else
|
|
97
114
|
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
98
115
|
raise error_class.new(response.body, code: code)
|
|
@@ -20,6 +20,9 @@ module Auth0
|
|
|
20
20
|
# @option request_options [Integer] :timeout_in_seconds
|
|
21
21
|
# @option params [String] :id
|
|
22
22
|
#
|
|
23
|
+
# @example
|
|
24
|
+
# client.event_streams.redeliveries.create(id: "id")
|
|
25
|
+
#
|
|
23
26
|
# @return [Auth0::Types::CreateEventStreamRedeliveryResponseContent]
|
|
24
27
|
def create(request_options: {}, **params)
|
|
25
28
|
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::CreateEventStreamRedeliveryResponseContent.load(response.body)
|
|
47
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::CreateEventStreamRedeliveryResponseContent.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)
|
|
@@ -58,6 +61,12 @@ module Auth0
|
|
|
58
61
|
# @option params [String] :id
|
|
59
62
|
# @option params [String] :event_id
|
|
60
63
|
#
|
|
64
|
+
# @example
|
|
65
|
+
# client.event_streams.redeliveries.create_by_id(
|
|
66
|
+
# id: "id",
|
|
67
|
+
# event_id: "event_id"
|
|
68
|
+
# )
|
|
69
|
+
#
|
|
61
70
|
# @return [untyped]
|
|
62
71
|
def create_by_id(request_options: {}, **params)
|
|
63
72
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
data/lib/auth0/events/client.rb
CHANGED
|
@@ -23,6 +23,13 @@ module Auth0
|
|
|
23
23
|
# @option params [String, nil] :from_timestamp
|
|
24
24
|
# @option params [Auth0::Types::EventStreamSubscribeEventsEventTypeEnum, nil] :event_type
|
|
25
25
|
#
|
|
26
|
+
# @example
|
|
27
|
+
# client.events.subscribe(
|
|
28
|
+
# from: "from",
|
|
29
|
+
# from_timestamp: "from_timestamp",
|
|
30
|
+
# event_type: ["connection.created"]
|
|
31
|
+
# )
|
|
32
|
+
#
|
|
26
33
|
# @return [untyped]
|
|
27
34
|
def subscribe(request_options: {}, **params)
|
|
28
35
|
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Auth0
|
|
4
|
+
module Experimentation
|
|
5
|
+
class Client
|
|
6
|
+
# @param client [Auth0::Internal::Http::RawClient]
|
|
7
|
+
#
|
|
8
|
+
# @return [void]
|
|
9
|
+
def initialize(client:)
|
|
10
|
+
@client = client
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# @return [Auth0::Experiments::Client]
|
|
14
|
+
def experiments
|
|
15
|
+
@experiments ||= Auth0::Experimentation::Experiments::Client.new(client: @client)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# @return [Auth0::FeatureFlags::Client]
|
|
19
|
+
def feature_flags
|
|
20
|
+
@feature_flags ||= Auth0::Experimentation::FeatureFlags::Client.new(client: @client)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# @return [Auth0::Segments::Client]
|
|
24
|
+
def segments
|
|
25
|
+
@segments ||= Auth0::Experimentation::Segments::Client.new(client: @client)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Auth0
|
|
4
|
+
module Experimentation
|
|
5
|
+
module Experiments
|
|
6
|
+
class Client
|
|
7
|
+
# @param client [Auth0::Internal::Http::RawClient]
|
|
8
|
+
#
|
|
9
|
+
# @return [void]
|
|
10
|
+
def initialize(client:)
|
|
11
|
+
@client = client
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Retrieve a paginated list of experiments for the tenant, with optional filters.
|
|
15
|
+
#
|
|
16
|
+
# @param request_options [Hash]
|
|
17
|
+
# @param params [Hash]
|
|
18
|
+
# @option request_options [String] :base_url
|
|
19
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
20
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
21
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
22
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
23
|
+
# @option params [String, nil] :from
|
|
24
|
+
# @option params [Integer, nil] :take
|
|
25
|
+
# @option params [Auth0::Types::ExperimentStatusEnum, nil] :status
|
|
26
|
+
# @option params [String, nil] :authentication_flow
|
|
27
|
+
# @option params [String, nil] :feature_flag_id
|
|
28
|
+
#
|
|
29
|
+
# @example
|
|
30
|
+
# client.experimentation.experiments.list(
|
|
31
|
+
# from: "from",
|
|
32
|
+
# take: 1,
|
|
33
|
+
# status: "draft",
|
|
34
|
+
# authentication_flow: "authentication_flow",
|
|
35
|
+
# feature_flag_id: "feature_flag_id"
|
|
36
|
+
# )
|
|
37
|
+
#
|
|
38
|
+
# @return [Auth0::Types::ListExperimentsResponseContent]
|
|
39
|
+
def list(request_options: {}, **params)
|
|
40
|
+
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
41
|
+
query_params = {}
|
|
42
|
+
query_params["from"] = params[:from] if params.key?(:from)
|
|
43
|
+
query_params["take"] = params.fetch(:take, 50)
|
|
44
|
+
query_params["status"] = params[:status] if params.key?(:status)
|
|
45
|
+
query_params["authentication_flow"] = params[:authentication_flow] if params.key?(:authentication_flow)
|
|
46
|
+
query_params["feature_flag_id"] = params[:feature_flag_id] if params.key?(:feature_flag_id)
|
|
47
|
+
|
|
48
|
+
Auth0::Internal::CursorItemIterator.new(
|
|
49
|
+
cursor_field: :next_,
|
|
50
|
+
item_field: :experiments,
|
|
51
|
+
initial_cursor: query_params["from"]
|
|
52
|
+
) do |next_cursor|
|
|
53
|
+
query_params["from"] = next_cursor
|
|
54
|
+
request = Auth0::Internal::JSON::Request.new(
|
|
55
|
+
base_url: request_options[:base_url],
|
|
56
|
+
method: "GET",
|
|
57
|
+
path: "experimentation/experiments",
|
|
58
|
+
query: query_params,
|
|
59
|
+
request_options: request_options
|
|
60
|
+
)
|
|
61
|
+
begin
|
|
62
|
+
response = @client.send(request)
|
|
63
|
+
rescue Net::HTTPRequestTimeout
|
|
64
|
+
raise Auth0::Errors::TimeoutError
|
|
65
|
+
end
|
|
66
|
+
code = response.code.to_i
|
|
67
|
+
if code.between?(200, 299)
|
|
68
|
+
parsed_response = (response.body.to_s.empty? ? nil : Auth0::Types::ListExperimentsResponseContent.load(response.body))
|
|
69
|
+
[parsed_response, response]
|
|
70
|
+
else
|
|
71
|
+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
72
|
+
raise error_class.new(response.body, code: code)
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Create a new experiment for A/B testing.
|
|
78
|
+
#
|
|
79
|
+
# @param request_options [Hash]
|
|
80
|
+
# @param params [Auth0::Experimentation::Experiments::Types::CreateExperimentRequestContent]
|
|
81
|
+
# @option request_options [String] :base_url
|
|
82
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
83
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
84
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
85
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
86
|
+
#
|
|
87
|
+
# @example
|
|
88
|
+
# client.experimentation.experiments.create(
|
|
89
|
+
# name: "name",
|
|
90
|
+
# feature_flag_id: "feature_flag_id",
|
|
91
|
+
# authentication_flow: "authentication"
|
|
92
|
+
# )
|
|
93
|
+
#
|
|
94
|
+
# @return [Auth0::Types::CreateExperimentResponseContent]
|
|
95
|
+
def create(request_options: {}, **params)
|
|
96
|
+
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
97
|
+
request = Auth0::Internal::JSON::Request.new(
|
|
98
|
+
base_url: request_options[:base_url],
|
|
99
|
+
method: "POST",
|
|
100
|
+
path: "experimentation/experiments",
|
|
101
|
+
body: Auth0::Experimentation::Experiments::Types::CreateExperimentRequestContent.new(params).to_h,
|
|
102
|
+
request_options: request_options
|
|
103
|
+
)
|
|
104
|
+
begin
|
|
105
|
+
response = @client.send(request)
|
|
106
|
+
rescue Net::HTTPRequestTimeout
|
|
107
|
+
raise Auth0::Errors::TimeoutError
|
|
108
|
+
end
|
|
109
|
+
code = response.code.to_i
|
|
110
|
+
if code.between?(200, 299)
|
|
111
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::CreateExperimentResponseContent.load(response.body))
|
|
112
|
+
else
|
|
113
|
+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
114
|
+
raise error_class.new(response.body, code: code)
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Retrieve a single experiment with its allocations by ID.
|
|
119
|
+
#
|
|
120
|
+
# @param request_options [Hash]
|
|
121
|
+
# @param params [Hash]
|
|
122
|
+
# @option request_options [String] :base_url
|
|
123
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
124
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
125
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
126
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
127
|
+
# @option params [String] :id
|
|
128
|
+
#
|
|
129
|
+
# @example
|
|
130
|
+
# client.experimentation.experiments.get(id: "id")
|
|
131
|
+
#
|
|
132
|
+
# @return [Auth0::Types::GetExperimentResponseContent]
|
|
133
|
+
def get(request_options: {}, **params)
|
|
134
|
+
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
135
|
+
request = Auth0::Internal::JSON::Request.new(
|
|
136
|
+
base_url: request_options[:base_url],
|
|
137
|
+
method: "GET",
|
|
138
|
+
path: "experimentation/experiments/#{URI.encode_uri_component(params[:id].to_s)}",
|
|
139
|
+
request_options: request_options
|
|
140
|
+
)
|
|
141
|
+
begin
|
|
142
|
+
response = @client.send(request)
|
|
143
|
+
rescue Net::HTTPRequestTimeout
|
|
144
|
+
raise Auth0::Errors::TimeoutError
|
|
145
|
+
end
|
|
146
|
+
code = response.code.to_i
|
|
147
|
+
if code.between?(200, 299)
|
|
148
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::GetExperimentResponseContent.load(response.body))
|
|
149
|
+
else
|
|
150
|
+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
151
|
+
raise error_class.new(response.body, code: code)
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Permanently delete an experiment and its allocations by ID. Active experiments cannot be deleted; pause or
|
|
156
|
+
# complete first. Idempotent: returns 204 even if the experiment does not exist.
|
|
157
|
+
#
|
|
158
|
+
# @param request_options [Hash]
|
|
159
|
+
# @param params [Hash]
|
|
160
|
+
# @option request_options [String] :base_url
|
|
161
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
162
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
163
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
164
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
165
|
+
# @option params [String] :id
|
|
166
|
+
#
|
|
167
|
+
# @example
|
|
168
|
+
# client.experimentation.experiments.delete(id: "id")
|
|
169
|
+
#
|
|
170
|
+
# @return [untyped]
|
|
171
|
+
def delete(request_options: {}, **params)
|
|
172
|
+
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
173
|
+
request = Auth0::Internal::JSON::Request.new(
|
|
174
|
+
base_url: request_options[:base_url],
|
|
175
|
+
method: "DELETE",
|
|
176
|
+
path: "experimentation/experiments/#{URI.encode_uri_component(params[:id].to_s)}",
|
|
177
|
+
request_options: request_options
|
|
178
|
+
)
|
|
179
|
+
begin
|
|
180
|
+
response = @client.send(request)
|
|
181
|
+
rescue Net::HTTPRequestTimeout
|
|
182
|
+
raise Auth0::Errors::TimeoutError
|
|
183
|
+
end
|
|
184
|
+
code = response.code.to_i
|
|
185
|
+
return if code.between?(200, 299)
|
|
186
|
+
|
|
187
|
+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
188
|
+
raise error_class.new(response.body, code: code)
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Partially update an experiment by ID. Only provided fields are updated. Providing allocations replaces the
|
|
192
|
+
# entire allocations set.
|
|
193
|
+
#
|
|
194
|
+
# @param request_options [Hash]
|
|
195
|
+
# @param params [Auth0::Experimentation::Experiments::Types::UpdateExperimentRequestParameters]
|
|
196
|
+
# @option request_options [String] :base_url
|
|
197
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
198
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
199
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
200
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
201
|
+
# @option params [String] :id
|
|
202
|
+
#
|
|
203
|
+
# @example
|
|
204
|
+
# client.experimentation.experiments.update(id: "id")
|
|
205
|
+
#
|
|
206
|
+
# @return [Auth0::Types::UpdateExperimentResponseContent]
|
|
207
|
+
def update(request_options: {}, **params)
|
|
208
|
+
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
209
|
+
request_data = Auth0::Experimentation::Experiments::Types::UpdateExperimentRequestParameters.new(params).to_h
|
|
210
|
+
non_body_param_names = %w[id]
|
|
211
|
+
body = request_data.except(*non_body_param_names)
|
|
212
|
+
|
|
213
|
+
request = Auth0::Internal::JSON::Request.new(
|
|
214
|
+
base_url: request_options[:base_url],
|
|
215
|
+
method: "PATCH",
|
|
216
|
+
path: "experimentation/experiments/#{URI.encode_uri_component(params[:id].to_s)}",
|
|
217
|
+
body: body,
|
|
218
|
+
request_options: request_options
|
|
219
|
+
)
|
|
220
|
+
begin
|
|
221
|
+
response = @client.send(request)
|
|
222
|
+
rescue Net::HTTPRequestTimeout
|
|
223
|
+
raise Auth0::Errors::TimeoutError
|
|
224
|
+
end
|
|
225
|
+
code = response.code.to_i
|
|
226
|
+
if code.between?(200, 299)
|
|
227
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::UpdateExperimentResponseContent.load(response.body))
|
|
228
|
+
else
|
|
229
|
+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
230
|
+
raise error_class.new(response.body, code: code)
|
|
231
|
+
end
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Increments the current ramp index to the requested target level. Up-only: the target must be the immediate
|
|
235
|
+
# next level in the schedule. Idempotent: calling with the current level returns success without writing
|
|
236
|
+
# anything.
|
|
237
|
+
#
|
|
238
|
+
# @param request_options [Hash]
|
|
239
|
+
# @param params [Auth0::Experimentation::Experiments::Types::AdvanceRampRequestContent]
|
|
240
|
+
# @option request_options [String] :base_url
|
|
241
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
242
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
243
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
244
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
245
|
+
# @option params [String] :id
|
|
246
|
+
#
|
|
247
|
+
# @example
|
|
248
|
+
# client.experimentation.experiments.advance_ramp(
|
|
249
|
+
# id: "id",
|
|
250
|
+
# target_level: 1
|
|
251
|
+
# )
|
|
252
|
+
#
|
|
253
|
+
# @return [Auth0::Types::AdvanceRampResponseContent]
|
|
254
|
+
def advance_ramp(request_options: {}, **params)
|
|
255
|
+
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
256
|
+
request_data = Auth0::Experimentation::Experiments::Types::AdvanceRampRequestContent.new(params).to_h
|
|
257
|
+
non_body_param_names = %w[id]
|
|
258
|
+
body = request_data.except(*non_body_param_names)
|
|
259
|
+
|
|
260
|
+
request = Auth0::Internal::JSON::Request.new(
|
|
261
|
+
base_url: request_options[:base_url],
|
|
262
|
+
method: "POST",
|
|
263
|
+
path: "experimentation/experiments/#{URI.encode_uri_component(params[:id].to_s)}/advance-ramp",
|
|
264
|
+
body: body,
|
|
265
|
+
request_options: request_options
|
|
266
|
+
)
|
|
267
|
+
begin
|
|
268
|
+
response = @client.send(request)
|
|
269
|
+
rescue Net::HTTPRequestTimeout
|
|
270
|
+
raise Auth0::Errors::TimeoutError
|
|
271
|
+
end
|
|
272
|
+
code = response.code.to_i
|
|
273
|
+
if code.between?(200, 299)
|
|
274
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::AdvanceRampResponseContent.load(response.body))
|
|
275
|
+
else
|
|
276
|
+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
277
|
+
raise error_class.new(response.body, code: code)
|
|
278
|
+
end
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
# Transitions an experiment through its lifecycle: draft → active, active → paused, paused → active,
|
|
282
|
+
# active/paused → completed. Activation runs full readiness validation.
|
|
283
|
+
#
|
|
284
|
+
# @param request_options [Hash]
|
|
285
|
+
# @param params [Auth0::Experimentation::Experiments::Types::UpdateExperimentStatusRequestContent]
|
|
286
|
+
# @option request_options [String] :base_url
|
|
287
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
288
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
289
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
290
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
291
|
+
# @option params [String] :id
|
|
292
|
+
#
|
|
293
|
+
# @example
|
|
294
|
+
# client.experimentation.experiments.update_status(
|
|
295
|
+
# id: "id",
|
|
296
|
+
# status: "active"
|
|
297
|
+
# )
|
|
298
|
+
#
|
|
299
|
+
# @return [Auth0::Types::UpdateExperimentStatusResponseContent]
|
|
300
|
+
def update_status(request_options: {}, **params)
|
|
301
|
+
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
302
|
+
request_data = Auth0::Experimentation::Experiments::Types::UpdateExperimentStatusRequestContent.new(params).to_h
|
|
303
|
+
non_body_param_names = %w[id]
|
|
304
|
+
body = request_data.except(*non_body_param_names)
|
|
305
|
+
|
|
306
|
+
request = Auth0::Internal::JSON::Request.new(
|
|
307
|
+
base_url: request_options[:base_url],
|
|
308
|
+
method: "POST",
|
|
309
|
+
path: "experimentation/experiments/#{URI.encode_uri_component(params[:id].to_s)}/status",
|
|
310
|
+
body: body,
|
|
311
|
+
request_options: request_options
|
|
312
|
+
)
|
|
313
|
+
begin
|
|
314
|
+
response = @client.send(request)
|
|
315
|
+
rescue Net::HTTPRequestTimeout
|
|
316
|
+
raise Auth0::Errors::TimeoutError
|
|
317
|
+
end
|
|
318
|
+
code = response.code.to_i
|
|
319
|
+
if code.between?(200, 299)
|
|
320
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::UpdateExperimentStatusResponseContent.load(response.body))
|
|
321
|
+
else
|
|
322
|
+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
323
|
+
raise error_class.new(response.body, code: code)
|
|
324
|
+
end
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
# Checks whether an experiment is ready to be activated. Returns is_valid boolean and an errors array describing
|
|
328
|
+
# any blockers. Read-only; no state is modified.
|
|
329
|
+
#
|
|
330
|
+
# @param request_options [Hash]
|
|
331
|
+
# @param params [Hash]
|
|
332
|
+
# @option request_options [String] :base_url
|
|
333
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
334
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
335
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
336
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
337
|
+
# @option params [String] :id
|
|
338
|
+
#
|
|
339
|
+
# @example
|
|
340
|
+
# client.experimentation.experiments.validate(id: "id")
|
|
341
|
+
#
|
|
342
|
+
# @return [Auth0::Types::ValidateExperimentResponseContent]
|
|
343
|
+
def validate(request_options: {}, **params)
|
|
344
|
+
params = Auth0::Internal::Types::Utils.normalize_keys(params)
|
|
345
|
+
request = Auth0::Internal::JSON::Request.new(
|
|
346
|
+
base_url: request_options[:base_url],
|
|
347
|
+
method: "POST",
|
|
348
|
+
path: "experimentation/experiments/#{URI.encode_uri_component(params[:id].to_s)}/validate",
|
|
349
|
+
request_options: request_options
|
|
350
|
+
)
|
|
351
|
+
begin
|
|
352
|
+
response = @client.send(request)
|
|
353
|
+
rescue Net::HTTPRequestTimeout
|
|
354
|
+
raise Auth0::Errors::TimeoutError
|
|
355
|
+
end
|
|
356
|
+
code = response.code.to_i
|
|
357
|
+
if code.between?(200, 299)
|
|
358
|
+
(response.body.to_s.empty? ? nil : Auth0::Types::ValidateExperimentResponseContent.load(response.body))
|
|
359
|
+
else
|
|
360
|
+
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
|
|
361
|
+
raise error_class.new(response.body, code: code)
|
|
362
|
+
end
|
|
363
|
+
end
|
|
364
|
+
end
|
|
365
|
+
end
|
|
366
|
+
end
|
|
367
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Auth0
|
|
4
|
+
module Experimentation
|
|
5
|
+
module Experiments
|
|
6
|
+
module Types
|
|
7
|
+
class AdvanceRampRequestContent < Internal::Types::Model
|
|
8
|
+
field :id, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :target_level, -> { Integer }, optional: false, nullable: false
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Auth0
|
|
4
|
+
module Experimentation
|
|
5
|
+
module Experiments
|
|
6
|
+
module Types
|
|
7
|
+
class CreateExperimentRequestContent < Internal::Types::Model
|
|
8
|
+
field :name, -> { String }, optional: false, nullable: false
|
|
9
|
+
|
|
10
|
+
field :description, -> { String }, optional: true, nullable: false
|
|
11
|
+
|
|
12
|
+
field :feature_flag_id, -> { String }, optional: false, nullable: false
|
|
13
|
+
|
|
14
|
+
field :authentication_flow, -> { Auth0::Types::AuthenticationFlowEnum }, optional: false, nullable: false
|
|
15
|
+
|
|
16
|
+
field :default_config, -> { Auth0::Types::DefaultConfigEnum }, optional: true, nullable: false
|
|
17
|
+
|
|
18
|
+
field :allocation_strategy, -> { Auth0::Types::AllocationStrategyEnum }, optional: true, nullable: false
|
|
19
|
+
|
|
20
|
+
field :allocations, -> { Internal::Types::Array[Auth0::Types::AllocationRequestItem] }, optional: true, nullable: false
|
|
21
|
+
|
|
22
|
+
field :levels, -> { Internal::Types::Array[Integer] }, optional: true, nullable: false
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Auth0
|
|
4
|
+
module Experimentation
|
|
5
|
+
module Experiments
|
|
6
|
+
module Types
|
|
7
|
+
class ListExperimentsRequestParameters < Internal::Types::Model
|
|
8
|
+
field :from, -> { String }, optional: true, nullable: false
|
|
9
|
+
|
|
10
|
+
field :take, -> { Integer }, optional: true, nullable: false
|
|
11
|
+
|
|
12
|
+
field :status, -> { Auth0::Types::ExperimentStatusEnum }, optional: true, nullable: false
|
|
13
|
+
|
|
14
|
+
field :authentication_flow, -> { String }, optional: true, nullable: false
|
|
15
|
+
|
|
16
|
+
field :feature_flag_id, -> { String }, optional: true, nullable: false
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|