From 1e604e8a11db076eb591b329d86479f939eaf14c Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 29 Sep 2026 05:46:32 +0000 Subject: [PATCH 1/3] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-ruby-sdk: 1.24.1 --- .fern/metadata.json | 9 +- lib/auth0.rb | 77 +- lib/auth0/client.rb | 28 +- .../types/create_client_request_content.rb | 2 + lib/auth0/experimentation/client.rb | 10 + .../experimentation/experiments/client.rb | 304 ++++++ .../create_experiment_request_content.rb | 27 + .../list_experiments_request_parameters.rb | 21 + .../update_experiment_request_parameters.rb | 25 + ...pdate_experiment_status_request_content.rb | 15 + .../experimentation/feature_flags/client.rb | 280 +++++ .../create_feature_flag_request_content.rb | 17 + .../list_feature_flags_request_parameters.rb | 19 + .../update_feature_flag_request_content.rb | 19 + ...ate_feature_flag_status_request_content.rb | 15 + .../feature_flags/variations/client.rb | 230 ++++ .../types/create_variation_request_content.rb | 21 + .../types/update_variation_request_content.rb | 23 + lib/auth0/experimentation/segments/client.rb | 228 ++++ .../types/create_segment_request_content.rb | 17 + .../types/list_segments_request_parameters.rb | 17 + .../types/update_segment_request_content.rb | 19 + lib/auth0/organizations/client.rb | 5 - .../organization_template/client.rb | 132 --- .../create_resource_server_request_content.rb | 2 + .../update_resource_server_request_content.rb | 2 + lib/auth0/types/allocation_item.rb | 27 + lib/auth0/types/allocation_request_item.rb | 19 + ...or_enum.rb => allocation_strategy_enum.rb} | 6 +- ...nc_approval_notifications_channels_enum.rb | 1 + lib/auth0/types/authentication_flow_enum.rb | 16 + ...oidc_backchannel_logout_initiators_enum.rb | 1 + ...client_oidc_support_allowed_scopes_enum.rb | 14 + lib/auth0/types/client_oidc_support_post.rb | 15 + .../create_experiment_response_content.rb | 45 + .../types/create_feature_flag_parameters.rb | 23 + .../create_feature_flag_response_content.rb | 23 + ...create_resource_server_response_content.rb | 2 + .../types/create_segment_response_content.rb | 21 + .../create_variation_response_content.rb | 21 + ...ehavior_enum.rb => default_config_enum.rb} | 6 +- lib/auth0/types/experiment_list_item.rb | 45 + lib/auth0/types/experiment_status_enum.rb | 15 + .../experiment_transition_status_enum.rb | 14 + .../types/experiment_validation_error.rb | 11 + lib/auth0/types/feature_flag.rb | 23 + lib/auth0/types/feature_flag_config_param.rb | 13 + .../feature_flag_config_param_type_enum.rb | 15 + lib/auth0/types/feature_flag_config_params.rb | 23 + lib/auth0/types/feature_flag_status_enum.rb | 13 + lib/auth0/types/feature_flag_type_enum.rb | 12 + .../types/get_experiment_response_content.rb | 45 + .../get_feature_flag_response_content.rb | 23 + .../get_resource_server_response_content.rb | 2 + .../types/get_segment_response_content.rb | 21 + .../types/get_variation_response_content.rb | 21 + .../list_experiments_response_content.rb | 11 + .../list_feature_flags_response_content.rb | 11 + .../types/list_segments_response_content.rb | 11 + .../types/list_variations_response_content.rb | 9 + lib/auth0/types/oauth_scope.rb | 4 +- lib/auth0/types/organization_template.rb | 39 - ...nization_template_allowed_strategy_enum.rb | 17 - ...anization_template_role_visibility_enum.rb | 13 - ...ation_template_role_visibility_override.rb | 12 - ...ization_template_role_visibility_policy.rb | 12 - ...template_use_for_organization_discovery.rb | 12 - lib/auth0/types/resource_server.rb | 2 + .../types/resource_server_search_response.rb | 2 + lib/auth0/types/segment.rb | 21 + .../types/segment_contains_expression.rb | 9 + .../types/segment_ends_with_expression.rb | 9 + lib/auth0/types/segment_exists_expression.rb | 9 + lib/auth0/types/segment_match_conditions.rb | 30 + lib/auth0/types/segment_match_expression.rb | 19 + .../types/segment_not_match_conditions.rb | 30 + lib/auth0/types/segment_rule.rb | 11 + .../types/segment_starts_with_expression.rb | 9 + lib/auth0/types/segment_type_enum.rb | 12 + lib/auth0/types/segment_type_filter_enum.rb | 12 + .../update_experiment_response_content.rb | 45 + ...date_experiment_status_response_content.rb | 45 + .../types/update_feature_flag_parameters.rb | 23 + .../update_feature_flag_response_content.rb | 23 + ...te_feature_flag_status_response_content.rb | 23 + ...update_resource_server_response_content.rb | 2 + .../types/update_segment_response_content.rb | 21 + .../types/update_variation_overrides_map.rb | 23 + .../update_variation_response_content.rb | 21 + .../validate_experiment_response_content.rb | 11 + lib/auth0/types/variation.rb | 21 + lib/auth0/types/variation_overrides_map.rb | 23 + lib/auth0/users/client.rb | 41 +- test/wire/experimentation_experiments_test.rb | 155 +++ .../experimentation_feature_flags_test.rb | 146 +++ ...mentation_feature_flags_variations_test.rb | 126 +++ test/wire/experimentation_segments_test.rb | 123 +++ ...rganizations_organization_template_test.rb | 79 -- wiremock/wiremock-mappings.json | 984 +++++++++++++++--- 99 files changed, 3867 insertions(+), 494 deletions(-) create mode 100644 lib/auth0/experimentation/experiments/types/create_experiment_request_content.rb create mode 100644 lib/auth0/experimentation/experiments/types/list_experiments_request_parameters.rb create mode 100644 lib/auth0/experimentation/experiments/types/update_experiment_request_parameters.rb create mode 100644 lib/auth0/experimentation/experiments/types/update_experiment_status_request_content.rb create mode 100644 lib/auth0/experimentation/feature_flags/client.rb create mode 100644 lib/auth0/experimentation/feature_flags/types/create_feature_flag_request_content.rb create mode 100644 lib/auth0/experimentation/feature_flags/types/list_feature_flags_request_parameters.rb create mode 100644 lib/auth0/experimentation/feature_flags/types/update_feature_flag_request_content.rb create mode 100644 lib/auth0/experimentation/feature_flags/types/update_feature_flag_status_request_content.rb create mode 100644 lib/auth0/experimentation/feature_flags/variations/client.rb create mode 100644 lib/auth0/experimentation/feature_flags/variations/types/create_variation_request_content.rb create mode 100644 lib/auth0/experimentation/feature_flags/variations/types/update_variation_request_content.rb create mode 100644 lib/auth0/experimentation/segments/client.rb create mode 100644 lib/auth0/experimentation/segments/types/create_segment_request_content.rb create mode 100644 lib/auth0/experimentation/segments/types/list_segments_request_parameters.rb create mode 100644 lib/auth0/experimentation/segments/types/update_segment_request_content.rb delete mode 100644 lib/auth0/organizations/organization_template/client.rb create mode 100644 lib/auth0/types/allocation_item.rb create mode 100644 lib/auth0/types/allocation_request_item.rb rename lib/auth0/types/{connection_deletion_behavior_enum.rb => allocation_strategy_enum.rb} (53%) create mode 100644 lib/auth0/types/authentication_flow_enum.rb create mode 100644 lib/auth0/types/client_oidc_support_allowed_scopes_enum.rb create mode 100644 lib/auth0/types/client_oidc_support_post.rb create mode 100644 lib/auth0/types/create_experiment_response_content.rb create mode 100644 lib/auth0/types/create_feature_flag_parameters.rb create mode 100644 lib/auth0/types/create_feature_flag_response_content.rb create mode 100644 lib/auth0/types/create_segment_response_content.rb create mode 100644 lib/auth0/types/create_variation_response_content.rb rename lib/auth0/types/{organization_deletion_behavior_enum.rb => default_config_enum.rb} (53%) create mode 100644 lib/auth0/types/experiment_list_item.rb create mode 100644 lib/auth0/types/experiment_status_enum.rb create mode 100644 lib/auth0/types/experiment_transition_status_enum.rb create mode 100644 lib/auth0/types/experiment_validation_error.rb create mode 100644 lib/auth0/types/feature_flag.rb create mode 100644 lib/auth0/types/feature_flag_config_param.rb create mode 100644 lib/auth0/types/feature_flag_config_param_type_enum.rb create mode 100644 lib/auth0/types/feature_flag_config_params.rb create mode 100644 lib/auth0/types/feature_flag_status_enum.rb create mode 100644 lib/auth0/types/feature_flag_type_enum.rb create mode 100644 lib/auth0/types/get_experiment_response_content.rb create mode 100644 lib/auth0/types/get_feature_flag_response_content.rb create mode 100644 lib/auth0/types/get_segment_response_content.rb create mode 100644 lib/auth0/types/get_variation_response_content.rb create mode 100644 lib/auth0/types/list_experiments_response_content.rb create mode 100644 lib/auth0/types/list_feature_flags_response_content.rb create mode 100644 lib/auth0/types/list_segments_response_content.rb create mode 100644 lib/auth0/types/list_variations_response_content.rb delete mode 100644 lib/auth0/types/organization_template.rb delete mode 100644 lib/auth0/types/organization_template_allowed_strategy_enum.rb delete mode 100644 lib/auth0/types/organization_template_role_visibility_enum.rb delete mode 100644 lib/auth0/types/organization_template_role_visibility_override.rb delete mode 100644 lib/auth0/types/organization_template_role_visibility_policy.rb delete mode 100644 lib/auth0/types/organization_template_use_for_organization_discovery.rb create mode 100644 lib/auth0/types/segment.rb create mode 100644 lib/auth0/types/segment_contains_expression.rb create mode 100644 lib/auth0/types/segment_ends_with_expression.rb create mode 100644 lib/auth0/types/segment_exists_expression.rb create mode 100644 lib/auth0/types/segment_match_conditions.rb create mode 100644 lib/auth0/types/segment_match_expression.rb create mode 100644 lib/auth0/types/segment_not_match_conditions.rb create mode 100644 lib/auth0/types/segment_rule.rb create mode 100644 lib/auth0/types/segment_starts_with_expression.rb create mode 100644 lib/auth0/types/segment_type_enum.rb create mode 100644 lib/auth0/types/segment_type_filter_enum.rb create mode 100644 lib/auth0/types/update_experiment_response_content.rb create mode 100644 lib/auth0/types/update_experiment_status_response_content.rb create mode 100644 lib/auth0/types/update_feature_flag_parameters.rb create mode 100644 lib/auth0/types/update_feature_flag_response_content.rb create mode 100644 lib/auth0/types/update_feature_flag_status_response_content.rb create mode 100644 lib/auth0/types/update_segment_response_content.rb create mode 100644 lib/auth0/types/update_variation_overrides_map.rb create mode 100644 lib/auth0/types/update_variation_response_content.rb create mode 100644 lib/auth0/types/validate_experiment_response_content.rb create mode 100644 lib/auth0/types/variation.rb create mode 100644 lib/auth0/types/variation_overrides_map.rb create mode 100644 test/wire/experimentation_feature_flags_test.rb create mode 100644 test/wire/experimentation_feature_flags_variations_test.rb create mode 100644 test/wire/experimentation_segments_test.rb delete mode 100644 test/wire/organizations_organization_template_test.rb diff --git a/.fern/metadata.json b/.fern/metadata.json index de53e112b..65385325e 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -10,8 +10,9 @@ "offsetSemantics": "page-index", "useDefaultRequestParameterValues": true }, - "originGitCommit": "147c530f85f27d4dbbec076dde0bcd7a4b17ed5c", - "originGitCommitIsDirty": true, - "invokedBy": "manual", - "sdkVersion": "6.2.1" + "originGitCommit": "d0c167e92ed941d977b98e76601bd970b0e5ecea", + "originGitCommitIsDirty": false, + "invokedBy": "ci", + "ciProvider": "github", + "sdkVersion": "6.3.1" } \ No newline at end of file diff --git a/lib/auth0.rb b/lib/auth0.rb index 8ade10b9e..b02e178cc 100644 --- a/lib/auth0.rb +++ b/lib/auth0.rb @@ -134,6 +134,9 @@ require_relative "auth0/types/advance_ramp_response_content" require_relative "auth0/types/agent_metadata" require_relative "auth0/types/agent_response_content" +require_relative "auth0/types/allocation_item" +require_relative "auth0/types/allocation_request_item" +require_relative "auth0/types/allocation_strategy_enum" require_relative "auth0/types/anomaly_ip_format" require_relative "auth0/types/anonymous_sessions" require_relative "auth0/types/app_metadata" @@ -155,6 +158,7 @@ require_relative "auth0/types/attack_protection_update_captcha_hcaptcha" require_relative "auth0/types/attack_protection_update_captcha_recaptcha_enterprise" require_relative "auth0/types/attack_protection_update_captcha_recaptcha_v2" +require_relative "auth0/types/authentication_flow_enum" require_relative "auth0/types/authentication_method_type_enum" require_relative "auth0/types/authentication_type_enum" require_relative "auth0/types/b2b_integration_configuration_integration_type_enum" @@ -346,6 +350,8 @@ require_relative "auth0/types/client_grant_response_content" require_relative "auth0/types/client_my_organization_patch_configuration" require_relative "auth0/types/client_my_organization_post_configuration" +require_relative "auth0/types/client_oidc_support_allowed_scopes_enum" +require_relative "auth0/types/client_oidc_support_post" require_relative "auth0/types/client_organization_require_behavior_patch_enum" require_relative "auth0/types/client_organization_usage_patch_enum" require_relative "auth0/types/client_signed_request_object_with_public_key" @@ -470,7 +476,6 @@ require_relative "auth0/types/connection_debug_saml" require_relative "auth0/types/connection_decryption_key_saml_cert" require_relative "auth0/types/connection_decryption_key_saml" -require_relative "auth0/types/connection_deletion_behavior_enum" require_relative "auth0/types/connection_destination_url_saml" require_relative "auth0/types/connection_digest_algorithm_enum_saml" require_relative "auth0/types/connection_digest_algorithm_saml" @@ -1102,9 +1107,19 @@ require_relative "auth0/types/event_stream_delivery_attempt" require_relative "auth0/types/event_stream_delivery_event_type_enum" require_relative "auth0/types/create_event_stream_test_event_response_content" +require_relative "auth0/types/default_config_enum" +require_relative "auth0/types/experiment_status_enum" +require_relative "auth0/types/create_experiment_response_content" require_relative "auth0/types/create_export_users_fields" require_relative "auth0/types/job_file_format_enum" require_relative "auth0/types/create_export_users_response_content" +require_relative "auth0/types/feature_flag_config_param_type_enum" +require_relative "auth0/types/feature_flag_config_param" +require_relative "auth0/types/create_feature_flag_parameters" +require_relative "auth0/types/feature_flag_config_params" +require_relative "auth0/types/feature_flag_status_enum" +require_relative "auth0/types/feature_flag_type_enum" +require_relative "auth0/types/create_feature_flag_response_content" require_relative "auth0/types/flow_action_activecampaign_list_contacts_type" require_relative "auth0/types/flow_action_activecampaign_list_contacts_action" require_relative "auth0/types/flow_action_activecampaign_list_contacts_params" @@ -1847,6 +1862,16 @@ require_relative "auth0/types/create_scim_configuration_request_content" require_relative "auth0/types/create_scim_configuration_response_content" require_relative "auth0/types/create_scim_token_response_content" +require_relative "auth0/types/segment_contains_expression" +require_relative "auth0/types/segment_ends_with_expression" +require_relative "auth0/types/segment_exists_expression" +require_relative "auth0/types/segment_starts_with_expression" +require_relative "auth0/types/segment_match_expression" +require_relative "auth0/types/segment_match_conditions" +require_relative "auth0/types/segment_not_match_conditions" +require_relative "auth0/types/segment_rule" +require_relative "auth0/types/segment_type_enum" +require_relative "auth0/types/create_segment_response_content" require_relative "auth0/types/self_service_profile_allowed_strategy_enum" require_relative "auth0/types/self_service_profile_branding_colors" require_relative "auth0/types/self_service_profile_branding_properties" @@ -1884,6 +1909,8 @@ require_relative "auth0/types/user_identity_schema" require_relative "auth0/types/user_metadata_schema" require_relative "auth0/types/create_user_response_content" +require_relative "auth0/types/variation_overrides_map" +require_relative "auth0/types/create_variation_response_content" require_relative "auth0/types/mdl_presentation_properties" require_relative "auth0/types/mdl_presentation_request_properties" require_relative "auth0/types/mdl_presentation_request" @@ -3222,7 +3249,11 @@ require_relative "auth0/types/event_stream_subscribe_events_event_type_param" require_relative "auth0/types/event_stream_subscribe_events_response_content" require_relative "auth0/types/event_stream_test_event_type_enum" +require_relative "auth0/types/experiment_list_item" +require_relative "auth0/types/experiment_transition_status_enum" +require_relative "auth0/types/experiment_validation_error" require_relative "auth0/types/express_configuration_or_null" +require_relative "auth0/types/feature_flag" require_relative "auth0/types/fed_cm_login_google_patch" require_relative "auth0/types/fed_cm_login_patch" require_relative "auth0/types/flow_execution_debug" @@ -3281,6 +3312,8 @@ require_relative "auth0/types/get_encryption_key_response_content" require_relative "auth0/types/get_event_stream_delivery_history_response_content" require_relative "auth0/types/get_event_stream_response_content" +require_relative "auth0/types/get_experiment_response_content" +require_relative "auth0/types/get_feature_flag_response_content" require_relative "auth0/types/get_flow_execution_request_parameters_hydrate_enum" require_relative "auth0/types/get_flow_execution_response_content" require_relative "auth0/types/get_flow_request_parameters_hydrate_enum" @@ -3370,6 +3403,7 @@ require_relative "auth0/types/get_scim_configuration_response_content" require_relative "auth0/types/scim_token_item" require_relative "auth0/types/get_scim_tokens_response_content" +require_relative "auth0/types/get_segment_response_content" require_relative "auth0/types/get_self_service_profile_response_content" require_relative "auth0/types/session_actor_metadata" require_relative "auth0/types/session_date" @@ -3427,6 +3461,7 @@ require_relative "auth0/types/user_groups_response_schema" require_relative "auth0/types/get_user_groups_paginated_response_content" require_relative "auth0/types/get_user_response_content" +require_relative "auth0/types/get_variation_response_content" require_relative "auth0/types/get_verifiable_credential_template_response_content" require_relative "auth0/types/guardian_enrollment_factor_enum" require_relative "auth0/types/guardian_factor_name_enum" @@ -3460,6 +3495,8 @@ require_relative "auth0/types/list_encryption_key_offset_paginated_response_content" require_relative "auth0/types/list_event_stream_deliveries_response_content" require_relative "auth0/types/list_event_streams_response_content" +require_relative "auth0/types/list_experiments_response_content" +require_relative "auth0/types/list_feature_flags_response_content" require_relative "auth0/types/list_flow_executions_paginated_response_content" require_relative "auth0/types/list_flows_offset_paginated_response_content" require_relative "auth0/types/list_flows_request_parameters_hydrate_enum" @@ -3518,6 +3555,8 @@ require_relative "auth0/types/list_rules_offset_paginated_response_content" require_relative "auth0/types/scim_configuration" require_relative "auth0/types/list_scim_configurations_response_content" +require_relative "auth0/types/segment" +require_relative "auth0/types/list_segments_response_content" require_relative "auth0/types/list_self_service_profile_custom_text_response_content" require_relative "auth0/types/self_service_profile" require_relative "auth0/types/list_self_service_profiles_paginated_response_content" @@ -3555,6 +3594,8 @@ require_relative "auth0/types/list_user_sessions_paginated_response_content" require_relative "auth0/types/user_response_schema" require_relative "auth0/types/list_users_offset_paginated_response_content" +require_relative "auth0/types/variation" +require_relative "auth0/types/list_variations_response_content" require_relative "auth0/types/verifiable_credential_template_response" require_relative "auth0/types/list_verifiable_credential_templates_paginated_response_content" require_relative "auth0/types/log_stream_mixpanel_sink_patch" @@ -3568,15 +3609,8 @@ require_relative "auth0/types/not_found_schema_error" require_relative "auth0/types/not_found_schema" require_relative "auth0/types/organization_access_level_enum_with_null" -require_relative "auth0/types/organization_deletion_behavior_enum" require_relative "auth0/types/organization_member_access_level_enum_with_null" require_relative "auth0/types/organization_sort_field_enum" -require_relative "auth0/types/organization_template_allowed_strategy_enum" -require_relative "auth0/types/organization_template_role_visibility_enum" -require_relative "auth0/types/organization_template_role_visibility_override" -require_relative "auth0/types/organization_template_role_visibility_policy" -require_relative "auth0/types/organization_template_use_for_organization_discovery" -require_relative "auth0/types/organization_template" require_relative "auth0/types/partial_groups_enum" require_relative "auth0/types/partial_phone_template_content" require_relative "auth0/types/patch_client_credential_response_content" @@ -3621,6 +3655,7 @@ require_relative "auth0/types/search_organizations_paginated_response_content" require_relative "auth0/types/search_parser_enum" require_relative "auth0/types/search_resource_servers_response_content" +require_relative "auth0/types/segment_type_filter_enum" require_relative "auth0/types/self_service_profile_branding" require_relative "auth0/types/self_service_profile_custom_text_language_enum" require_relative "auth0/types/self_service_profile_custom_text_page_enum" @@ -3770,6 +3805,11 @@ require_relative "auth0/types/update_enabled_client_connections_request_content_item" require_relative "auth0/types/update_enabled_client_connections_request_content" require_relative "auth0/types/update_event_stream_response_content" +require_relative "auth0/types/update_experiment_response_content" +require_relative "auth0/types/update_experiment_status_response_content" +require_relative "auth0/types/update_feature_flag_parameters" +require_relative "auth0/types/update_feature_flag_response_content" +require_relative "auth0/types/update_feature_flag_status_response_content" require_relative "auth0/types/update_flow_response_content" require_relative "auth0/types/update_flows_vault_connection_response_content" require_relative "auth0/types/update_flows_vault_connection_setup" @@ -3798,6 +3838,7 @@ require_relative "auth0/types/update_role_response_content" require_relative "auth0/types/update_rule_response_content" require_relative "auth0/types/update_scim_configuration_response_content" +require_relative "auth0/types/update_segment_response_content" require_relative "auth0/types/update_self_service_profile_response_content" require_relative "auth0/types/update_session_response_content" require_relative "auth0/types/update_settings_response_content" @@ -3809,6 +3850,8 @@ require_relative "auth0/types/update_user_attribute_profile_response_content" require_relative "auth0/types/update_user_authentication_method_response_content" require_relative "auth0/types/update_user_response_content" +require_relative "auth0/types/update_variation_overrides_map" +require_relative "auth0/types/update_variation_response_content" require_relative "auth0/types/update_verifiable_credential_template_response_content" require_relative "auth0/types/user_attribute_profile_patch_user_id" require_relative "auth0/types/user_enrollment_auth_method_enum" @@ -3817,6 +3860,7 @@ require_relative "auth0/types/user_list_log_offset_paginated_response_content" require_relative "auth0/types/user_multifactor_provider_enum" require_relative "auth0/types/users_enrollment" +require_relative "auth0/types/validate_experiment_response_content" require_relative "auth0/types/verify_custom_domain_response_content" require_relative "auth0/types/verify_email_ticket_response_content" require_relative "auth0/client" @@ -4046,7 +4090,23 @@ require_relative "auth0/event_streams/redeliveries/types/create_event_stream_redelivery_request_content" require_relative "auth0/experimentation/client" require_relative "auth0/experimentation/experiments/client" +require_relative "auth0/experimentation/experiments/types/list_experiments_request_parameters" +require_relative "auth0/experimentation/experiments/types/create_experiment_request_content" +require_relative "auth0/experimentation/experiments/types/update_experiment_request_parameters" require_relative "auth0/experimentation/experiments/types/advance_ramp_request_content" +require_relative "auth0/experimentation/experiments/types/update_experiment_status_request_content" +require_relative "auth0/experimentation/feature_flags/client" +require_relative "auth0/experimentation/feature_flags/types/list_feature_flags_request_parameters" +require_relative "auth0/experimentation/feature_flags/types/create_feature_flag_request_content" +require_relative "auth0/experimentation/feature_flags/types/update_feature_flag_request_content" +require_relative "auth0/experimentation/feature_flags/types/update_feature_flag_status_request_content" +require_relative "auth0/experimentation/segments/client" +require_relative "auth0/experimentation/segments/types/list_segments_request_parameters" +require_relative "auth0/experimentation/segments/types/create_segment_request_content" +require_relative "auth0/experimentation/segments/types/update_segment_request_content" +require_relative "auth0/experimentation/feature_flags/variations/client" +require_relative "auth0/experimentation/feature_flags/variations/types/create_variation_request_content" +require_relative "auth0/experimentation/feature_flags/variations/types/update_variation_request_content" require_relative "auth0/flows/executions/client" require_relative "auth0/flows/executions/types/list_flow_executions_request_parameters" require_relative "auth0/flows/executions/types/get_flow_execution_request_parameters" @@ -4137,7 +4197,6 @@ require_relative "auth0/organizations/members/types/list_organization_members_request_parameters" require_relative "auth0/organizations/members/types/create_organization_member_request_content" require_relative "auth0/organizations/members/types/delete_organization_members_request_content" -require_relative "auth0/organizations/organization_template/client" require_relative "auth0/organizations/groups/client" require_relative "auth0/organizations/groups/types/list_organization_groups_request_parameters" require_relative "auth0/organizations/groups/roles/client" diff --git a/lib/auth0/client.rb b/lib/auth0/client.rb index bf30f8628..cce20f615 100644 --- a/lib/auth0/client.rb +++ b/lib/auth0/client.rb @@ -4,23 +4,27 @@ module Auth0 class Management # @param token [String] # @param base_url [String, nil] - # @param timeout [Float, nil] Request timeout in seconds. - # @param max_retries [Integer, nil] Maximum number of request retries. - # @param headers [Hash, nil] Additional headers to include in requests. + # @param tenant_domain [String, nil] + # @param max_retries [Integer] # # @return [void] - def initialize(token:, base_url: nil, timeout: nil, max_retries: nil, headers: nil) - raw_client_opts = { + def initialize(token:, base_url: nil, tenant_domain: nil, max_retries: 2) + unless tenant_domain.nil? + tenant_domain_value = tenant_domain.nil? ? "{TENANT}.auth0.com" : tenant_domain + environment_url_templates = { + Auth0::Environment::DEFAULT => "https://#{tenant_domain_value}/api/v2" + } + base_url = base_url.nil? ? "https://#{tenant_domain_value}/api/v2" : environment_url_templates.fetch(base_url, base_url) + end + + @raw_client = Auth0::Internal::Http::RawClient.new( base_url: base_url || Auth0::Environment::DEFAULT, headers: { "X-Fern-Language" => "Ruby", Authorization: "Bearer #{token}" - }.merge(headers || {}) - } - raw_client_opts[:timeout] = timeout if timeout - raw_client_opts[:max_retries] = max_retries if max_retries - - @raw_client = Auth0::Internal::Http::RawClient.new(**raw_client_opts) + }, + max_retries: max_retries + ) end # @return [Auth0::Actions::Client] @@ -259,5 +263,3 @@ def verifiable_credentials end end end - -require_relative "auth_client" diff --git a/lib/auth0/clients/types/create_client_request_content.rb b/lib/auth0/clients/types/create_client_request_content.rb index 16897caa4..cdc18a3de 100644 --- a/lib/auth0/clients/types/create_client_request_content.rb +++ b/lib/auth0/clients/types/create_client_request_content.rb @@ -119,6 +119,8 @@ class CreateClientRequestContent < Internal::Types::Model field :my_organization_configuration, -> { Auth0::Types::ClientMyOrganizationPostConfiguration }, optional: true, nullable: false field :async_approval_notification_channels, -> { Internal::Types::Array[Auth0::Types::AsyncApprovalNotificationsChannelsEnum] }, optional: true, nullable: false + + field :oidc_support, -> { Auth0::Types::ClientOidcSupportPost }, optional: true, nullable: false end end end diff --git a/lib/auth0/experimentation/client.rb b/lib/auth0/experimentation/client.rb index 66cc42948..11889d144 100644 --- a/lib/auth0/experimentation/client.rb +++ b/lib/auth0/experimentation/client.rb @@ -14,6 +14,16 @@ def initialize(client:) def experiments @experiments ||= Auth0::Experimentation::Experiments::Client.new(client: @client) end + + # @return [Auth0::FeatureFlags::Client] + def feature_flags + @feature_flags ||= Auth0::Experimentation::FeatureFlags::Client.new(client: @client) + end + + # @return [Auth0::Segments::Client] + def segments + @segments ||= Auth0::Experimentation::Segments::Client.new(client: @client) + end end end end diff --git a/lib/auth0/experimentation/experiments/client.rb b/lib/auth0/experimentation/experiments/client.rb index b25c80210..8df4b4d9d 100644 --- a/lib/auth0/experimentation/experiments/client.rb +++ b/lib/auth0/experimentation/experiments/client.rb @@ -11,6 +11,226 @@ def initialize(client:) @client = client end + # Retrieve a paginated list of experiments for the tenant, with optional filters. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String, nil] :from + # @option params [Integer, nil] :take + # @option params [Auth0::Types::ExperimentStatusEnum, nil] :status + # @option params [String, nil] :authentication_flow + # @option params [String, nil] :feature_flag_id + # + # @example + # client.experimentation.experiments.list( + # from: "from", + # take: 1, + # status: "draft", + # authentication_flow: "authentication_flow", + # feature_flag_id: "feature_flag_id" + # ) + # + # @return [Auth0::Types::ListExperimentsResponseContent] + def list(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + query_params = {} + query_params["from"] = params[:from] if params.key?(:from) + query_params["take"] = params.fetch(:take, 50) + query_params["status"] = params[:status] if params.key?(:status) + query_params["authentication_flow"] = params[:authentication_flow] if params.key?(:authentication_flow) + query_params["feature_flag_id"] = params[:feature_flag_id] if params.key?(:feature_flag_id) + + Auth0::Internal::CursorItemIterator.new( + cursor_field: :next_, + item_field: :experiments, + initial_cursor: query_params["from"] + ) do |next_cursor| + query_params["from"] = next_cursor + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "experimentation/experiments", + query: query_params, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + parsed_response = (response.body.to_s.empty? ? nil : Auth0::Types::ListExperimentsResponseContent.load(response.body)) + [parsed_response, response] + else + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + end + + # Create a new experiment for A/B testing. + # + # @param request_options [Hash] + # @param params [Auth0::Experimentation::Experiments::Types::CreateExperimentRequestContent] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # + # @example + # client.experimentation.experiments.create( + # name: "name", + # feature_flag_id: "feature_flag_id", + # authentication_flow: "authentication" + # ) + # + # @return [Auth0::Types::CreateExperimentResponseContent] + def create(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "POST", + path: "experimentation/experiments", + body: Auth0::Experimentation::Experiments::Types::CreateExperimentRequestContent.new(params).to_h, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Auth0::Types::CreateExperimentResponseContent.load(response.body)) + else + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Retrieve a single experiment with its allocations by ID. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.experimentation.experiments.get(id: "id") + # + # @return [Auth0::Types::GetExperimentResponseContent] + def get(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "experimentation/experiments/#{URI.encode_uri_component(params[:id].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Auth0::Types::GetExperimentResponseContent.load(response.body)) + else + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Permanently delete an experiment and its allocations by ID. Active experiments cannot be deleted; pause or + # complete first. Idempotent: returns 204 even if the experiment does not exist. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.experimentation.experiments.delete(id: "id") + # + # @return [untyped] + def delete(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "DELETE", + path: "experimentation/experiments/#{URI.encode_uri_component(params[:id].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + return if code.between?(200, 299) + + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + + # Partially update an experiment by ID. Only provided fields are updated. Providing allocations replaces the + # entire allocations set. + # + # @param request_options [Hash] + # @param params [Auth0::Experimentation::Experiments::Types::UpdateExperimentRequestParameters] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.experimentation.experiments.update(id: "id") + # + # @return [Auth0::Types::UpdateExperimentResponseContent] + def update(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + request_data = Auth0::Experimentation::Experiments::Types::UpdateExperimentRequestParameters.new(params).to_h + non_body_param_names = %w[id] + body = request_data.except(*non_body_param_names) + + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "PATCH", + path: "experimentation/experiments/#{URI.encode_uri_component(params[:id].to_s)}", + body: body, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Auth0::Types::UpdateExperimentResponseContent.load(response.body)) + else + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + # Increments the current ramp index to the requested target level. Up-only: the target must be the immediate # next level in the schedule. Idempotent: calling with the current level returns success without writing # anything. @@ -57,6 +277,90 @@ def advance_ramp(request_options: {}, **params) raise error_class.new(response.body, code: code) end end + + # Transitions an experiment through its lifecycle: draft → active, active → paused, paused → active, + # active/paused → completed. Activation runs full readiness validation. + # + # @param request_options [Hash] + # @param params [Auth0::Experimentation::Experiments::Types::UpdateExperimentStatusRequestContent] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.experimentation.experiments.update_status( + # id: "id", + # status: "active" + # ) + # + # @return [Auth0::Types::UpdateExperimentStatusResponseContent] + def update_status(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + request_data = Auth0::Experimentation::Experiments::Types::UpdateExperimentStatusRequestContent.new(params).to_h + non_body_param_names = %w[id] + body = request_data.except(*non_body_param_names) + + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "POST", + path: "experimentation/experiments/#{URI.encode_uri_component(params[:id].to_s)}/status", + body: body, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Auth0::Types::UpdateExperimentStatusResponseContent.load(response.body)) + else + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Checks whether an experiment is ready to be activated. Returns is_valid boolean and an errors array describing + # any blockers. Read-only; no state is modified. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.experimentation.experiments.validate(id: "id") + # + # @return [Auth0::Types::ValidateExperimentResponseContent] + def validate(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "POST", + path: "experimentation/experiments/#{URI.encode_uri_component(params[:id].to_s)}/validate", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Auth0::Types::ValidateExperimentResponseContent.load(response.body)) + else + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end end end end diff --git a/lib/auth0/experimentation/experiments/types/create_experiment_request_content.rb b/lib/auth0/experimentation/experiments/types/create_experiment_request_content.rb new file mode 100644 index 000000000..896b20dae --- /dev/null +++ b/lib/auth0/experimentation/experiments/types/create_experiment_request_content.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Auth0 + module Experimentation + module Experiments + module Types + class CreateExperimentRequestContent < Internal::Types::Model + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :feature_flag_id, -> { String }, optional: false, nullable: false + + field :authentication_flow, -> { Auth0::Types::AuthenticationFlowEnum }, optional: false, nullable: false + + field :default_config, -> { Auth0::Types::DefaultConfigEnum }, optional: true, nullable: false + + field :allocation_strategy, -> { Auth0::Types::AllocationStrategyEnum }, optional: true, nullable: false + + field :allocations, -> { Internal::Types::Array[Auth0::Types::AllocationRequestItem] }, optional: true, nullable: false + + field :levels, -> { Internal::Types::Array[Integer] }, optional: true, nullable: false + end + end + end + end +end diff --git a/lib/auth0/experimentation/experiments/types/list_experiments_request_parameters.rb b/lib/auth0/experimentation/experiments/types/list_experiments_request_parameters.rb new file mode 100644 index 000000000..c52b89c99 --- /dev/null +++ b/lib/auth0/experimentation/experiments/types/list_experiments_request_parameters.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Auth0 + module Experimentation + module Experiments + module Types + class ListExperimentsRequestParameters < Internal::Types::Model + field :from, -> { String }, optional: true, nullable: false + + field :take, -> { Integer }, optional: true, nullable: false + + field :status, -> { Auth0::Types::ExperimentStatusEnum }, optional: true, nullable: false + + field :authentication_flow, -> { String }, optional: true, nullable: false + + field :feature_flag_id, -> { String }, optional: true, nullable: false + end + end + end + end +end diff --git a/lib/auth0/experimentation/experiments/types/update_experiment_request_parameters.rb b/lib/auth0/experimentation/experiments/types/update_experiment_request_parameters.rb new file mode 100644 index 000000000..212a1acc4 --- /dev/null +++ b/lib/auth0/experimentation/experiments/types/update_experiment_request_parameters.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +module Auth0 + module Experimentation + module Experiments + module Types + class UpdateExperimentRequestParameters < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: true, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :authentication_flow, -> { Auth0::Types::AuthenticationFlowEnum }, optional: true, nullable: false + + field :allocations, -> { Internal::Types::Array[Auth0::Types::AllocationRequestItem] }, optional: true, nullable: false + + field :default_config, -> { Auth0::Types::DefaultConfigEnum }, optional: true, nullable: false + + field :levels, -> { Internal::Types::Array[Integer] }, optional: true, nullable: false + end + end + end + end +end diff --git a/lib/auth0/experimentation/experiments/types/update_experiment_status_request_content.rb b/lib/auth0/experimentation/experiments/types/update_experiment_status_request_content.rb new file mode 100644 index 000000000..efb1498c3 --- /dev/null +++ b/lib/auth0/experimentation/experiments/types/update_experiment_status_request_content.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Auth0 + module Experimentation + module Experiments + module Types + class UpdateExperimentStatusRequestContent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :status, -> { Auth0::Types::ExperimentTransitionStatusEnum }, optional: false, nullable: false + end + end + end + end +end diff --git a/lib/auth0/experimentation/feature_flags/client.rb b/lib/auth0/experimentation/feature_flags/client.rb new file mode 100644 index 000000000..3350c06cd --- /dev/null +++ b/lib/auth0/experimentation/feature_flags/client.rb @@ -0,0 +1,280 @@ +# frozen_string_literal: true + +module Auth0 + module Experimentation + module FeatureFlags + class Client + # @param client [Auth0::Internal::Http::RawClient] + # + # @return [void] + def initialize(client:) + @client = client + end + + # Retrieve a paginated list of feature flags for the tenant. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String, nil] :from + # @option params [Integer, nil] :take + # @option params [Auth0::Types::FeatureFlagTypeEnum, nil] :type + # @option params [Auth0::Types::FeatureFlagStatusEnum, nil] :status + # + # @example + # client.experimentation.feature_flags.list( + # from: "from", + # take: 1, + # type: "auth0", + # status: "draft" + # ) + # + # @return [Auth0::Types::ListFeatureFlagsResponseContent] + def list(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + query_params = {} + query_params["from"] = params[:from] if params.key?(:from) + query_params["take"] = params.fetch(:take, 50) + query_params["type"] = params[:type] if params.key?(:type) + query_params["status"] = params[:status] if params.key?(:status) + + Auth0::Internal::CursorItemIterator.new( + cursor_field: :next_, + item_field: :feature_flags, + initial_cursor: query_params["from"] + ) do |next_cursor| + query_params["from"] = next_cursor + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "experimentation/feature-flags", + query: query_params, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + parsed_response = (response.body.to_s.empty? ? nil : Auth0::Types::ListFeatureFlagsResponseContent.load(response.body)) + [parsed_response, response] + else + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + end + + # Create a new feature flag with parameters for use in experiments. + # + # @param request_options [Hash] + # @param params [Auth0::Experimentation::FeatureFlags::Types::CreateFeatureFlagRequestContent] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # + # @example + # client.experimentation.feature_flags.create( + # name: "name", + # parameters: {} + # ) + # + # @return [Auth0::Types::CreateFeatureFlagResponseContent] + def create(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "POST", + path: "experimentation/feature-flags", + body: Auth0::Experimentation::FeatureFlags::Types::CreateFeatureFlagRequestContent.new(params).to_h, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Auth0::Types::CreateFeatureFlagResponseContent.load(response.body)) + else + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Retrieve a single feature flag by its ID. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.experimentation.feature_flags.get(id: "id") + # + # @return [Auth0::Types::GetFeatureFlagResponseContent] + def get(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "experimentation/feature-flags/#{URI.encode_uri_component(params[:id].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Auth0::Types::GetFeatureFlagResponseContent.load(response.body)) + else + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Delete a feature flag by ID. Idempotent: returns 204 even if flag does not exist. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.experimentation.feature_flags.delete(id: "id") + # + # @return [untyped] + def delete(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "DELETE", + path: "experimentation/feature-flags/#{URI.encode_uri_component(params[:id].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + return if code.between?(200, 299) + + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + + # Partially update a feature flag by ID. Only provided fields are updated. + # + # @param request_options [Hash] + # @param params [Auth0::Experimentation::FeatureFlags::Types::UpdateFeatureFlagRequestContent] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.experimentation.feature_flags.update(id: "id") + # + # @return [Auth0::Types::UpdateFeatureFlagResponseContent] + def update(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + request_data = Auth0::Experimentation::FeatureFlags::Types::UpdateFeatureFlagRequestContent.new(params).to_h + non_body_param_names = %w[id] + body = request_data.except(*non_body_param_names) + + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "PATCH", + path: "experimentation/feature-flags/#{URI.encode_uri_component(params[:id].to_s)}", + body: body, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Auth0::Types::UpdateFeatureFlagResponseContent.load(response.body)) + else + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Transitions a feature flag through its lifecycle states: draft → active, draft → archived, active → archived. + # + # @param request_options [Hash] + # @param params [Auth0::Experimentation::FeatureFlags::Types::UpdateFeatureFlagStatusRequestContent] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.experimentation.feature_flags.update_status( + # id: "id", + # status: "draft" + # ) + # + # @return [Auth0::Types::UpdateFeatureFlagStatusResponseContent] + def update_status(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + request_data = Auth0::Experimentation::FeatureFlags::Types::UpdateFeatureFlagStatusRequestContent.new(params).to_h + non_body_param_names = %w[id] + body = request_data.except(*non_body_param_names) + + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "POST", + path: "experimentation/feature-flags/#{URI.encode_uri_component(params[:id].to_s)}/status", + body: body, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Auth0::Types::UpdateFeatureFlagStatusResponseContent.load(response.body)) + else + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # @return [Auth0::Variations::Client] + def variations + @variations ||= Auth0::Experimentation::FeatureFlags::Variations::Client.new(client: @client) + end + end + end + end +end diff --git a/lib/auth0/experimentation/feature_flags/types/create_feature_flag_request_content.rb b/lib/auth0/experimentation/feature_flags/types/create_feature_flag_request_content.rb new file mode 100644 index 000000000..dd518905e --- /dev/null +++ b/lib/auth0/experimentation/feature_flags/types/create_feature_flag_request_content.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Auth0 + module Experimentation + module FeatureFlags + module Types + class CreateFeatureFlagRequestContent < Internal::Types::Model + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :parameters, -> { Internal::Types::Hash[String, Auth0::Types::FeatureFlagConfigParam] }, optional: false, nullable: false + end + end + end + end +end diff --git a/lib/auth0/experimentation/feature_flags/types/list_feature_flags_request_parameters.rb b/lib/auth0/experimentation/feature_flags/types/list_feature_flags_request_parameters.rb new file mode 100644 index 000000000..f62723287 --- /dev/null +++ b/lib/auth0/experimentation/feature_flags/types/list_feature_flags_request_parameters.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Auth0 + module Experimentation + module FeatureFlags + module Types + class ListFeatureFlagsRequestParameters < Internal::Types::Model + field :from, -> { String }, optional: true, nullable: false + + field :take, -> { Integer }, optional: true, nullable: false + + field :type, -> { Auth0::Types::FeatureFlagTypeEnum }, optional: true, nullable: false + + field :status, -> { Auth0::Types::FeatureFlagStatusEnum }, optional: true, nullable: false + end + end + end + end +end diff --git a/lib/auth0/experimentation/feature_flags/types/update_feature_flag_request_content.rb b/lib/auth0/experimentation/feature_flags/types/update_feature_flag_request_content.rb new file mode 100644 index 000000000..1d5f1842b --- /dev/null +++ b/lib/auth0/experimentation/feature_flags/types/update_feature_flag_request_content.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Auth0 + module Experimentation + module FeatureFlags + module Types + class UpdateFeatureFlagRequestContent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: true, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :parameters, -> { Internal::Types::Hash[String, Auth0::Types::FeatureFlagConfigParam] }, optional: true, nullable: false + end + end + end + end +end diff --git a/lib/auth0/experimentation/feature_flags/types/update_feature_flag_status_request_content.rb b/lib/auth0/experimentation/feature_flags/types/update_feature_flag_status_request_content.rb new file mode 100644 index 000000000..6ed5c64b0 --- /dev/null +++ b/lib/auth0/experimentation/feature_flags/types/update_feature_flag_status_request_content.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Auth0 + module Experimentation + module FeatureFlags + module Types + class UpdateFeatureFlagStatusRequestContent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :status, -> { Auth0::Types::FeatureFlagStatusEnum }, optional: false, nullable: false + end + end + end + end +end diff --git a/lib/auth0/experimentation/feature_flags/variations/client.rb b/lib/auth0/experimentation/feature_flags/variations/client.rb new file mode 100644 index 000000000..dc6c8d006 --- /dev/null +++ b/lib/auth0/experimentation/feature_flags/variations/client.rb @@ -0,0 +1,230 @@ +# frozen_string_literal: true + +module Auth0 + module Experimentation + module FeatureFlags + module Variations + class Client + # @param client [Auth0::Internal::Http::RawClient] + # + # @return [void] + def initialize(client:) + @client = client + end + + # Retrieve all variations defined for a specific feature flag. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.experimentation.feature_flags.variations.list(id: "id") + # + # @return [Auth0::Types::ListVariationsResponseContent] + def list(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "experimentation/feature-flags/#{URI.encode_uri_component(params[:id].to_s)}/variations", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Auth0::Types::ListVariationsResponseContent.load(response.body)) + else + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Create a new variation with parameter overrides for a specific feature flag. + # + # @param request_options [Hash] + # @param params [Auth0::Experimentation::FeatureFlags::Variations::Types::CreateVariationRequestContent] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.experimentation.feature_flags.variations.create( + # id: "id", + # name: "name", + # overrides: { + # key: "value" + # } + # ) + # + # @return [Auth0::Types::CreateVariationResponseContent] + def create(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + request_data = Auth0::Experimentation::FeatureFlags::Variations::Types::CreateVariationRequestContent.new(params).to_h + non_body_param_names = %w[id] + body = request_data.except(*non_body_param_names) + + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "POST", + path: "experimentation/feature-flags/#{URI.encode_uri_component(params[:id].to_s)}/variations", + body: body, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Auth0::Types::CreateVariationResponseContent.load(response.body)) + else + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Retrieve a single variation by its ID. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # @option params [String] :vid + # + # @example + # client.experimentation.feature_flags.variations.get( + # id: "id", + # vid: "vid" + # ) + # + # @return [Auth0::Types::GetVariationResponseContent] + def get(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "experimentation/feature-flags/#{URI.encode_uri_component(params[:id].to_s)}/variations/#{URI.encode_uri_component(params[:vid].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Auth0::Types::GetVariationResponseContent.load(response.body)) + else + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Delete a variation by ID. Returns 204 if the variation does not exist. Returns 404 if the parent feature + # flag does not exist. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # @option params [String] :vid + # + # @example + # client.experimentation.feature_flags.variations.delete( + # id: "id", + # vid: "vid" + # ) + # + # @return [untyped] + def delete(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "DELETE", + path: "experimentation/feature-flags/#{URI.encode_uri_component(params[:id].to_s)}/variations/#{URI.encode_uri_component(params[:vid].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + return if code.between?(200, 299) + + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + + # Partially update a variation by ID. Only provided fields are updated. + # + # @param request_options [Hash] + # @param params [Auth0::Experimentation::FeatureFlags::Variations::Types::UpdateVariationRequestContent] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # @option params [String] :vid + # + # @example + # client.experimentation.feature_flags.variations.update( + # id: "id", + # vid: "vid" + # ) + # + # @return [Auth0::Types::UpdateVariationResponseContent] + def update(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + request_data = Auth0::Experimentation::FeatureFlags::Variations::Types::UpdateVariationRequestContent.new(params).to_h + non_body_param_names = %w[id vid] + body = request_data.except(*non_body_param_names) + + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "PATCH", + path: "experimentation/feature-flags/#{URI.encode_uri_component(params[:id].to_s)}/variations/#{URI.encode_uri_component(params[:vid].to_s)}", + body: body, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Auth0::Types::UpdateVariationResponseContent.load(response.body)) + else + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + end + end + end + end +end diff --git a/lib/auth0/experimentation/feature_flags/variations/types/create_variation_request_content.rb b/lib/auth0/experimentation/feature_flags/variations/types/create_variation_request_content.rb new file mode 100644 index 000000000..0f0dd54b7 --- /dev/null +++ b/lib/auth0/experimentation/feature_flags/variations/types/create_variation_request_content.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Auth0 + module Experimentation + module FeatureFlags + module Variations + module Types + class CreateVariationRequestContent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :overrides, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + end + end + end + end + end +end diff --git a/lib/auth0/experimentation/feature_flags/variations/types/update_variation_request_content.rb b/lib/auth0/experimentation/feature_flags/variations/types/update_variation_request_content.rb new file mode 100644 index 000000000..56fa1c799 --- /dev/null +++ b/lib/auth0/experimentation/feature_flags/variations/types/update_variation_request_content.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Auth0 + module Experimentation + module FeatureFlags + module Variations + module Types + class UpdateVariationRequestContent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :vid, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: true, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :overrides, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false + end + end + end + end + end +end diff --git a/lib/auth0/experimentation/segments/client.rb b/lib/auth0/experimentation/segments/client.rb new file mode 100644 index 000000000..205d0778d --- /dev/null +++ b/lib/auth0/experimentation/segments/client.rb @@ -0,0 +1,228 @@ +# frozen_string_literal: true + +module Auth0 + module Experimentation + module Segments + class Client + # @param client [Auth0::Internal::Http::RawClient] + # + # @return [void] + def initialize(client:) + @client = client + end + + # Retrieve a paginated list of segments for the tenant. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String, nil] :from + # @option params [Integer, nil] :take + # @option params [Auth0::Types::SegmentTypeFilterEnum, nil] :type + # + # @example + # client.experimentation.segments.list( + # from: "from", + # take: 1, + # type: "auth0" + # ) + # + # @return [Auth0::Types::ListSegmentsResponseContent] + def list(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + query_params = {} + query_params["from"] = params[:from] if params.key?(:from) + query_params["take"] = params.fetch(:take, 50) + query_params["type"] = params[:type] if params.key?(:type) + + Auth0::Internal::CursorItemIterator.new( + cursor_field: :next_, + item_field: :segments, + initial_cursor: query_params["from"] + ) do |next_cursor| + query_params["from"] = next_cursor + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "experimentation/segments", + query: query_params, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + parsed_response = (response.body.to_s.empty? ? nil : Auth0::Types::ListSegmentsResponseContent.load(response.body)) + [parsed_response, response] + else + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + end + + # Create a new segment with rule-based membership criteria for use in experiments. + # + # @param request_options [Hash] + # @param params [Auth0::Experimentation::Segments::Types::CreateSegmentRequestContent] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # + # @example + # client.experimentation.segments.create( + # name: "name", + # rules: [{}] + # ) + # + # @return [Auth0::Types::CreateSegmentResponseContent] + def create(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "POST", + path: "experimentation/segments", + body: Auth0::Experimentation::Segments::Types::CreateSegmentRequestContent.new(params).to_h, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Auth0::Types::CreateSegmentResponseContent.load(response.body)) + else + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Retrieve a single segment by its ID. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.experimentation.segments.get(id: "id") + # + # @return [Auth0::Types::GetSegmentResponseContent] + def get(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "GET", + path: "experimentation/segments/#{URI.encode_uri_component(params[:id].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Auth0::Types::GetSegmentResponseContent.load(response.body)) + else + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + + # Delete a segment by ID. Idempotent: returns 204 even if segment does not exist. + # + # @param request_options [Hash] + # @param params [Hash] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.experimentation.segments.delete(id: "id") + # + # @return [untyped] + def delete(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "DELETE", + path: "experimentation/segments/#{URI.encode_uri_component(params[:id].to_s)}", + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + return if code.between?(200, 299) + + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + + # Partially update a segment by ID. Only provided fields are updated. Sending rules replaces the entire rules + # array. + # + # @param request_options [Hash] + # @param params [Auth0::Experimentation::Segments::Types::UpdateSegmentRequestContent] + # @option request_options [String] :base_url + # @option request_options [Hash{String => Object}] :additional_headers + # @option request_options [Hash{String => Object}] :additional_query_parameters + # @option request_options [Hash{String => Object}] :additional_body_parameters + # @option request_options [Integer] :timeout_in_seconds + # @option params [String] :id + # + # @example + # client.experimentation.segments.update(id: "id") + # + # @return [Auth0::Types::UpdateSegmentResponseContent] + def update(request_options: {}, **params) + params = Auth0::Internal::Types::Utils.normalize_keys(params) + request_data = Auth0::Experimentation::Segments::Types::UpdateSegmentRequestContent.new(params).to_h + non_body_param_names = %w[id] + body = request_data.except(*non_body_param_names) + + request = Auth0::Internal::JSON::Request.new( + base_url: request_options[:base_url], + method: "PATCH", + path: "experimentation/segments/#{URI.encode_uri_component(params[:id].to_s)}", + body: body, + request_options: request_options + ) + begin + response = @client.send(request) + rescue Net::HTTPRequestTimeout + raise Auth0::Errors::TimeoutError + end + code = response.code.to_i + if code.between?(200, 299) + (response.body.to_s.empty? ? nil : Auth0::Types::UpdateSegmentResponseContent.load(response.body)) + else + error_class = Auth0::Errors::ResponseError.subclass_for_code(code) + raise error_class.new(response.body, code: code) + end + end + end + end + end +end diff --git a/lib/auth0/experimentation/segments/types/create_segment_request_content.rb b/lib/auth0/experimentation/segments/types/create_segment_request_content.rb new file mode 100644 index 000000000..93b26a872 --- /dev/null +++ b/lib/auth0/experimentation/segments/types/create_segment_request_content.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Auth0 + module Experimentation + module Segments + module Types + class CreateSegmentRequestContent < Internal::Types::Model + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :rules, -> { Internal::Types::Array[Auth0::Types::SegmentRule] }, optional: false, nullable: false + end + end + end + end +end diff --git a/lib/auth0/experimentation/segments/types/list_segments_request_parameters.rb b/lib/auth0/experimentation/segments/types/list_segments_request_parameters.rb new file mode 100644 index 000000000..1d34d670b --- /dev/null +++ b/lib/auth0/experimentation/segments/types/list_segments_request_parameters.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Auth0 + module Experimentation + module Segments + module Types + class ListSegmentsRequestParameters < Internal::Types::Model + field :from, -> { String }, optional: true, nullable: false + + field :take, -> { Integer }, optional: true, nullable: false + + field :type, -> { Auth0::Types::SegmentTypeFilterEnum }, optional: true, nullable: false + end + end + end + end +end diff --git a/lib/auth0/experimentation/segments/types/update_segment_request_content.rb b/lib/auth0/experimentation/segments/types/update_segment_request_content.rb new file mode 100644 index 000000000..a3fadadbb --- /dev/null +++ b/lib/auth0/experimentation/segments/types/update_segment_request_content.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Auth0 + module Experimentation + module Segments + module Types + class UpdateSegmentRequestContent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: true, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :rules, -> { Internal::Types::Array[Auth0::Types::SegmentRule] }, optional: true, nullable: false + end + end + end + end +end diff --git a/lib/auth0/organizations/client.rb b/lib/auth0/organizations/client.rb index 00a8ddb87..902b6d369 100644 --- a/lib/auth0/organizations/client.rb +++ b/lib/auth0/organizations/client.rb @@ -402,11 +402,6 @@ def members @members ||= Auth0::Organizations::Members::Client.new(client: @client) end - # @return [Auth0::OrganizationTemplate::Client] - def organization_template - @organization_template ||= Auth0::Organizations::OrganizationTemplate::Client.new(client: @client) - end - # @return [Auth0::Groups::Client] def groups @groups ||= Auth0::Organizations::Groups::Client.new(client: @client) diff --git a/lib/auth0/organizations/organization_template/client.rb b/lib/auth0/organizations/organization_template/client.rb deleted file mode 100644 index e5fa1bdfd..000000000 --- a/lib/auth0/organizations/organization_template/client.rb +++ /dev/null @@ -1,132 +0,0 @@ -# frozen_string_literal: true - -module Auth0 - module Organizations - module OrganizationTemplate - class Client - # @param client [Auth0::Internal::Http::RawClient] - # - # @return [void] - def initialize(client:) - @client = client - end - - # Retrieve the organization template assigned to a specific organization. Returns the template object if one is - # explicitly assigned, or a 404 if no template is assigned. - # - # @param request_options [Hash] - # @param params [Hash] - # @option request_options [String] :base_url - # @option request_options [Hash{String => Object}] :additional_headers - # @option request_options [Hash{String => Object}] :additional_query_parameters - # @option request_options [Hash{String => Object}] :additional_body_parameters - # @option request_options [Integer] :timeout_in_seconds - # @option params [String] :id - # - # @example - # client.organizations.organization_template.get(id: "id") - # - # @return [Auth0::Types::OrganizationTemplate] - def get(request_options: {}, **params) - params = Auth0::Internal::Types::Utils.normalize_keys(params) - request = Auth0::Internal::JSON::Request.new( - base_url: request_options[:base_url], - method: "GET", - path: "organizations/#{URI.encode_uri_component(params[:id].to_s)}/organization-templates", - request_options: request_options - ) - begin - response = @client.send(request) - rescue Net::HTTPRequestTimeout - raise Auth0::Errors::TimeoutError - end - code = response.code.to_i - if code.between?(200, 299) - (response.body.to_s.empty? ? nil : Auth0::Types::OrganizationTemplate.load(response.body)) - else - error_class = Auth0::Errors::ResponseError.subclass_for_code(code) - raise error_class.new(response.body, code: code) - end - end - - # Assign an Organization Template to an organization. - # - # @param request_options [Hash] - # @param params [Hash] - # @option request_options [String] :base_url - # @option request_options [Hash{String => Object}] :additional_headers - # @option request_options [Hash{String => Object}] :additional_query_parameters - # @option request_options [Hash{String => Object}] :additional_body_parameters - # @option request_options [Integer] :timeout_in_seconds - # @option params [String] :id - # @option params [String] :template_id - # - # @example - # client.organizations.organization_template.assign_organization_template( - # id: "id", - # template_id: "template_id" - # ) - # - # @return [untyped] - def assign_organization_template(request_options: {}, **params) - params = Auth0::Internal::Types::Utils.normalize_keys(params) - request = Auth0::Internal::JSON::Request.new( - base_url: request_options[:base_url], - method: "PUT", - path: "organizations/#{URI.encode_uri_component(params[:id].to_s)}/organization-templates/#{URI.encode_uri_component(params[:template_id].to_s)}", - request_options: request_options - ) - begin - response = @client.send(request) - rescue Net::HTTPRequestTimeout - raise Auth0::Errors::TimeoutError - end - code = response.code.to_i - return if code.between?(200, 299) - - error_class = Auth0::Errors::ResponseError.subclass_for_code(code) - raise error_class.new(response.body, code: code) - end - - # Remove an Organization Template assignment from an organization. - # - # @param request_options [Hash] - # @param params [Hash] - # @option request_options [String] :base_url - # @option request_options [Hash{String => Object}] :additional_headers - # @option request_options [Hash{String => Object}] :additional_query_parameters - # @option request_options [Hash{String => Object}] :additional_body_parameters - # @option request_options [Integer] :timeout_in_seconds - # @option params [String] :id - # @option params [String] :template_id - # - # @example - # client.organizations.organization_template.unassign_organization_template( - # id: "id", - # template_id: "template_id" - # ) - # - # @return [untyped] - def unassign_organization_template(request_options: {}, **params) - params = Auth0::Internal::Types::Utils.normalize_keys(params) - request = Auth0::Internal::JSON::Request.new( - base_url: request_options[:base_url], - method: "DELETE", - path: "organizations/#{URI.encode_uri_component(params[:id].to_s)}/organization-templates/#{URI.encode_uri_component(params[:template_id].to_s)}", - request_options: request_options - ) - begin - response = @client.send(request) - rescue Net::HTTPRequestTimeout - raise Auth0::Errors::TimeoutError - end - code = response.code.to_i - return if code.between?(200, 299) - - error_class = Auth0::Errors::ResponseError.subclass_for_code(code) - raise error_class.new(response.body, code: code) - end - end - end - end -end diff --git a/lib/auth0/resource_servers/types/create_resource_server_request_content.rb b/lib/auth0/resource_servers/types/create_resource_server_request_content.rb index ca5eb253f..ad234b80d 100644 --- a/lib/auth0/resource_servers/types/create_resource_server_request_content.rb +++ b/lib/auth0/resource_servers/types/create_resource_server_request_content.rb @@ -36,6 +36,8 @@ class CreateResourceServerRequestContent < Internal::Types::Model field :consent_policy, -> { Auth0::Types::ResourceServerConsentPolicyEnum }, optional: true, nullable: false + field :require_consent_non_repudiation, -> { Internal::Types::Boolean }, optional: true, nullable: false + field :authorization_details, -> { Internal::Types::Array[Object] }, optional: true, nullable: false field :proof_of_possession, -> { Auth0::Types::ResourceServerProofOfPossession }, optional: true, nullable: false diff --git a/lib/auth0/resource_servers/types/update_resource_server_request_content.rb b/lib/auth0/resource_servers/types/update_resource_server_request_content.rb index ca5802a01..297dcf360 100644 --- a/lib/auth0/resource_servers/types/update_resource_server_request_content.rb +++ b/lib/auth0/resource_servers/types/update_resource_server_request_content.rb @@ -36,6 +36,8 @@ class UpdateResourceServerRequestContent < Internal::Types::Model field :consent_policy, -> { Auth0::Types::ResourceServerConsentPolicyEnum }, optional: true, nullable: false + field :require_consent_non_repudiation, -> { Internal::Types::Boolean }, optional: true, nullable: false + field :authorization_details, -> { Internal::Types::Array[Object] }, optional: true, nullable: false field :proof_of_possession, -> { Auth0::Types::ResourceServerProofOfPossession }, optional: true, nullable: false diff --git a/lib/auth0/types/allocation_item.rb b/lib/auth0/types/allocation_item.rb new file mode 100644 index 000000000..45aa31d3c --- /dev/null +++ b/lib/auth0/types/allocation_item.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class AllocationItem < Internal::Types::Model + field :variation_id, -> { String }, optional: true, nullable: false + + field :variation_name, -> { String }, optional: true, nullable: false + + field :segment_id, -> { String }, optional: true, nullable: false + + field :segment_name, -> { String }, optional: true, nullable: false + + field :weight, -> { Integer }, optional: true, nullable: false + + field :priority, -> { Integer }, optional: true, nullable: false + + field :is_control, -> { Internal::Types::Boolean }, optional: true, nullable: false + + field :is_fallback, -> { Internal::Types::Boolean }, optional: true, nullable: false + + field :variation_snapshot, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false + + field :segment_snapshot, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false + end + end +end diff --git a/lib/auth0/types/allocation_request_item.rb b/lib/auth0/types/allocation_request_item.rb new file mode 100644 index 000000000..8c54203f7 --- /dev/null +++ b/lib/auth0/types/allocation_request_item.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class AllocationRequestItem < Internal::Types::Model + field :variation_id, -> { String }, optional: false, nullable: false + + field :weight, -> { Integer }, optional: true, nullable: false + + field :segment_id, -> { String }, optional: true, nullable: false + + field :priority, -> { Integer }, optional: true, nullable: false + + field :is_control, -> { Internal::Types::Boolean }, optional: false, nullable: false + + field :is_fallback, -> { Internal::Types::Boolean }, optional: true, nullable: false + end + end +end diff --git a/lib/auth0/types/connection_deletion_behavior_enum.rb b/lib/auth0/types/allocation_strategy_enum.rb similarity index 53% rename from lib/auth0/types/connection_deletion_behavior_enum.rb rename to lib/auth0/types/allocation_strategy_enum.rb index 030677c21..51763f845 100644 --- a/lib/auth0/types/connection_deletion_behavior_enum.rb +++ b/lib/auth0/types/allocation_strategy_enum.rb @@ -2,11 +2,11 @@ module Auth0 module Types - module ConnectionDeletionBehaviorEnum + module AllocationStrategyEnum extend Auth0::Internal::Types::Enum - ALLOW = "allow" - ALLOW_IF_EMPTY = "allow_if_empty" + PERCENTAGE = "percentage" + SEGMENT = "segment" end end end diff --git a/lib/auth0/types/async_approval_notifications_channels_enum.rb b/lib/auth0/types/async_approval_notifications_channels_enum.rb index e6a70a932..afa4f75d1 100644 --- a/lib/auth0/types/async_approval_notifications_channels_enum.rb +++ b/lib/auth0/types/async_approval_notifications_channels_enum.rb @@ -7,6 +7,7 @@ module AsyncApprovalNotificationsChannelsEnum GUARDIAN_PUSH = "guardian-push" EMAIL = "email" + MY_ACCOUNT = "my-account" end end end diff --git a/lib/auth0/types/authentication_flow_enum.rb b/lib/auth0/types/authentication_flow_enum.rb new file mode 100644 index 000000000..3f6b0d902 --- /dev/null +++ b/lib/auth0/types/authentication_flow_enum.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +module Auth0 + module Types + module AuthenticationFlowEnum + extend Auth0::Internal::Types::Enum + + AUTHENTICATION = "authentication" + MFA_ENROLLMENT = "mfa_enrollment" + MFA_CHALLENGE = "mfa_challenge" + PASSWORD_RESET = "password_reset" + PASSKEY_ENROLLMENT = "passkey_enrollment" + ALL = "all" + end + end +end diff --git a/lib/auth0/types/client_oidc_backchannel_logout_initiators_enum.rb b/lib/auth0/types/client_oidc_backchannel_logout_initiators_enum.rb index 628a49d22..3b9e8223f 100644 --- a/lib/auth0/types/client_oidc_backchannel_logout_initiators_enum.rb +++ b/lib/auth0/types/client_oidc_backchannel_logout_initiators_enum.rb @@ -14,6 +14,7 @@ module ClientOidcBackchannelLogoutInitiatorsEnum EMAIL_IDENTIFIER_CHANGED = "email-identifier-changed" MFA_PHONE_UNENROLLED = "mfa-phone-unenrolled" ACCOUNT_DEACTIVATED = "account-deactivated" + PROFILE_CHANGED = "profile-changed" end end end diff --git a/lib/auth0/types/client_oidc_support_allowed_scopes_enum.rb b/lib/auth0/types/client_oidc_support_allowed_scopes_enum.rb new file mode 100644 index 000000000..546487d0d --- /dev/null +++ b/lib/auth0/types/client_oidc_support_allowed_scopes_enum.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Auth0 + module Types + module ClientOidcSupportAllowedScopesEnum + extend Auth0::Internal::Types::Enum + + PROFILE = "profile" + EMAIL = "email" + ADDRESS = "address" + PHONE = "phone" + end + end +end diff --git a/lib/auth0/types/client_oidc_support_post.rb b/lib/auth0/types/client_oidc_support_post.rb new file mode 100644 index 000000000..3fc3dc40a --- /dev/null +++ b/lib/auth0/types/client_oidc_support_post.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Auth0 + module Types + # OIDC support configuration for a client. Controls whether OIDC flows are allowed and which scopes the client may + # request. + class ClientOidcSupportPost < Internal::Types::Model + field :is_allowed, -> { Internal::Types::Boolean }, optional: false, nullable: false + + field :allow_all_scopes, -> { Internal::Types::Boolean }, optional: true, nullable: false + + field :allowed_scopes, -> { Internal::Types::Array[Auth0::Types::ClientOidcSupportAllowedScopesEnum] }, optional: true, nullable: false + end + end +end diff --git a/lib/auth0/types/create_experiment_response_content.rb b/lib/auth0/types/create_experiment_response_content.rb new file mode 100644 index 000000000..86fabd141 --- /dev/null +++ b/lib/auth0/types/create_experiment_response_content.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class CreateExperimentResponseContent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :feature_flag_id, -> { String }, optional: false, nullable: false + + field :feature_flag_name, -> { String }, optional: true, nullable: false + + field :authentication_flow, -> { String }, optional: false, nullable: false + + field :allocation_strategy, -> { Auth0::Types::AllocationStrategyEnum }, optional: false, nullable: false + + field :status, -> { Auth0::Types::ExperimentStatusEnum }, optional: false, nullable: false + + field :is_valid, -> { Internal::Types::Boolean }, optional: false, nullable: false + + field :default_config, -> { Auth0::Types::DefaultConfigEnum }, optional: true, nullable: false + + field :feature_flag_snapshot, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false + + field :allocations, -> { Internal::Types::Array[Auth0::Types::AllocationItem] }, optional: false, nullable: false + + field :editable_fields, -> { Internal::Types::Array[String] }, optional: false, nullable: false + + field :levels, -> { Internal::Types::Array[Integer] }, optional: true, nullable: false + + field :current_level, -> { Integer }, optional: true, nullable: false + + field :started_at, -> { String }, optional: true, nullable: false + + field :ended_at, -> { String }, optional: true, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/create_feature_flag_parameters.rb b/lib/auth0/types/create_feature_flag_parameters.rb new file mode 100644 index 000000000..a63a55fef --- /dev/null +++ b/lib/auth0/types/create_feature_flag_parameters.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Auth0 + module Types + module CreateFeatureFlagParameters + # CreateFeatureFlagParameters is an alias for Hash + + # @option str [String] + # + # @return [untyped] + def self.load(str) + ::JSON.parse(str) + end + + # @option value [untyped] + # + # @return [String] + def self.dump(value) + ::JSON.generate(value) + end + end + end +end diff --git a/lib/auth0/types/create_feature_flag_response_content.rb b/lib/auth0/types/create_feature_flag_response_content.rb new file mode 100644 index 000000000..1aa5d1c60 --- /dev/null +++ b/lib/auth0/types/create_feature_flag_response_content.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class CreateFeatureFlagResponseContent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :type, -> { Auth0::Types::FeatureFlagTypeEnum }, optional: false, nullable: false + + field :status, -> { Auth0::Types::FeatureFlagStatusEnum }, optional: false, nullable: false + + field :parameters, -> { Internal::Types::Hash[String, Auth0::Types::FeatureFlagConfigParam] }, optional: true, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/create_resource_server_response_content.rb b/lib/auth0/types/create_resource_server_response_content.rb index 3dd0ca51f..58f3839bc 100644 --- a/lib/auth0/types/create_resource_server_response_content.rb +++ b/lib/auth0/types/create_resource_server_response_content.rb @@ -41,6 +41,8 @@ class CreateResourceServerResponseContent < Internal::Types::Model field :consent_policy, -> { Auth0::Types::ResourceServerConsentPolicyEnum }, optional: true, nullable: false + field :require_consent_non_repudiation, -> { Internal::Types::Boolean }, optional: true, nullable: false + field :authorization_details, -> { Internal::Types::Array[Object] }, optional: true, nullable: false field :proof_of_possession, -> { Auth0::Types::ResourceServerProofOfPossession }, optional: true, nullable: false diff --git a/lib/auth0/types/create_segment_response_content.rb b/lib/auth0/types/create_segment_response_content.rb new file mode 100644 index 000000000..4c3607aef --- /dev/null +++ b/lib/auth0/types/create_segment_response_content.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class CreateSegmentResponseContent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :type, -> { Auth0::Types::SegmentTypeEnum }, optional: false, nullable: false + + field :rules, -> { Internal::Types::Array[Auth0::Types::SegmentRule] }, optional: false, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/create_variation_response_content.rb b/lib/auth0/types/create_variation_response_content.rb new file mode 100644 index 000000000..bab2c1be7 --- /dev/null +++ b/lib/auth0/types/create_variation_response_content.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class CreateVariationResponseContent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :feature_flag_id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :overrides, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/organization_deletion_behavior_enum.rb b/lib/auth0/types/default_config_enum.rb similarity index 53% rename from lib/auth0/types/organization_deletion_behavior_enum.rb rename to lib/auth0/types/default_config_enum.rb index 9d5476855..5ccc77f2d 100644 --- a/lib/auth0/types/organization_deletion_behavior_enum.rb +++ b/lib/auth0/types/default_config_enum.rb @@ -2,11 +2,11 @@ module Auth0 module Types - module OrganizationDeletionBehaviorEnum + module DefaultConfigEnum extend Auth0::Internal::Types::Enum - ALLOW = "allow" - ALLOW_IF_EMPTY = "allow_if_empty" + TENANT = "tenant" + FLAG = "flag" end end end diff --git a/lib/auth0/types/experiment_list_item.rb b/lib/auth0/types/experiment_list_item.rb new file mode 100644 index 000000000..d86a9cb09 --- /dev/null +++ b/lib/auth0/types/experiment_list_item.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class ExperimentListItem < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :feature_flag_id, -> { String }, optional: false, nullable: false + + field :feature_flag_name, -> { String }, optional: true, nullable: false + + field :authentication_flow, -> { String }, optional: false, nullable: false + + field :allocation_strategy, -> { Auth0::Types::AllocationStrategyEnum }, optional: false, nullable: false + + field :status, -> { Auth0::Types::ExperimentStatusEnum }, optional: false, nullable: false + + field :is_valid, -> { Internal::Types::Boolean }, optional: false, nullable: false + + field :default_config, -> { Auth0::Types::DefaultConfigEnum }, optional: true, nullable: false + + field :feature_flag_snapshot, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false + + field :allocations, -> { Internal::Types::Array[Auth0::Types::AllocationItem] }, optional: false, nullable: false + + field :editable_fields, -> { Internal::Types::Array[String] }, optional: false, nullable: false + + field :levels, -> { Internal::Types::Array[Integer] }, optional: true, nullable: false + + field :current_level, -> { Integer }, optional: true, nullable: false + + field :started_at, -> { String }, optional: true, nullable: false + + field :ended_at, -> { String }, optional: true, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/experiment_status_enum.rb b/lib/auth0/types/experiment_status_enum.rb new file mode 100644 index 000000000..45f5fd7d2 --- /dev/null +++ b/lib/auth0/types/experiment_status_enum.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Auth0 + module Types + module ExperimentStatusEnum + extend Auth0::Internal::Types::Enum + + DRAFT = "draft" + ACTIVE = "active" + PAUSED = "paused" + COMPLETED = "completed" + ARCHIVED = "archived" + end + end +end diff --git a/lib/auth0/types/experiment_transition_status_enum.rb b/lib/auth0/types/experiment_transition_status_enum.rb new file mode 100644 index 000000000..ac9468f80 --- /dev/null +++ b/lib/auth0/types/experiment_transition_status_enum.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Auth0 + module Types + module ExperimentTransitionStatusEnum + extend Auth0::Internal::Types::Enum + + ACTIVE = "active" + PAUSED = "paused" + COMPLETED = "completed" + ARCHIVED = "archived" + end + end +end diff --git a/lib/auth0/types/experiment_validation_error.rb b/lib/auth0/types/experiment_validation_error.rb new file mode 100644 index 000000000..d1945c5d8 --- /dev/null +++ b/lib/auth0/types/experiment_validation_error.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class ExperimentValidationError < Internal::Types::Model + field :code, -> { String }, optional: false, nullable: false + + field :message, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/feature_flag.rb b/lib/auth0/types/feature_flag.rb new file mode 100644 index 000000000..706745fdc --- /dev/null +++ b/lib/auth0/types/feature_flag.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class FeatureFlag < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :type, -> { Auth0::Types::FeatureFlagTypeEnum }, optional: false, nullable: false + + field :status, -> { Auth0::Types::FeatureFlagStatusEnum }, optional: false, nullable: false + + field :parameters, -> { Internal::Types::Hash[String, Auth0::Types::FeatureFlagConfigParam] }, optional: true, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/feature_flag_config_param.rb b/lib/auth0/types/feature_flag_config_param.rb new file mode 100644 index 000000000..580968f80 --- /dev/null +++ b/lib/auth0/types/feature_flag_config_param.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class FeatureFlagConfigParam < Internal::Types::Model + field :type, -> { Auth0::Types::FeatureFlagConfigParamTypeEnum }, optional: false, nullable: false + + field :value, -> { Object }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + end + end +end diff --git a/lib/auth0/types/feature_flag_config_param_type_enum.rb b/lib/auth0/types/feature_flag_config_param_type_enum.rb new file mode 100644 index 000000000..1ee95bbf3 --- /dev/null +++ b/lib/auth0/types/feature_flag_config_param_type_enum.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Auth0 + module Types + module FeatureFlagConfigParamTypeEnum + extend Auth0::Internal::Types::Enum + + STRING = "string" + BOOLEAN = "boolean" + NUMBER = "number" + ARRAY = "array" + OBJECT = "object" + end + end +end diff --git a/lib/auth0/types/feature_flag_config_params.rb b/lib/auth0/types/feature_flag_config_params.rb new file mode 100644 index 000000000..6e3a9b2ff --- /dev/null +++ b/lib/auth0/types/feature_flag_config_params.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Auth0 + module Types + module FeatureFlagConfigParams + # FeatureFlagConfigParams is an alias for Hash + + # @option str [String] + # + # @return [untyped] + def self.load(str) + ::JSON.parse(str) + end + + # @option value [untyped] + # + # @return [String] + def self.dump(value) + ::JSON.generate(value) + end + end + end +end diff --git a/lib/auth0/types/feature_flag_status_enum.rb b/lib/auth0/types/feature_flag_status_enum.rb new file mode 100644 index 000000000..1d220399d --- /dev/null +++ b/lib/auth0/types/feature_flag_status_enum.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Auth0 + module Types + module FeatureFlagStatusEnum + extend Auth0::Internal::Types::Enum + + DRAFT = "draft" + ACTIVE = "active" + ARCHIVED = "archived" + end + end +end diff --git a/lib/auth0/types/feature_flag_type_enum.rb b/lib/auth0/types/feature_flag_type_enum.rb new file mode 100644 index 000000000..0c989f63d --- /dev/null +++ b/lib/auth0/types/feature_flag_type_enum.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Auth0 + module Types + module FeatureFlagTypeEnum + extend Auth0::Internal::Types::Enum + + AUTH0 = "auth0" + SELF = "self" + end + end +end diff --git a/lib/auth0/types/get_experiment_response_content.rb b/lib/auth0/types/get_experiment_response_content.rb new file mode 100644 index 000000000..fcf0292f8 --- /dev/null +++ b/lib/auth0/types/get_experiment_response_content.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class GetExperimentResponseContent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :feature_flag_id, -> { String }, optional: false, nullable: false + + field :feature_flag_name, -> { String }, optional: true, nullable: false + + field :authentication_flow, -> { String }, optional: false, nullable: false + + field :allocation_strategy, -> { Auth0::Types::AllocationStrategyEnum }, optional: false, nullable: false + + field :status, -> { Auth0::Types::ExperimentStatusEnum }, optional: false, nullable: false + + field :is_valid, -> { Internal::Types::Boolean }, optional: false, nullable: false + + field :default_config, -> { Auth0::Types::DefaultConfigEnum }, optional: true, nullable: false + + field :feature_flag_snapshot, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false + + field :allocations, -> { Internal::Types::Array[Auth0::Types::AllocationItem] }, optional: false, nullable: false + + field :editable_fields, -> { Internal::Types::Array[String] }, optional: false, nullable: false + + field :levels, -> { Internal::Types::Array[Integer] }, optional: true, nullable: false + + field :current_level, -> { Integer }, optional: true, nullable: false + + field :started_at, -> { String }, optional: true, nullable: false + + field :ended_at, -> { String }, optional: true, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/get_feature_flag_response_content.rb b/lib/auth0/types/get_feature_flag_response_content.rb new file mode 100644 index 000000000..f57bbf6b4 --- /dev/null +++ b/lib/auth0/types/get_feature_flag_response_content.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class GetFeatureFlagResponseContent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :type, -> { Auth0::Types::FeatureFlagTypeEnum }, optional: false, nullable: false + + field :status, -> { Auth0::Types::FeatureFlagStatusEnum }, optional: false, nullable: false + + field :parameters, -> { Internal::Types::Hash[String, Auth0::Types::FeatureFlagConfigParam] }, optional: true, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/get_resource_server_response_content.rb b/lib/auth0/types/get_resource_server_response_content.rb index 572e17e5a..c84741648 100644 --- a/lib/auth0/types/get_resource_server_response_content.rb +++ b/lib/auth0/types/get_resource_server_response_content.rb @@ -41,6 +41,8 @@ class GetResourceServerResponseContent < Internal::Types::Model field :consent_policy, -> { Auth0::Types::ResourceServerConsentPolicyEnum }, optional: true, nullable: false + field :require_consent_non_repudiation, -> { Internal::Types::Boolean }, optional: true, nullable: false + field :authorization_details, -> { Internal::Types::Array[Object] }, optional: true, nullable: false field :proof_of_possession, -> { Auth0::Types::ResourceServerProofOfPossession }, optional: true, nullable: false diff --git a/lib/auth0/types/get_segment_response_content.rb b/lib/auth0/types/get_segment_response_content.rb new file mode 100644 index 000000000..a9adb1580 --- /dev/null +++ b/lib/auth0/types/get_segment_response_content.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class GetSegmentResponseContent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :type, -> { Auth0::Types::SegmentTypeEnum }, optional: false, nullable: false + + field :rules, -> { Internal::Types::Array[Auth0::Types::SegmentRule] }, optional: false, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/get_variation_response_content.rb b/lib/auth0/types/get_variation_response_content.rb new file mode 100644 index 000000000..0e505ae9b --- /dev/null +++ b/lib/auth0/types/get_variation_response_content.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class GetVariationResponseContent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :feature_flag_id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :overrides, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/list_experiments_response_content.rb b/lib/auth0/types/list_experiments_response_content.rb new file mode 100644 index 000000000..4c2033044 --- /dev/null +++ b/lib/auth0/types/list_experiments_response_content.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class ListExperimentsResponseContent < Internal::Types::Model + field :experiments, -> { Internal::Types::Array[Auth0::Types::ExperimentListItem] }, optional: false, nullable: false + + field :next_, -> { String }, optional: true, nullable: false, api_name: "next" + end + end +end diff --git a/lib/auth0/types/list_feature_flags_response_content.rb b/lib/auth0/types/list_feature_flags_response_content.rb new file mode 100644 index 000000000..8c1c2f3a6 --- /dev/null +++ b/lib/auth0/types/list_feature_flags_response_content.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class ListFeatureFlagsResponseContent < Internal::Types::Model + field :feature_flags, -> { Internal::Types::Array[Auth0::Types::FeatureFlag] }, optional: false, nullable: false + + field :next_, -> { String }, optional: true, nullable: false, api_name: "next" + end + end +end diff --git a/lib/auth0/types/list_segments_response_content.rb b/lib/auth0/types/list_segments_response_content.rb new file mode 100644 index 000000000..25a42fd78 --- /dev/null +++ b/lib/auth0/types/list_segments_response_content.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class ListSegmentsResponseContent < Internal::Types::Model + field :segments, -> { Internal::Types::Array[Auth0::Types::Segment] }, optional: false, nullable: false + + field :next_, -> { String }, optional: true, nullable: false, api_name: "next" + end + end +end diff --git a/lib/auth0/types/list_variations_response_content.rb b/lib/auth0/types/list_variations_response_content.rb new file mode 100644 index 000000000..75e9a9a40 --- /dev/null +++ b/lib/auth0/types/list_variations_response_content.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class ListVariationsResponseContent < Internal::Types::Model + field :variations, -> { Internal::Types::Array[Auth0::Types::Variation] }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/oauth_scope.rb b/lib/auth0/types/oauth_scope.rb index c4173d0e5..492a3b3eb 100644 --- a/lib/auth0/types/oauth_scope.rb +++ b/lib/auth0/types/oauth_scope.rb @@ -89,7 +89,10 @@ module OauthScope UPDATE_EVENT_STREAMS = "update:event_streams" DELETE_EVENT_STREAMS = "delete:event_streams" READ_EVENTS = "read:events" + CREATE_EXPERIMENTATION = "create:experimentation" + READ_EXPERIMENTATION = "read:experimentation" UPDATE_EXPERIMENTATION = "update:experimentation" + DELETE_EXPERIMENTATION = "delete:experimentation" CREATE_FLOWS = "create:flows" READ_FLOWS = "read:flows" UPDATE_FLOWS = "update:flows" @@ -250,7 +253,6 @@ module OauthScope READ_ORGANIZATION_CLIENTS = "read:organization_clients" UPDATE_ORGANIZATION_CLIENTS = "update:organization_clients" DELETE_ORGANIZATION_CLIENTS = "delete:organization_clients" - READ_ORGANIZATION_TEMPLATES = "read:organization_templates" CREATE_NETWORK_ACL_KEYS = "create:network_acl_keys" READ_NETWORK_ACL_KEYS = "read:network_acl_keys" DELETE_NETWORK_ACL_KEYS = "delete:network_acl_keys" diff --git a/lib/auth0/types/organization_template.rb b/lib/auth0/types/organization_template.rb deleted file mode 100644 index 26183addb..000000000 --- a/lib/auth0/types/organization_template.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -module Auth0 - module Types - class OrganizationTemplate < Internal::Types::Model - field :id, -> { String }, optional: true, nullable: false - - field :name, -> { String }, optional: true, nullable: false - - field :is_default, -> { Internal::Types::Boolean }, optional: true, nullable: false - - field :organization_deletion_behavior, -> { Auth0::Types::OrganizationDeletionBehaviorEnum }, optional: true, nullable: false - - field :connection_deletion_behavior, -> { Auth0::Types::ConnectionDeletionBehaviorEnum }, optional: true, nullable: false - - field :enforce_permission_ceiling, -> { Internal::Types::Boolean }, optional: true, nullable: false - - field :enforce_self_assignment_restriction, -> { Internal::Types::Boolean }, optional: true, nullable: false - - field :connection_profile_id, -> { String }, optional: true, nullable: false - - field :user_attribute_profile_id, -> { String }, optional: true, nullable: false - - field :allowed_strategies, -> { Internal::Types::Array[Auth0::Types::OrganizationTemplateAllowedStrategyEnum] }, optional: true, nullable: false - - field :invitation_landing_client_id, -> { String }, optional: true, nullable: false - - field :admin_roles_assignment, -> { Internal::Types::Array[String] }, optional: true, nullable: false - - field :use_for_organization_discovery, -> { Auth0::Types::OrganizationTemplateUseForOrganizationDiscovery }, optional: true, nullable: false - - field :role_visibility_policy, -> { Auth0::Types::OrganizationTemplateRoleVisibilityPolicy }, optional: true, nullable: false - - field :created_at, -> { String }, optional: true, nullable: false - - field :updated_at, -> { String }, optional: true, nullable: false - end - end -end diff --git a/lib/auth0/types/organization_template_allowed_strategy_enum.rb b/lib/auth0/types/organization_template_allowed_strategy_enum.rb deleted file mode 100644 index 7e4755d86..000000000 --- a/lib/auth0/types/organization_template_allowed_strategy_enum.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -module Auth0 - module Types - module OrganizationTemplateAllowedStrategyEnum - extend Auth0::Internal::Types::Enum - - ADFS = "adfs" - GOOGLE_APPS = "google-apps" - OIDC = "oidc" - OKTA = "okta" - PINGFEDERATE = "pingfederate" - SAMLP = "samlp" - WAAD = "waad" - end - end -end diff --git a/lib/auth0/types/organization_template_role_visibility_enum.rb b/lib/auth0/types/organization_template_role_visibility_enum.rb deleted file mode 100644 index e12bbae6e..000000000 --- a/lib/auth0/types/organization_template_role_visibility_enum.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -module Auth0 - module Types - module OrganizationTemplateRoleVisibilityEnum - extend Auth0::Internal::Types::Enum - - WRITE = "write" - READ_ONLY = "read_only" - HIDDEN = "hidden" - end - end -end diff --git a/lib/auth0/types/organization_template_role_visibility_override.rb b/lib/auth0/types/organization_template_role_visibility_override.rb deleted file mode 100644 index 394febb76..000000000 --- a/lib/auth0/types/organization_template_role_visibility_override.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -module Auth0 - module Types - # A role visibility override. - class OrganizationTemplateRoleVisibilityOverride < Internal::Types::Model - field :role_id, -> { String }, optional: false, nullable: false - - field :access, -> { Auth0::Types::OrganizationTemplateRoleVisibilityEnum }, optional: false, nullable: false - end - end -end diff --git a/lib/auth0/types/organization_template_role_visibility_policy.rb b/lib/auth0/types/organization_template_role_visibility_policy.rb deleted file mode 100644 index c2362cd5f..000000000 --- a/lib/auth0/types/organization_template_role_visibility_policy.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -module Auth0 - module Types - # Controls role visibility for organization administrators. - class OrganizationTemplateRoleVisibilityPolicy < Internal::Types::Model - field :default_value, -> { Auth0::Types::OrganizationTemplateRoleVisibilityEnum }, optional: false, nullable: false - - field :overrides, -> { Internal::Types::Array[Auth0::Types::OrganizationTemplateRoleVisibilityOverride] }, optional: true, nullable: false - end - end -end diff --git a/lib/auth0/types/organization_template_use_for_organization_discovery.rb b/lib/auth0/types/organization_template_use_for_organization_discovery.rb deleted file mode 100644 index aefa4feab..000000000 --- a/lib/auth0/types/organization_template_use_for_organization_discovery.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -module Auth0 - module Types - # Controls whether connections from this template are used for organization discovery. - class OrganizationTemplateUseForOrganizationDiscovery < Internal::Types::Model - field :default_value, -> { Internal::Types::Boolean }, optional: false, nullable: false - - field :allowed_values, -> { Internal::Types::Array[Internal::Types::Boolean] }, optional: true, nullable: false - end - end -end diff --git a/lib/auth0/types/resource_server.rb b/lib/auth0/types/resource_server.rb index 981acc1e6..3910e361c 100644 --- a/lib/auth0/types/resource_server.rb +++ b/lib/auth0/types/resource_server.rb @@ -41,6 +41,8 @@ class ResourceServer < Internal::Types::Model field :consent_policy, -> { Auth0::Types::ResourceServerConsentPolicyEnum }, optional: true, nullable: false + field :require_consent_non_repudiation, -> { Internal::Types::Boolean }, optional: true, nullable: false + field :authorization_details, -> { Internal::Types::Array[Object] }, optional: true, nullable: false field :proof_of_possession, -> { Auth0::Types::ResourceServerProofOfPossession }, optional: true, nullable: false diff --git a/lib/auth0/types/resource_server_search_response.rb b/lib/auth0/types/resource_server_search_response.rb index e1edf3e1e..b7e88c91f 100644 --- a/lib/auth0/types/resource_server_search_response.rb +++ b/lib/auth0/types/resource_server_search_response.rb @@ -39,6 +39,8 @@ class ResourceServerSearchResponse < Internal::Types::Model field :consent_policy, -> { Auth0::Types::ResourceServerConsentPolicyEnum }, optional: true, nullable: false + field :require_consent_non_repudiation, -> { Internal::Types::Boolean }, optional: true, nullable: false + field :authorization_details, -> { Internal::Types::Array[Object] }, optional: true, nullable: false field :proof_of_possession, -> { Auth0::Types::ResourceServerProofOfPossession }, optional: true, nullable: false diff --git a/lib/auth0/types/segment.rb b/lib/auth0/types/segment.rb new file mode 100644 index 000000000..bd5cd298e --- /dev/null +++ b/lib/auth0/types/segment.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class Segment < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :type, -> { Auth0::Types::SegmentTypeEnum }, optional: false, nullable: false + + field :rules, -> { Internal::Types::Array[Auth0::Types::SegmentRule] }, optional: false, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/segment_contains_expression.rb b/lib/auth0/types/segment_contains_expression.rb new file mode 100644 index 000000000..190ded57d --- /dev/null +++ b/lib/auth0/types/segment_contains_expression.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class SegmentContainsExpression < Internal::Types::Model + field :contains, -> { Internal::Types::Array[String] }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/segment_ends_with_expression.rb b/lib/auth0/types/segment_ends_with_expression.rb new file mode 100644 index 000000000..e0f9f63bf --- /dev/null +++ b/lib/auth0/types/segment_ends_with_expression.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class SegmentEndsWithExpression < Internal::Types::Model + field :ends_with, -> { Internal::Types::Array[String] }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/segment_exists_expression.rb b/lib/auth0/types/segment_exists_expression.rb new file mode 100644 index 000000000..a52b2898c --- /dev/null +++ b/lib/auth0/types/segment_exists_expression.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class SegmentExistsExpression < Internal::Types::Model + field :exists, -> { Internal::Types::Boolean }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/segment_match_conditions.rb b/lib/auth0/types/segment_match_conditions.rb new file mode 100644 index 000000000..43f91b22d --- /dev/null +++ b/lib/auth0/types/segment_match_conditions.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Auth0 + module Types + # Attribute conditions that must match. + class SegmentMatchConditions < Internal::Types::Model + field :client_id, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + + field :connection, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + + field :connection_type, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + + field :organization_id, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + + field :domain, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + + field :device_type, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + + field :browser, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + + field :platform, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + + field :user_agent, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + + field :country, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + + field :region, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + end + end +end diff --git a/lib/auth0/types/segment_match_expression.rb b/lib/auth0/types/segment_match_expression.rb new file mode 100644 index 000000000..ad9aeb38e --- /dev/null +++ b/lib/auth0/types/segment_match_expression.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class SegmentMatchExpression < Internal::Types::Model + extend Auth0::Internal::Types::Union + + member -> { Internal::Types::Array[String] } + + member -> { Auth0::Types::SegmentContainsExpression } + + member -> { Auth0::Types::SegmentStartsWithExpression } + + member -> { Auth0::Types::SegmentEndsWithExpression } + + member -> { Auth0::Types::SegmentExistsExpression } + end + end +end diff --git a/lib/auth0/types/segment_not_match_conditions.rb b/lib/auth0/types/segment_not_match_conditions.rb new file mode 100644 index 000000000..c0a4d3f67 --- /dev/null +++ b/lib/auth0/types/segment_not_match_conditions.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +module Auth0 + module Types + # Attribute conditions that must not match. + class SegmentNotMatchConditions < Internal::Types::Model + field :client_id, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + + field :connection, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + + field :connection_type, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + + field :organization_id, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + + field :domain, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + + field :device_type, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + + field :browser, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + + field :platform, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + + field :user_agent, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + + field :country, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + + field :region, -> { Auth0::Types::SegmentMatchExpression }, optional: true, nullable: false + end + end +end diff --git a/lib/auth0/types/segment_rule.rb b/lib/auth0/types/segment_rule.rb new file mode 100644 index 000000000..cd05879d0 --- /dev/null +++ b/lib/auth0/types/segment_rule.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class SegmentRule < Internal::Types::Model + field :match, -> { Auth0::Types::SegmentMatchConditions }, optional: true, nullable: false + + field :not_match, -> { Auth0::Types::SegmentNotMatchConditions }, optional: true, nullable: false + end + end +end diff --git a/lib/auth0/types/segment_starts_with_expression.rb b/lib/auth0/types/segment_starts_with_expression.rb new file mode 100644 index 000000000..cb242bfaf --- /dev/null +++ b/lib/auth0/types/segment_starts_with_expression.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class SegmentStartsWithExpression < Internal::Types::Model + field :starts_with, -> { Internal::Types::Array[String] }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/segment_type_enum.rb b/lib/auth0/types/segment_type_enum.rb new file mode 100644 index 000000000..be7404fd6 --- /dev/null +++ b/lib/auth0/types/segment_type_enum.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Auth0 + module Types + module SegmentTypeEnum + extend Auth0::Internal::Types::Enum + + SELF = "self" + AUTH0 = "auth0" + end + end +end diff --git a/lib/auth0/types/segment_type_filter_enum.rb b/lib/auth0/types/segment_type_filter_enum.rb new file mode 100644 index 000000000..5dafef798 --- /dev/null +++ b/lib/auth0/types/segment_type_filter_enum.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Auth0 + module Types + module SegmentTypeFilterEnum + extend Auth0::Internal::Types::Enum + + AUTH0 = "auth0" + SELF = "self" + end + end +end diff --git a/lib/auth0/types/update_experiment_response_content.rb b/lib/auth0/types/update_experiment_response_content.rb new file mode 100644 index 000000000..226429d4e --- /dev/null +++ b/lib/auth0/types/update_experiment_response_content.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class UpdateExperimentResponseContent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :feature_flag_id, -> { String }, optional: false, nullable: false + + field :feature_flag_name, -> { String }, optional: true, nullable: false + + field :authentication_flow, -> { String }, optional: false, nullable: false + + field :allocation_strategy, -> { Auth0::Types::AllocationStrategyEnum }, optional: false, nullable: false + + field :status, -> { Auth0::Types::ExperimentStatusEnum }, optional: false, nullable: false + + field :is_valid, -> { Internal::Types::Boolean }, optional: false, nullable: false + + field :default_config, -> { Auth0::Types::DefaultConfigEnum }, optional: true, nullable: false + + field :feature_flag_snapshot, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false + + field :allocations, -> { Internal::Types::Array[Auth0::Types::AllocationItem] }, optional: false, nullable: false + + field :editable_fields, -> { Internal::Types::Array[String] }, optional: false, nullable: false + + field :levels, -> { Internal::Types::Array[Integer] }, optional: true, nullable: false + + field :current_level, -> { Integer }, optional: true, nullable: false + + field :started_at, -> { String }, optional: true, nullable: false + + field :ended_at, -> { String }, optional: true, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/update_experiment_status_response_content.rb b/lib/auth0/types/update_experiment_status_response_content.rb new file mode 100644 index 000000000..2393d83b7 --- /dev/null +++ b/lib/auth0/types/update_experiment_status_response_content.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class UpdateExperimentStatusResponseContent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :feature_flag_id, -> { String }, optional: false, nullable: false + + field :feature_flag_name, -> { String }, optional: true, nullable: false + + field :authentication_flow, -> { String }, optional: false, nullable: false + + field :allocation_strategy, -> { Auth0::Types::AllocationStrategyEnum }, optional: false, nullable: false + + field :status, -> { Auth0::Types::ExperimentStatusEnum }, optional: false, nullable: false + + field :is_valid, -> { Internal::Types::Boolean }, optional: false, nullable: false + + field :default_config, -> { Auth0::Types::DefaultConfigEnum }, optional: true, nullable: false + + field :feature_flag_snapshot, -> { Internal::Types::Hash[String, Object] }, optional: true, nullable: false + + field :allocations, -> { Internal::Types::Array[Auth0::Types::AllocationItem] }, optional: false, nullable: false + + field :editable_fields, -> { Internal::Types::Array[String] }, optional: false, nullable: false + + field :levels, -> { Internal::Types::Array[Integer] }, optional: true, nullable: false + + field :current_level, -> { Integer }, optional: true, nullable: false + + field :started_at, -> { String }, optional: true, nullable: false + + field :ended_at, -> { String }, optional: true, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/update_feature_flag_parameters.rb b/lib/auth0/types/update_feature_flag_parameters.rb new file mode 100644 index 000000000..f653c2ecb --- /dev/null +++ b/lib/auth0/types/update_feature_flag_parameters.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Auth0 + module Types + module UpdateFeatureFlagParameters + # UpdateFeatureFlagParameters is an alias for Hash + + # @option str [String] + # + # @return [untyped] + def self.load(str) + ::JSON.parse(str) + end + + # @option value [untyped] + # + # @return [String] + def self.dump(value) + ::JSON.generate(value) + end + end + end +end diff --git a/lib/auth0/types/update_feature_flag_response_content.rb b/lib/auth0/types/update_feature_flag_response_content.rb new file mode 100644 index 000000000..68fd26971 --- /dev/null +++ b/lib/auth0/types/update_feature_flag_response_content.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class UpdateFeatureFlagResponseContent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :type, -> { Auth0::Types::FeatureFlagTypeEnum }, optional: false, nullable: false + + field :status, -> { Auth0::Types::FeatureFlagStatusEnum }, optional: false, nullable: false + + field :parameters, -> { Internal::Types::Hash[String, Auth0::Types::FeatureFlagConfigParam] }, optional: true, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/update_feature_flag_status_response_content.rb b/lib/auth0/types/update_feature_flag_status_response_content.rb new file mode 100644 index 000000000..98e22f490 --- /dev/null +++ b/lib/auth0/types/update_feature_flag_status_response_content.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class UpdateFeatureFlagStatusResponseContent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :type, -> { Auth0::Types::FeatureFlagTypeEnum }, optional: false, nullable: false + + field :status, -> { Auth0::Types::FeatureFlagStatusEnum }, optional: false, nullable: false + + field :parameters, -> { Internal::Types::Hash[String, Auth0::Types::FeatureFlagConfigParam] }, optional: true, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/update_resource_server_response_content.rb b/lib/auth0/types/update_resource_server_response_content.rb index 8be63269d..52ee9e306 100644 --- a/lib/auth0/types/update_resource_server_response_content.rb +++ b/lib/auth0/types/update_resource_server_response_content.rb @@ -41,6 +41,8 @@ class UpdateResourceServerResponseContent < Internal::Types::Model field :consent_policy, -> { Auth0::Types::ResourceServerConsentPolicyEnum }, optional: true, nullable: false + field :require_consent_non_repudiation, -> { Internal::Types::Boolean }, optional: true, nullable: false + field :authorization_details, -> { Internal::Types::Array[Object] }, optional: true, nullable: false field :proof_of_possession, -> { Auth0::Types::ResourceServerProofOfPossession }, optional: true, nullable: false diff --git a/lib/auth0/types/update_segment_response_content.rb b/lib/auth0/types/update_segment_response_content.rb new file mode 100644 index 000000000..c76a00a2a --- /dev/null +++ b/lib/auth0/types/update_segment_response_content.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class UpdateSegmentResponseContent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :type, -> { Auth0::Types::SegmentTypeEnum }, optional: false, nullable: false + + field :rules, -> { Internal::Types::Array[Auth0::Types::SegmentRule] }, optional: false, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/update_variation_overrides_map.rb b/lib/auth0/types/update_variation_overrides_map.rb new file mode 100644 index 000000000..269bd3b2c --- /dev/null +++ b/lib/auth0/types/update_variation_overrides_map.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Auth0 + module Types + module UpdateVariationOverridesMap + # UpdateVariationOverridesMap is an alias for Hash + + # @option str [String] + # + # @return [untyped] + def self.load(str) + ::JSON.parse(str) + end + + # @option value [untyped] + # + # @return [String] + def self.dump(value) + ::JSON.generate(value) + end + end + end +end diff --git a/lib/auth0/types/update_variation_response_content.rb b/lib/auth0/types/update_variation_response_content.rb new file mode 100644 index 000000000..8fec15a62 --- /dev/null +++ b/lib/auth0/types/update_variation_response_content.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class UpdateVariationResponseContent < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :feature_flag_id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :overrides, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/validate_experiment_response_content.rb b/lib/auth0/types/validate_experiment_response_content.rb new file mode 100644 index 000000000..0b7116124 --- /dev/null +++ b/lib/auth0/types/validate_experiment_response_content.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class ValidateExperimentResponseContent < Internal::Types::Model + field :is_valid, -> { Internal::Types::Boolean }, optional: false, nullable: false + + field :errors, -> { Internal::Types::Array[Auth0::Types::ExperimentValidationError] }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/variation.rb b/lib/auth0/types/variation.rb new file mode 100644 index 000000000..c1edd5368 --- /dev/null +++ b/lib/auth0/types/variation.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Auth0 + module Types + class Variation < Internal::Types::Model + field :id, -> { String }, optional: false, nullable: false + + field :feature_flag_id, -> { String }, optional: false, nullable: false + + field :name, -> { String }, optional: false, nullable: false + + field :description, -> { String }, optional: true, nullable: false + + field :overrides, -> { Internal::Types::Hash[String, Object] }, optional: false, nullable: false + + field :created_at, -> { String }, optional: false, nullable: false + + field :updated_at, -> { String }, optional: false, nullable: false + end + end +end diff --git a/lib/auth0/types/variation_overrides_map.rb b/lib/auth0/types/variation_overrides_map.rb new file mode 100644 index 000000000..0911dca42 --- /dev/null +++ b/lib/auth0/types/variation_overrides_map.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module Auth0 + module Types + module VariationOverridesMap + # VariationOverridesMap is an alias for Hash + + # @option str [String] + # + # @return [untyped] + def self.load(str) + ::JSON.parse(str) + end + + # @option value [untyped] + # + # @return [String] + def self.dump(value) + ::JSON.generate(value) + end + end + end +end diff --git a/lib/auth0/users/client.rb b/lib/auth0/users/client.rb index 3afff4b67..9ec124966 100644 --- a/lib/auth0/users/client.rb +++ b/lib/auth0/users/client.rb @@ -10,28 +10,35 @@ def initialize(client:) @client = client end - # Retrieve details of users. It is possible to: + # This endpoint retrieves details of users. It's best suited to interactive, best-effort search and lookups where + # slightly stale results are acceptable. With it, you can: # - # - Specify a search criteria for users + # - Specify search criteria for users # - Sort the users to be returned # - Select the fields to be returned # - Specify the number of users to retrieve per page and the page index # - # - # - # The `q` query parameter can be used to get users that match the specified criteria [using query string - # syntax.](https://auth0.com/docs/users/search/v3/query-syntax) - # - # [Learn more about searching for users.](https://auth0.com/docs/users/search/v3) - # - # Read about [best practices](https://auth0.com/docs/users/search/best-practices) when working with the API - # endpoints for retrieving users. - # - # - # - # Auth0 limits the number of users you can return. If you exceed this threshold, please redefine your search, use - # the [export job](https://auth0.com/docs/api/management/v2#!/Jobs/post_users_exports), or the [User Import / - # Export](https://auth0.com/docs/extensions/user-import-export) extension. + # This endpoint is **not suited for use in critical paths**. It is eventually consistent and runs under a short + # (~2 second) query time limit, so results can be stale and heavy queries can return a 503. + # + # - Do not use this endpoint for authentication, account linking, or logic inside login-flow Actions. Instead, + # [look users up directly by ID or + # email](https://auth0.com/docs/manage-users/user-search/get-users-by-id-or-email#management-api) to get their + # current state. + # - Do not use this endpoint to keep an external system in sync with user data. Instead, subscribe to [Event + # Streams](https://auth0.com/docs/customize/events/sync-data-across-systems) to receive every change as it + # happens. + # - Do not use this endpoint to enumerate or export your entire user base. Instead, run a [bulk user + # export](https://auth0.com/docs/manage-users/user-migration/bulk-user-exports) to retrieve the full set. + # + # Use the `q` query parameter to match users with [query string + # syntax](https://auth0.com/docs/manage-users/user-search/user-search-query-syntax). For full instructions and + # guidance, see [How to List and Search + # Users](https://auth0.com/docs/manage-users/user-search/list-and-search-users). + # + # For efficient queries, prefer indexed top-level fields and exact matches. Certain kinds of queries can be slow + # and may time out, such as filtering on freeform or multi-value fields (like user-defined attributes in + # `app_metadata` or `user_metadata`) or using leading wildcards. # # @param request_options [Hash] # @param params [Hash] diff --git a/test/wire/experimentation_experiments_test.rb b/test/wire/experimentation_experiments_test.rb index 77fe5aefe..ef464253b 100644 --- a/test/wire/experimentation_experiments_test.rb +++ b/test/wire/experimentation_experiments_test.rb @@ -12,6 +12,118 @@ def setup ) end + def test_experimentation_experiments_list_with_wiremock + test_id = "experimentation.experiments.list.0" + + result = @client.experimentation.experiments.list( + from: "from", + take: 1, + status: "draft", + authentication_flow: "authentication_flow", + feature_flag_id: "feature_flag_id", + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.experiments.list.0" + } + } + ) + result.pages.next_page + + verify_request_count( + test_id: test_id, + method: "GET", + url_path: "/experimentation/experiments", + query_params: nil, + expected: 1 + ) + end + + def test_experimentation_experiments_create_with_wiremock + test_id = "experimentation.experiments.create.0" + + @client.experimentation.experiments.create( + name: "name", + feature_flag_id: "feature_flag_id", + authentication_flow: "authentication", + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.experiments.create.0" + } + } + ) + + verify_request_count( + test_id: test_id, + method: "POST", + url_path: "/experimentation/experiments", + query_params: nil, + expected: 1 + ) + end + + def test_experimentation_experiments_get_with_wiremock + test_id = "experimentation.experiments.get.0" + + @client.experimentation.experiments.get( + id: "id", + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.experiments.get.0" + } + } + ) + + verify_request_count( + test_id: test_id, + method: "GET", + url_path: "/experimentation/experiments/id", + query_params: nil, + expected: 1 + ) + end + + def test_experimentation_experiments_delete_with_wiremock + test_id = "experimentation.experiments.delete.0" + + @client.experimentation.experiments.delete( + id: "id", + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.experiments.delete.0" + } + } + ) + + verify_request_count( + test_id: test_id, + method: "DELETE", + url_path: "/experimentation/experiments/id", + query_params: nil, + expected: 1 + ) + end + + def test_experimentation_experiments_update_with_wiremock + test_id = "experimentation.experiments.update.0" + + @client.experimentation.experiments.update( + id: "id", + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.experiments.update.0" + } + } + ) + + verify_request_count( + test_id: test_id, + method: "PATCH", + url_path: "/experimentation/experiments/id", + query_params: nil, + expected: 1 + ) + end + def test_experimentation_experiments_advance_ramp_with_wiremock test_id = "experimentation.experiments.advance_ramp.0" @@ -33,4 +145,47 @@ def test_experimentation_experiments_advance_ramp_with_wiremock expected: 1 ) end + + def test_experimentation_experiments_update_status_with_wiremock + test_id = "experimentation.experiments.update_status.0" + + @client.experimentation.experiments.update_status( + id: "id", + status: "active", + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.experiments.update_status.0" + } + } + ) + + verify_request_count( + test_id: test_id, + method: "POST", + url_path: "/experimentation/experiments/id/status", + query_params: nil, + expected: 1 + ) + end + + def test_experimentation_experiments_validate_with_wiremock + test_id = "experimentation.experiments.validate.0" + + @client.experimentation.experiments.validate( + id: "id", + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.experiments.validate.0" + } + } + ) + + verify_request_count( + test_id: test_id, + method: "POST", + url_path: "/experimentation/experiments/id/validate", + query_params: nil, + expected: 1 + ) + end end diff --git a/test/wire/experimentation_feature_flags_test.rb b/test/wire/experimentation_feature_flags_test.rb new file mode 100644 index 000000000..942ab6ec3 --- /dev/null +++ b/test/wire/experimentation_feature_flags_test.rb @@ -0,0 +1,146 @@ +# frozen_string_literal: true + +require_relative "wiremock_test_case" + +class ExperimentationFeatureFlagsWireTest < WireMockTestCase + def setup + super + + @client = Auth0::Management.new( + token: "", + base_url: WIREMOCK_BASE_URL + ) + end + + def test_experimentation_feature_flags_list_with_wiremock + test_id = "experimentation.feature_flags.list.0" + + result = @client.experimentation.feature_flags.list( + from: "from", + take: 1, + type: "auth0", + status: "draft", + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.feature_flags.list.0" + } + } + ) + result.pages.next_page + + verify_request_count( + test_id: test_id, + method: "GET", + url_path: "/experimentation/feature-flags", + query_params: nil, + expected: 1 + ) + end + + def test_experimentation_feature_flags_create_with_wiremock + test_id = "experimentation.feature_flags.create.0" + + @client.experimentation.feature_flags.create( + name: "name", + parameters: {}, + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.feature_flags.create.0" + } + } + ) + + verify_request_count( + test_id: test_id, + method: "POST", + url_path: "/experimentation/feature-flags", + query_params: nil, + expected: 1 + ) + end + + def test_experimentation_feature_flags_get_with_wiremock + test_id = "experimentation.feature_flags.get.0" + + @client.experimentation.feature_flags.get( + id: "id", + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.feature_flags.get.0" + } + } + ) + + verify_request_count( + test_id: test_id, + method: "GET", + url_path: "/experimentation/feature-flags/id", + query_params: nil, + expected: 1 + ) + end + + def test_experimentation_feature_flags_delete_with_wiremock + test_id = "experimentation.feature_flags.delete.0" + + @client.experimentation.feature_flags.delete( + id: "id", + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.feature_flags.delete.0" + } + } + ) + + verify_request_count( + test_id: test_id, + method: "DELETE", + url_path: "/experimentation/feature-flags/id", + query_params: nil, + expected: 1 + ) + end + + def test_experimentation_feature_flags_update_with_wiremock + test_id = "experimentation.feature_flags.update.0" + + @client.experimentation.feature_flags.update( + id: "id", + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.feature_flags.update.0" + } + } + ) + + verify_request_count( + test_id: test_id, + method: "PATCH", + url_path: "/experimentation/feature-flags/id", + query_params: nil, + expected: 1 + ) + end + + def test_experimentation_feature_flags_update_status_with_wiremock + test_id = "experimentation.feature_flags.update_status.0" + + @client.experimentation.feature_flags.update_status( + id: "id", + status: "draft", + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.feature_flags.update_status.0" + } + } + ) + + verify_request_count( + test_id: test_id, + method: "POST", + url_path: "/experimentation/feature-flags/id/status", + query_params: nil, + expected: 1 + ) + end +end diff --git a/test/wire/experimentation_feature_flags_variations_test.rb b/test/wire/experimentation_feature_flags_variations_test.rb new file mode 100644 index 000000000..20292e364 --- /dev/null +++ b/test/wire/experimentation_feature_flags_variations_test.rb @@ -0,0 +1,126 @@ +# frozen_string_literal: true + +require_relative "wiremock_test_case" + +class ExperimentationFeatureFlagsVariationsWireTest < WireMockTestCase + def setup + super + + @client = Auth0::Management.new( + token: "", + base_url: WIREMOCK_BASE_URL + ) + end + + def test_experimentation_feature_flags_variations_list_with_wiremock + test_id = "experimentation.feature_flags.variations.list.0" + + @client.experimentation.feature_flags.variations.list( + id: "id", + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.feature_flags.variations.list.0" + } + } + ) + + verify_request_count( + test_id: test_id, + method: "GET", + url_path: "/experimentation/feature-flags/id/variations", + query_params: nil, + expected: 1 + ) + end + + def test_experimentation_feature_flags_variations_create_with_wiremock + test_id = "experimentation.feature_flags.variations.create.0" + + @client.experimentation.feature_flags.variations.create( + id: "id", + name: "name", + overrides: { + key: "value" + }, + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.feature_flags.variations.create.0" + } + } + ) + + verify_request_count( + test_id: test_id, + method: "POST", + url_path: "/experimentation/feature-flags/id/variations", + query_params: nil, + expected: 1 + ) + end + + def test_experimentation_feature_flags_variations_get_with_wiremock + test_id = "experimentation.feature_flags.variations.get.0" + + @client.experimentation.feature_flags.variations.get( + id: "id", + vid: "vid", + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.feature_flags.variations.get.0" + } + } + ) + + verify_request_count( + test_id: test_id, + method: "GET", + url_path: "/experimentation/feature-flags/id/variations/vid", + query_params: nil, + expected: 1 + ) + end + + def test_experimentation_feature_flags_variations_delete_with_wiremock + test_id = "experimentation.feature_flags.variations.delete.0" + + @client.experimentation.feature_flags.variations.delete( + id: "id", + vid: "vid", + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.feature_flags.variations.delete.0" + } + } + ) + + verify_request_count( + test_id: test_id, + method: "DELETE", + url_path: "/experimentation/feature-flags/id/variations/vid", + query_params: nil, + expected: 1 + ) + end + + def test_experimentation_feature_flags_variations_update_with_wiremock + test_id = "experimentation.feature_flags.variations.update.0" + + @client.experimentation.feature_flags.variations.update( + id: "id", + vid: "vid", + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.feature_flags.variations.update.0" + } + } + ) + + verify_request_count( + test_id: test_id, + method: "PATCH", + url_path: "/experimentation/feature-flags/id/variations/vid", + query_params: nil, + expected: 1 + ) + end +end diff --git a/test/wire/experimentation_segments_test.rb b/test/wire/experimentation_segments_test.rb new file mode 100644 index 000000000..da65a84a2 --- /dev/null +++ b/test/wire/experimentation_segments_test.rb @@ -0,0 +1,123 @@ +# frozen_string_literal: true + +require_relative "wiremock_test_case" + +class ExperimentationSegmentsWireTest < WireMockTestCase + def setup + super + + @client = Auth0::Management.new( + token: "", + base_url: WIREMOCK_BASE_URL + ) + end + + def test_experimentation_segments_list_with_wiremock + test_id = "experimentation.segments.list.0" + + result = @client.experimentation.segments.list( + from: "from", + take: 1, + type: "auth0", + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.segments.list.0" + } + } + ) + result.pages.next_page + + verify_request_count( + test_id: test_id, + method: "GET", + url_path: "/experimentation/segments", + query_params: nil, + expected: 1 + ) + end + + def test_experimentation_segments_create_with_wiremock + test_id = "experimentation.segments.create.0" + + @client.experimentation.segments.create( + name: "name", + rules: [{}], + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.segments.create.0" + } + } + ) + + verify_request_count( + test_id: test_id, + method: "POST", + url_path: "/experimentation/segments", + query_params: nil, + expected: 1 + ) + end + + def test_experimentation_segments_get_with_wiremock + test_id = "experimentation.segments.get.0" + + @client.experimentation.segments.get( + id: "id", + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.segments.get.0" + } + } + ) + + verify_request_count( + test_id: test_id, + method: "GET", + url_path: "/experimentation/segments/id", + query_params: nil, + expected: 1 + ) + end + + def test_experimentation_segments_delete_with_wiremock + test_id = "experimentation.segments.delete.0" + + @client.experimentation.segments.delete( + id: "id", + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.segments.delete.0" + } + } + ) + + verify_request_count( + test_id: test_id, + method: "DELETE", + url_path: "/experimentation/segments/id", + query_params: nil, + expected: 1 + ) + end + + def test_experimentation_segments_update_with_wiremock + test_id = "experimentation.segments.update.0" + + @client.experimentation.segments.update( + id: "id", + request_options: { + additional_headers: { + "X-Test-Id" => "experimentation.segments.update.0" + } + } + ) + + verify_request_count( + test_id: test_id, + method: "PATCH", + url_path: "/experimentation/segments/id", + query_params: nil, + expected: 1 + ) + end +end diff --git a/test/wire/organizations_organization_template_test.rb b/test/wire/organizations_organization_template_test.rb deleted file mode 100644 index e408b5f42..000000000 --- a/test/wire/organizations_organization_template_test.rb +++ /dev/null @@ -1,79 +0,0 @@ -# frozen_string_literal: true - -require_relative "wiremock_test_case" - -class OrganizationsOrganizationTemplateWireTest < WireMockTestCase - def setup - super - - @client = Auth0::Management.new( - token: "", - base_url: WIREMOCK_BASE_URL - ) - end - - def test_organizations_organization_template_get_with_wiremock - test_id = "organizations.organization_template.get.0" - - @client.organizations.organization_template.get( - id: "id", - request_options: { - additional_headers: { - "X-Test-Id" => "organizations.organization_template.get.0" - } - } - ) - - verify_request_count( - test_id: test_id, - method: "GET", - url_path: "/organizations/id/organization-templates", - query_params: nil, - expected: 1 - ) - end - - def test_organizations_organization_template_assign_organization_template_with_wiremock - test_id = "organizations.organization_template.assign_organization_template.0" - - @client.organizations.organization_template.assign_organization_template( - id: "id", - template_id: "template_id", - request_options: { - additional_headers: { - "X-Test-Id" => "organizations.organization_template.assign_organization_template.0" - } - } - ) - - verify_request_count( - test_id: test_id, - method: "PUT", - url_path: "/organizations/id/organization-templates/template_id", - query_params: nil, - expected: 1 - ) - end - - def test_organizations_organization_template_unassign_organization_template_with_wiremock - test_id = "organizations.organization_template.unassign_organization_template.0" - - @client.organizations.organization_template.unassign_organization_template( - id: "id", - template_id: "template_id", - request_options: { - additional_headers: { - "X-Test-Id" => "organizations.organization_template.unassign_organization_template.0" - } - } - ) - - verify_request_count( - test_id: test_id, - method: "DELETE", - url_path: "/organizations/id/organization-templates/template_id", - query_params: nil, - expected: 1 - ) - end -end diff --git a/wiremock/wiremock-mappings.json b/wiremock/wiremock-mappings.json index ac40146ab..8d6e75eff 100644 --- a/wiremock/wiremock-mappings.json +++ b/wiremock/wiremock-mappings.json @@ -4532,7 +4532,7 @@ }, "response": { "status": 200, - "body": "{\n \"start\": 1.1,\n \"limit\": 1.1,\n \"total\": 1.1,\n \"resource_servers\": [\n {\n \"id\": \"id\",\n \"name\": \"name\",\n \"is_system\": true,\n \"identifier\": \"identifier\",\n \"scopes\": [\n {\n \"value\": \"value\"\n }\n ],\n \"signing_alg\": \"HS256\",\n \"signing_secret\": \"signing_secret\",\n \"allow_offline_access\": true,\n \"allow_online_access\": true,\n \"allow_online_access_with_ephemeral_sessions\": true,\n \"skip_consent_for_verifiable_first_party_clients\": true,\n \"token_lifetime\": 1,\n \"token_lifetime_for_web\": 1,\n \"enforce_policies\": true,\n \"token_lifetime_for_anonymous_access_tokens\": 1,\n \"token_dialect\": \"access_token\",\n \"token_encryption\": {\n \"format\": \"compact-nested-jwe\",\n \"encryption_key\": {\n \"alg\": \"RSA-OAEP-256\",\n \"pem\": \"pem\"\n }\n },\n \"consent_policy\": \"transactional-authorization-with-mfa\",\n \"proof_of_possession\": {\n \"mechanism\": \"mtls\",\n \"required\": true\n },\n \"authorization_policy\": {\n \"policy_id\": \"policy_id\"\n },\n \"client_id\": \"client_id\"\n }\n ]\n}", + "body": "{\n \"start\": 1.1,\n \"limit\": 1.1,\n \"total\": 1.1,\n \"resource_servers\": [\n {\n \"id\": \"id\",\n \"name\": \"name\",\n \"is_system\": true,\n \"identifier\": \"identifier\",\n \"scopes\": [\n {\n \"value\": \"value\"\n }\n ],\n \"signing_alg\": \"HS256\",\n \"signing_secret\": \"signing_secret\",\n \"allow_offline_access\": true,\n \"allow_online_access\": true,\n \"allow_online_access_with_ephemeral_sessions\": true,\n \"skip_consent_for_verifiable_first_party_clients\": true,\n \"token_lifetime\": 1,\n \"token_lifetime_for_web\": 1,\n \"enforce_policies\": true,\n \"token_lifetime_for_anonymous_access_tokens\": 1,\n \"token_dialect\": \"access_token\",\n \"token_encryption\": {\n \"format\": \"compact-nested-jwe\",\n \"encryption_key\": {\n \"alg\": \"RSA-OAEP-256\",\n \"pem\": \"pem\"\n }\n },\n \"consent_policy\": \"transactional-authorization-with-mfa\",\n \"require_consent_non_repudiation\": true,\n \"proof_of_possession\": {\n \"mechanism\": \"mtls\",\n \"required\": true\n },\n \"authorization_policy\": {\n \"policy_id\": \"policy_id\"\n },\n \"client_id\": \"client_id\"\n }\n ]\n}", "headers": { "Content-Type": "application/json" } @@ -4564,7 +4564,7 @@ }, "response": { "status": 201, - "body": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"is_system\": true,\n \"identifier\": \"identifier\",\n \"scopes\": [\n {\n \"value\": \"value\",\n \"description\": \"description\"\n }\n ],\n \"signing_alg\": \"HS256\",\n \"signing_secret\": \"signing_secret\",\n \"allow_offline_access\": true,\n \"allow_online_access\": true,\n \"allow_online_access_with_ephemeral_sessions\": true,\n \"skip_consent_for_verifiable_first_party_clients\": true,\n \"token_lifetime\": 1,\n \"token_lifetime_for_web\": 1,\n \"enforce_policies\": true,\n \"token_lifetime_for_anonymous_access_tokens\": 1,\n \"token_dialect\": \"access_token\",\n \"access_token\": {\n \"claims_mapping\": {\n \"custom_claims\": [\n {\n \"name\": \"name\",\n \"expression\": \"expression\"\n }\n ]\n }\n },\n \"token_encryption\": {\n \"format\": \"compact-nested-jwe\",\n \"encryption_key\": {\n \"name\": \"name\",\n \"alg\": \"RSA-OAEP-256\",\n \"kid\": \"kid\",\n \"pem\": \"pem\"\n }\n },\n \"consent_policy\": \"transactional-authorization-with-mfa\",\n \"authorization_details\": [\n {\n \"key\": \"value\"\n }\n ],\n \"proof_of_possession\": {\n \"mechanism\": \"mtls\",\n \"required\": true,\n \"required_for\": \"public_clients\"\n },\n \"subject_type_authorization\": {\n \"user\": {\n \"policy\": \"allow_all\"\n },\n \"client\": {\n \"policy\": \"deny_all\"\n },\n \"anonymous_user\": {\n \"policy\": \"deny_all\"\n }\n },\n \"authorization_policy\": {\n \"policy_id\": \"policy_id\"\n },\n \"client_id\": \"client_id\"\n}", + "body": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"is_system\": true,\n \"identifier\": \"identifier\",\n \"scopes\": [\n {\n \"value\": \"value\",\n \"description\": \"description\"\n }\n ],\n \"signing_alg\": \"HS256\",\n \"signing_secret\": \"signing_secret\",\n \"allow_offline_access\": true,\n \"allow_online_access\": true,\n \"allow_online_access_with_ephemeral_sessions\": true,\n \"skip_consent_for_verifiable_first_party_clients\": true,\n \"token_lifetime\": 1,\n \"token_lifetime_for_web\": 1,\n \"enforce_policies\": true,\n \"token_lifetime_for_anonymous_access_tokens\": 1,\n \"token_dialect\": \"access_token\",\n \"access_token\": {\n \"claims_mapping\": {\n \"custom_claims\": [\n {\n \"name\": \"name\",\n \"expression\": \"expression\"\n }\n ]\n }\n },\n \"token_encryption\": {\n \"format\": \"compact-nested-jwe\",\n \"encryption_key\": {\n \"name\": \"name\",\n \"alg\": \"RSA-OAEP-256\",\n \"kid\": \"kid\",\n \"pem\": \"pem\"\n }\n },\n \"consent_policy\": \"transactional-authorization-with-mfa\",\n \"require_consent_non_repudiation\": true,\n \"authorization_details\": [\n {\n \"key\": \"value\"\n }\n ],\n \"proof_of_possession\": {\n \"mechanism\": \"mtls\",\n \"required\": true,\n \"required_for\": \"public_clients\"\n },\n \"subject_type_authorization\": {\n \"user\": {\n \"policy\": \"allow_all\"\n },\n \"client\": {\n \"policy\": \"deny_all\"\n },\n \"anonymous_user\": {\n \"policy\": \"deny_all\"\n }\n },\n \"authorization_policy\": {\n \"policy_id\": \"policy_id\"\n },\n \"client_id\": \"client_id\"\n}", "headers": { "Content-Type": "application/json" } @@ -4618,7 +4618,7 @@ }, "response": { "status": 200, - "body": "{\n \"resource_servers\": [\n {\n \"id\": \"id\",\n \"name\": \"name\",\n \"is_system\": true,\n \"identifier\": \"identifier\",\n \"scopes\": [\n {\n \"value\": \"value\"\n }\n ],\n \"signing_alg\": \"HS256\",\n \"allow_offline_access\": true,\n \"allow_online_access\": true,\n \"allow_online_access_with_ephemeral_sessions\": true,\n \"skip_consent_for_verifiable_first_party_clients\": true,\n \"token_lifetime\": 1,\n \"token_lifetime_for_web\": 1,\n \"enforce_policies\": true,\n \"token_lifetime_for_anonymous_access_tokens\": 1,\n \"token_dialect\": \"access_token\",\n \"token_encryption\": {\n \"format\": \"compact-nested-jwe\",\n \"encryption_key\": {\n \"alg\": \"RSA-OAEP-256\",\n \"pem\": \"pem\"\n }\n },\n \"consent_policy\": \"transactional-authorization-with-mfa\",\n \"proof_of_possession\": {\n \"mechanism\": \"mtls\",\n \"required\": true\n },\n \"authorization_policy\": {\n \"policy_id\": \"policy_id\"\n },\n \"client_id\": \"client_id\"\n }\n ],\n \"next\": \"next\"\n}", + "body": "{\n \"resource_servers\": [\n {\n \"id\": \"id\",\n \"name\": \"name\",\n \"is_system\": true,\n \"identifier\": \"identifier\",\n \"scopes\": [\n {\n \"value\": \"value\"\n }\n ],\n \"signing_alg\": \"HS256\",\n \"allow_offline_access\": true,\n \"allow_online_access\": true,\n \"allow_online_access_with_ephemeral_sessions\": true,\n \"skip_consent_for_verifiable_first_party_clients\": true,\n \"token_lifetime\": 1,\n \"token_lifetime_for_web\": 1,\n \"enforce_policies\": true,\n \"token_lifetime_for_anonymous_access_tokens\": 1,\n \"token_dialect\": \"access_token\",\n \"token_encryption\": {\n \"format\": \"compact-nested-jwe\",\n \"encryption_key\": {\n \"alg\": \"RSA-OAEP-256\",\n \"pem\": \"pem\"\n }\n },\n \"consent_policy\": \"transactional-authorization-with-mfa\",\n \"require_consent_non_repudiation\": true,\n \"proof_of_possession\": {\n \"mechanism\": \"mtls\",\n \"required\": true\n },\n \"authorization_policy\": {\n \"policy_id\": \"policy_id\"\n },\n \"client_id\": \"client_id\"\n }\n ],\n \"next\": \"next\"\n}", "headers": { "Content-Type": "application/json" } @@ -4660,7 +4660,7 @@ }, "response": { "status": 200, - "body": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"is_system\": true,\n \"identifier\": \"identifier\",\n \"scopes\": [\n {\n \"value\": \"value\",\n \"description\": \"description\"\n }\n ],\n \"signing_alg\": \"HS256\",\n \"signing_secret\": \"signing_secret\",\n \"allow_offline_access\": true,\n \"allow_online_access\": true,\n \"allow_online_access_with_ephemeral_sessions\": true,\n \"skip_consent_for_verifiable_first_party_clients\": true,\n \"token_lifetime\": 1,\n \"token_lifetime_for_web\": 1,\n \"enforce_policies\": true,\n \"token_lifetime_for_anonymous_access_tokens\": 1,\n \"token_dialect\": \"access_token\",\n \"access_token\": {\n \"claims_mapping\": {\n \"custom_claims\": [\n {\n \"name\": \"name\",\n \"expression\": \"expression\"\n }\n ]\n }\n },\n \"token_encryption\": {\n \"format\": \"compact-nested-jwe\",\n \"encryption_key\": {\n \"name\": \"name\",\n \"alg\": \"RSA-OAEP-256\",\n \"kid\": \"kid\",\n \"pem\": \"pem\"\n }\n },\n \"consent_policy\": \"transactional-authorization-with-mfa\",\n \"authorization_details\": [\n {\n \"key\": \"value\"\n }\n ],\n \"proof_of_possession\": {\n \"mechanism\": \"mtls\",\n \"required\": true,\n \"required_for\": \"public_clients\"\n },\n \"subject_type_authorization\": {\n \"user\": {\n \"policy\": \"allow_all\"\n },\n \"client\": {\n \"policy\": \"deny_all\"\n },\n \"anonymous_user\": {\n \"policy\": \"deny_all\"\n }\n },\n \"authorization_policy\": {\n \"policy_id\": \"policy_id\"\n },\n \"client_id\": \"client_id\"\n}", + "body": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"is_system\": true,\n \"identifier\": \"identifier\",\n \"scopes\": [\n {\n \"value\": \"value\",\n \"description\": \"description\"\n }\n ],\n \"signing_alg\": \"HS256\",\n \"signing_secret\": \"signing_secret\",\n \"allow_offline_access\": true,\n \"allow_online_access\": true,\n \"allow_online_access_with_ephemeral_sessions\": true,\n \"skip_consent_for_verifiable_first_party_clients\": true,\n \"token_lifetime\": 1,\n \"token_lifetime_for_web\": 1,\n \"enforce_policies\": true,\n \"token_lifetime_for_anonymous_access_tokens\": 1,\n \"token_dialect\": \"access_token\",\n \"access_token\": {\n \"claims_mapping\": {\n \"custom_claims\": [\n {\n \"name\": \"name\",\n \"expression\": \"expression\"\n }\n ]\n }\n },\n \"token_encryption\": {\n \"format\": \"compact-nested-jwe\",\n \"encryption_key\": {\n \"name\": \"name\",\n \"alg\": \"RSA-OAEP-256\",\n \"kid\": \"kid\",\n \"pem\": \"pem\"\n }\n },\n \"consent_policy\": \"transactional-authorization-with-mfa\",\n \"require_consent_non_repudiation\": true,\n \"authorization_details\": [\n {\n \"key\": \"value\"\n }\n ],\n \"proof_of_possession\": {\n \"mechanism\": \"mtls\",\n \"required\": true,\n \"required_for\": \"public_clients\"\n },\n \"subject_type_authorization\": {\n \"user\": {\n \"policy\": \"allow_all\"\n },\n \"client\": {\n \"policy\": \"deny_all\"\n },\n \"anonymous_user\": {\n \"policy\": \"deny_all\"\n }\n },\n \"authorization_policy\": {\n \"policy_id\": \"policy_id\"\n },\n \"client_id\": \"client_id\"\n}", "headers": { "Content-Type": "application/json" } @@ -4732,7 +4732,7 @@ }, "response": { "status": 201, - "body": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"is_system\": true,\n \"identifier\": \"identifier\",\n \"scopes\": [\n {\n \"value\": \"value\",\n \"description\": \"description\"\n }\n ],\n \"signing_alg\": \"HS256\",\n \"signing_secret\": \"signing_secret\",\n \"allow_offline_access\": true,\n \"allow_online_access\": true,\n \"allow_online_access_with_ephemeral_sessions\": true,\n \"skip_consent_for_verifiable_first_party_clients\": true,\n \"token_lifetime\": 1,\n \"token_lifetime_for_web\": 1,\n \"enforce_policies\": true,\n \"token_lifetime_for_anonymous_access_tokens\": 1,\n \"token_dialect\": \"access_token\",\n \"access_token\": {\n \"claims_mapping\": {\n \"custom_claims\": [\n {\n \"name\": \"name\",\n \"expression\": \"expression\"\n }\n ]\n }\n },\n \"token_encryption\": {\n \"format\": \"compact-nested-jwe\",\n \"encryption_key\": {\n \"name\": \"name\",\n \"alg\": \"RSA-OAEP-256\",\n \"kid\": \"kid\",\n \"pem\": \"pem\"\n }\n },\n \"consent_policy\": \"transactional-authorization-with-mfa\",\n \"authorization_details\": [\n {\n \"key\": \"value\"\n }\n ],\n \"proof_of_possession\": {\n \"mechanism\": \"mtls\",\n \"required\": true,\n \"required_for\": \"public_clients\"\n },\n \"subject_type_authorization\": {\n \"user\": {\n \"policy\": \"allow_all\"\n },\n \"client\": {\n \"policy\": \"deny_all\"\n },\n \"anonymous_user\": {\n \"policy\": \"deny_all\"\n }\n },\n \"authorization_policy\": {\n \"policy_id\": \"policy_id\"\n },\n \"client_id\": \"client_id\"\n}", + "body": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"is_system\": true,\n \"identifier\": \"identifier\",\n \"scopes\": [\n {\n \"value\": \"value\",\n \"description\": \"description\"\n }\n ],\n \"signing_alg\": \"HS256\",\n \"signing_secret\": \"signing_secret\",\n \"allow_offline_access\": true,\n \"allow_online_access\": true,\n \"allow_online_access_with_ephemeral_sessions\": true,\n \"skip_consent_for_verifiable_first_party_clients\": true,\n \"token_lifetime\": 1,\n \"token_lifetime_for_web\": 1,\n \"enforce_policies\": true,\n \"token_lifetime_for_anonymous_access_tokens\": 1,\n \"token_dialect\": \"access_token\",\n \"access_token\": {\n \"claims_mapping\": {\n \"custom_claims\": [\n {\n \"name\": \"name\",\n \"expression\": \"expression\"\n }\n ]\n }\n },\n \"token_encryption\": {\n \"format\": \"compact-nested-jwe\",\n \"encryption_key\": {\n \"name\": \"name\",\n \"alg\": \"RSA-OAEP-256\",\n \"kid\": \"kid\",\n \"pem\": \"pem\"\n }\n },\n \"consent_policy\": \"transactional-authorization-with-mfa\",\n \"require_consent_non_repudiation\": true,\n \"authorization_details\": [\n {\n \"key\": \"value\"\n }\n ],\n \"proof_of_possession\": {\n \"mechanism\": \"mtls\",\n \"required\": true,\n \"required_for\": \"public_clients\"\n },\n \"subject_type_authorization\": {\n \"user\": {\n \"policy\": \"allow_all\"\n },\n \"client\": {\n \"policy\": \"deny_all\"\n },\n \"anonymous_user\": {\n \"policy\": \"deny_all\"\n }\n },\n \"authorization_policy\": {\n \"policy_id\": \"policy_id\"\n },\n \"client_id\": \"client_id\"\n}", "headers": { "Content-Type": "application/json" } @@ -10061,11 +10061,746 @@ } } }, + { + "id": "bd75bcab-7889-4be2-8450-869b365b3fd6", + "name": "List experiments for the tenant. - default", + "request": { + "urlPathTemplate": "/experimentation/experiments", + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "queryParameters": { + "from": { + "equalTo": "from" + }, + "take": { + "equalTo": "1" + }, + "status": { + "equalTo": "draft" + }, + "authentication_flow": { + "equalTo": "authentication_flow" + }, + "feature_flag_id": { + "equalTo": "feature_flag_id" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"experiments\": [\n {\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"feature_flag_id\": \"feature_flag_id\",\n \"feature_flag_name\": \"feature_flag_name\",\n \"authentication_flow\": \"authentication_flow\",\n \"allocation_strategy\": \"percentage\",\n \"status\": \"draft\",\n \"is_valid\": true,\n \"default_config\": \"tenant\",\n \"feature_flag_snapshot\": {\n \"key\": \"value\"\n },\n \"allocations\": [\n {}\n ],\n \"editable_fields\": [\n \"editable_fields\"\n ],\n \"levels\": [\n 1\n ],\n \"current_level\": 1,\n \"started_at\": \"2024-01-15T09:30:00Z\",\n \"ended_at\": \"2024-01-15T09:30:00Z\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n ],\n \"next\": \"next\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "bd75bcab-7889-4be2-8450-869b365b3fd6", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + }, + "postServeActions": [] + }, + { + "id": "8134b9b9-4d8a-4951-a430-6287adc0df07", + "name": "Create an experiment for the Experiment Center. - default", + "request": { + "urlPathTemplate": "/experimentation/experiments", + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } + }, + "response": { + "status": 201, + "body": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"feature_flag_id\": \"feature_flag_id\",\n \"feature_flag_name\": \"feature_flag_name\",\n \"authentication_flow\": \"authentication_flow\",\n \"allocation_strategy\": \"percentage\",\n \"status\": \"draft\",\n \"is_valid\": true,\n \"default_config\": \"tenant\",\n \"feature_flag_snapshot\": {\n \"key\": \"value\"\n },\n \"allocations\": [\n {\n \"variation_id\": \"variation_id\",\n \"variation_name\": \"variation_name\",\n \"segment_id\": \"segment_id\",\n \"segment_name\": \"segment_name\",\n \"weight\": 1,\n \"priority\": 1,\n \"is_control\": true,\n \"is_fallback\": true,\n \"variation_snapshot\": {\n \"key\": \"value\"\n },\n \"segment_snapshot\": {\n \"key\": \"value\"\n }\n }\n ],\n \"editable_fields\": [\n \"editable_fields\"\n ],\n \"levels\": [\n 1\n ],\n \"current_level\": 1,\n \"started_at\": \"2024-01-15T09:30:00Z\",\n \"ended_at\": \"2024-01-15T09:30:00Z\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "8134b9b9-4d8a-4951-a430-6287adc0df07", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "274d4dba-dc33-4e37-8a85-e46845e575b9", + "name": "Get an experiment by ID. - default", + "request": { + "urlPathTemplate": "/experimentation/experiments/{id}", + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"feature_flag_id\": \"feature_flag_id\",\n \"feature_flag_name\": \"feature_flag_name\",\n \"authentication_flow\": \"authentication_flow\",\n \"allocation_strategy\": \"percentage\",\n \"status\": \"draft\",\n \"is_valid\": true,\n \"default_config\": \"tenant\",\n \"feature_flag_snapshot\": {\n \"key\": \"value\"\n },\n \"allocations\": [\n {\n \"variation_id\": \"variation_id\",\n \"variation_name\": \"variation_name\",\n \"segment_id\": \"segment_id\",\n \"segment_name\": \"segment_name\",\n \"weight\": 1,\n \"priority\": 1,\n \"is_control\": true,\n \"is_fallback\": true,\n \"variation_snapshot\": {\n \"key\": \"value\"\n },\n \"segment_snapshot\": {\n \"key\": \"value\"\n }\n }\n ],\n \"editable_fields\": [\n \"editable_fields\"\n ],\n \"levels\": [\n 1\n ],\n \"current_level\": 1,\n \"started_at\": \"2024-01-15T09:30:00Z\",\n \"ended_at\": \"2024-01-15T09:30:00Z\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "274d4dba-dc33-4e37-8a85-e46845e575b9", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "0029389e-1345-4549-9a99-7244a9975ed8", + "name": "Delete an experiment. - default", + "request": { + "urlPathTemplate": "/experimentation/experiments/{id}", + "method": "DELETE", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 200, + "body": "\"\"", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "0029389e-1345-4549-9a99-7244a9975ed8", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "2f052315-dd21-4094-b6d2-095774dabfe2", + "name": "Update an experiment. - default", + "request": { + "urlPathTemplate": "/experimentation/experiments/{id}", + "method": "PATCH", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"feature_flag_id\": \"feature_flag_id\",\n \"feature_flag_name\": \"feature_flag_name\",\n \"authentication_flow\": \"authentication_flow\",\n \"allocation_strategy\": \"percentage\",\n \"status\": \"draft\",\n \"is_valid\": true,\n \"default_config\": \"tenant\",\n \"feature_flag_snapshot\": {\n \"key\": \"value\"\n },\n \"allocations\": [\n {\n \"variation_id\": \"variation_id\",\n \"variation_name\": \"variation_name\",\n \"segment_id\": \"segment_id\",\n \"segment_name\": \"segment_name\",\n \"weight\": 1,\n \"priority\": 1,\n \"is_control\": true,\n \"is_fallback\": true,\n \"variation_snapshot\": {\n \"key\": \"value\"\n },\n \"segment_snapshot\": {\n \"key\": \"value\"\n }\n }\n ],\n \"editable_fields\": [\n \"editable_fields\"\n ],\n \"levels\": [\n 1\n ],\n \"current_level\": 1,\n \"started_at\": \"2024-01-15T09:30:00Z\",\n \"ended_at\": \"2024-01-15T09:30:00Z\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "2f052315-dd21-4094-b6d2-095774dabfe2", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, { "id": "82b4942b-e9d7-43ff-9167-27f89f0fb6e3", "name": "Advance the rollout level of a ramp experiment. - default", "request": { - "urlPathTemplate": "/experimentation/experiments/{id}/advance-ramp", + "urlPathTemplate": "/experimentation/experiments/{id}/advance-ramp", + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 201, + "body": "{\n \"experiment_id\": \"experiment_id\",\n \"from_level\": 1,\n \"to_level\": 1,\n \"current_level\": 1\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "82b4942b-e9d7-43ff-9167-27f89f0fb6e3", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "bad7af9d-5e89-4f47-b2d5-36b3d3560d91", + "name": "Transition an experiment to a new status. - default", + "request": { + "urlPathTemplate": "/experimentation/experiments/{id}/status", + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"feature_flag_id\": \"feature_flag_id\",\n \"feature_flag_name\": \"feature_flag_name\",\n \"authentication_flow\": \"authentication_flow\",\n \"allocation_strategy\": \"percentage\",\n \"status\": \"draft\",\n \"is_valid\": true,\n \"default_config\": \"tenant\",\n \"feature_flag_snapshot\": {\n \"key\": \"value\"\n },\n \"allocations\": [\n {\n \"variation_id\": \"variation_id\",\n \"variation_name\": \"variation_name\",\n \"segment_id\": \"segment_id\",\n \"segment_name\": \"segment_name\",\n \"weight\": 1,\n \"priority\": 1,\n \"is_control\": true,\n \"is_fallback\": true,\n \"variation_snapshot\": {\n \"key\": \"value\"\n },\n \"segment_snapshot\": {\n \"key\": \"value\"\n }\n }\n ],\n \"editable_fields\": [\n \"editable_fields\"\n ],\n \"levels\": [\n 1\n ],\n \"current_level\": 1,\n \"started_at\": \"2024-01-15T09:30:00Z\",\n \"ended_at\": \"2024-01-15T09:30:00Z\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "bad7af9d-5e89-4f47-b2d5-36b3d3560d91", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "20ae6e00-fdf5-43c3-a259-bcdbc0129c9d", + "name": "Validate an experiment. - default", + "request": { + "urlPathTemplate": "/experimentation/experiments/{id}/validate", + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"is_valid\": true,\n \"errors\": [\n {\n \"code\": \"code\",\n \"message\": \"message\"\n }\n ]\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "20ae6e00-fdf5-43c3-a259-bcdbc0129c9d", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "c7a5a02e-7595-4d10-b58d-5a96d5a3f7c8", + "name": "List feature flags for the tenant. - default", + "request": { + "urlPathTemplate": "/experimentation/feature-flags", + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "queryParameters": { + "from": { + "equalTo": "from" + }, + "take": { + "equalTo": "1" + }, + "type": { + "equalTo": "auth0" + }, + "status": { + "equalTo": "draft" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"feature_flags\": [\n {\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"type\": \"auth0\",\n \"status\": \"draft\",\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n ],\n \"next\": \"next\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "c7a5a02e-7595-4d10-b58d-5a96d5a3f7c8", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + }, + "postServeActions": [] + }, + { + "id": "5b965deb-f921-4ef0-b7db-7ba8c30d1fef", + "name": "Create a feature flag for the Experiment Center. - default", + "request": { + "urlPathTemplate": "/experimentation/feature-flags", + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } + }, + "response": { + "status": 201, + "body": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"type\": \"auth0\",\n \"status\": \"draft\",\n \"parameters\": {\n \"key\": {\n \"type\": \"string\",\n \"value\": {\n \"key\": \"value\"\n },\n \"description\": \"description\"\n }\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "5b965deb-f921-4ef0-b7db-7ba8c30d1fef", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "d67c44c6-dd70-4a7a-a203-566a40f7970f", + "name": "Get a feature flag by ID. - default", + "request": { + "urlPathTemplate": "/experimentation/feature-flags/{id}", + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"type\": \"auth0\",\n \"status\": \"draft\",\n \"parameters\": {\n \"key\": {\n \"type\": \"string\",\n \"value\": {\n \"key\": \"value\"\n },\n \"description\": \"description\"\n }\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "d67c44c6-dd70-4a7a-a203-566a40f7970f", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "94fc1535-b1de-4f15-a050-e0db73d2031d", + "name": "Delete a feature flag. - default", + "request": { + "urlPathTemplate": "/experimentation/feature-flags/{id}", + "method": "DELETE", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 200, + "body": "\"\"", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "94fc1535-b1de-4f15-a050-e0db73d2031d", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "fca842b6-3f36-4dfb-ae90-568e68695c8c", + "name": "Update a feature flag. - default", + "request": { + "urlPathTemplate": "/experimentation/feature-flags/{id}", + "method": "PATCH", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"type\": \"auth0\",\n \"status\": \"draft\",\n \"parameters\": {\n \"key\": {\n \"type\": \"string\",\n \"value\": {\n \"key\": \"value\"\n },\n \"description\": \"description\"\n }\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "fca842b6-3f36-4dfb-ae90-568e68695c8c", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "e8918863-9064-44c0-a1b7-db3c423377a1", + "name": "Transition a feature flag to a new status. - default", + "request": { + "urlPathTemplate": "/experimentation/feature-flags/{id}/status", + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"type\": \"auth0\",\n \"status\": \"draft\",\n \"parameters\": {\n \"key\": {\n \"type\": \"string\",\n \"value\": {\n \"key\": \"value\"\n },\n \"description\": \"description\"\n }\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "e8918863-9064-44c0-a1b7-db3c423377a1", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "f3d101fb-cdd6-4ae1-9613-a72ab8cb6207", + "name": "List segments for the tenant. - default", + "request": { + "urlPathTemplate": "/experimentation/segments", + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "queryParameters": { + "from": { + "equalTo": "from" + }, + "take": { + "equalTo": "1" + }, + "type": { + "equalTo": "auth0" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"segments\": [\n {\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"type\": \"self\",\n \"rules\": [\n {}\n ],\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n ],\n \"next\": \"next\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "f3d101fb-cdd6-4ae1-9613-a72ab8cb6207", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + }, + "postServeActions": [] + }, + { + "id": "d8d193b6-8822-4d36-8044-479bd24483e1", + "name": "Create a segment for the Experiment Center. - default", + "request": { + "urlPathTemplate": "/experimentation/segments", + "method": "POST", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + } + }, + "response": { + "status": 201, + "body": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"type\": \"self\",\n \"rules\": [\n {}\n ],\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "d8d193b6-8822-4d36-8044-479bd24483e1", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "f205ed84-327b-4abc-9154-889fab0fb681", + "name": "Get a segment by ID. - default", + "request": { + "urlPathTemplate": "/experimentation/segments/{id}", + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"type\": \"self\",\n \"rules\": [\n {}\n ],\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "f205ed84-327b-4abc-9154-889fab0fb681", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "1f1e87b3-9fdc-4b26-8ac2-537a57b6d8ae", + "name": "Delete a segment. - default", + "request": { + "urlPathTemplate": "/experimentation/segments/{id}", + "method": "DELETE", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 200, + "body": "\"\"", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "1f1e87b3-9fdc-4b26-8ac2-537a57b6d8ae", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "e2397c3e-6009-45bf-8ebd-62d6d9ccc2bd", + "name": "Update a segment. - default", + "request": { + "urlPathTemplate": "/experimentation/segments/{id}", + "method": "PATCH", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"type\": \"self\",\n \"rules\": [\n {}\n ],\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "e2397c3e-6009-45bf-8ebd-62d6d9ccc2bd", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "1abb2607-78fd-4896-bc90-9384a36aafdc", + "name": "List all variations for a feature flag. - default", + "request": { + "urlPathTemplate": "/experimentation/feature-flags/{id}/variations", + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"variations\": [\n {\n \"id\": \"id\",\n \"feature_flag_id\": \"feature_flag_id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"overrides\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n }\n ]\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "1abb2607-78fd-4896-bc90-9384a36aafdc", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "c9d939f1-99ea-420a-a6ad-0f672876141b", + "name": "Create a variation for a feature flag. - default", + "request": { + "urlPathTemplate": "/experimentation/feature-flags/{id}/variations", "method": "POST", "headers": { "Authorization": { @@ -10080,12 +10815,129 @@ }, "response": { "status": 201, - "body": "{\n \"experiment_id\": \"experiment_id\",\n \"from_level\": 1,\n \"to_level\": 1,\n \"current_level\": 1\n}", + "body": "{\n \"id\": \"id\",\n \"feature_flag_id\": \"feature_flag_id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"overrides\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n}", "headers": { "Content-Type": "application/json" } }, - "uuid": "82b4942b-e9d7-43ff-9167-27f89f0fb6e3", + "uuid": "c9d939f1-99ea-420a-a6ad-0f672876141b", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "e2d62924-fd55-44bd-a420-b2af14221ab3", + "name": "Get a variation by ID. - default", + "request": { + "urlPathTemplate": "/experimentation/feature-flags/{id}/variations/{vid}", + "method": "GET", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + }, + "vid": { + "equalTo": "vid" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"id\": \"id\",\n \"feature_flag_id\": \"feature_flag_id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"overrides\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "e2d62924-fd55-44bd-a420-b2af14221ab3", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "c581e83f-a6d2-4f3f-b7c3-fd93c5d99b1b", + "name": "Delete a variation. - default", + "request": { + "urlPathTemplate": "/experimentation/feature-flags/{id}/variations/{vid}", + "method": "DELETE", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + }, + "vid": { + "equalTo": "vid" + } + } + }, + "response": { + "status": 200, + "body": "\"\"", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "c581e83f-a6d2-4f3f-b7c3-fd93c5d99b1b", + "persistent": true, + "priority": 3, + "metadata": { + "mocklab": { + "created": { + "at": "2020-01-01T00:00:00.000Z", + "via": "SYSTEM" + } + } + } + }, + { + "id": "f2b8f79d-6aa1-47c2-8894-b917b3dea8e3", + "name": "Update a variation. - default", + "request": { + "urlPathTemplate": "/experimentation/feature-flags/{id}/variations/{vid}", + "method": "PATCH", + "headers": { + "Authorization": { + "matches": "Bearer .+" + } + }, + "pathParameters": { + "id": { + "equalTo": "id" + }, + "vid": { + "equalTo": "vid" + } + } + }, + "response": { + "status": 200, + "body": "{\n \"id\": \"id\",\n \"feature_flag_id\": \"feature_flag_id\",\n \"name\": \"name\",\n \"description\": \"description\",\n \"overrides\": {\n \"key\": \"value\"\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n}", + "headers": { + "Content-Type": "application/json" + } + }, + "uuid": "f2b8f79d-6aa1-47c2-8894-b917b3dea8e3", "persistent": true, "priority": 3, "metadata": { @@ -14006,120 +14858,6 @@ } } }, - { - "id": "c2f5ec1c-5df7-4f2c-9343-e5e3f3f637ef", - "name": "Get organization template for organization - default", - "request": { - "urlPathTemplate": "/organizations/{id}/organization-templates", - "method": "GET", - "headers": { - "Authorization": { - "matches": "Bearer .+" - } - }, - "pathParameters": { - "id": { - "equalTo": "id" - } - } - }, - "response": { - "status": 200, - "body": "{\n \"id\": \"id\",\n \"name\": \"name\",\n \"is_default\": true,\n \"organization_deletion_behavior\": \"allow\",\n \"connection_deletion_behavior\": \"allow\",\n \"enforce_permission_ceiling\": true,\n \"enforce_self_assignment_restriction\": true,\n \"connection_profile_id\": \"connection_profile_id\",\n \"user_attribute_profile_id\": \"user_attribute_profile_id\",\n \"allowed_strategies\": [\n \"adfs\"\n ],\n \"invitation_landing_client_id\": \"invitation_landing_client_id\",\n \"admin_roles_assignment\": [\n \"admin_roles_assignment\"\n ],\n \"use_for_organization_discovery\": {\n \"default_value\": true,\n \"allowed_values\": [\n true\n ]\n },\n \"role_visibility_policy\": {\n \"default_value\": \"write\",\n \"overrides\": [\n {\n \"role_id\": \"role_id\",\n \"access\": \"write\"\n }\n ]\n },\n \"created_at\": \"2024-01-15T09:30:00Z\",\n \"updated_at\": \"2024-01-15T09:30:00Z\"\n}", - "headers": { - "Content-Type": "application/json" - } - }, - "uuid": "c2f5ec1c-5df7-4f2c-9343-e5e3f3f637ef", - "persistent": true, - "priority": 3, - "metadata": { - "mocklab": { - "created": { - "at": "2020-01-01T00:00:00.000Z", - "via": "SYSTEM" - } - } - } - }, - { - "id": "50ff1eeb-7359-44c1-94f5-552cd5844704", - "name": "Assign an organization template to an organization - default", - "request": { - "urlPathTemplate": "/organizations/{id}/organization-templates/{template_id}", - "method": "PUT", - "headers": { - "Authorization": { - "matches": "Bearer .+" - } - }, - "pathParameters": { - "id": { - "equalTo": "id" - }, - "template_id": { - "equalTo": "template_id" - } - } - }, - "response": { - "status": 200, - "body": "\"\"", - "headers": { - "Content-Type": "application/json" - } - }, - "uuid": "50ff1eeb-7359-44c1-94f5-552cd5844704", - "persistent": true, - "priority": 3, - "metadata": { - "mocklab": { - "created": { - "at": "2020-01-01T00:00:00.000Z", - "via": "SYSTEM" - } - } - } - }, - { - "id": "f4cc26a9-f247-4729-96f3-d61861a61351", - "name": "Unassign an organization template from an organization - default", - "request": { - "urlPathTemplate": "/organizations/{id}/organization-templates/{template_id}", - "method": "DELETE", - "headers": { - "Authorization": { - "matches": "Bearer .+" - } - }, - "pathParameters": { - "id": { - "equalTo": "id" - }, - "template_id": { - "equalTo": "template_id" - } - } - }, - "response": { - "status": 200, - "body": "\"\"", - "headers": { - "Content-Type": "application/json" - } - }, - "uuid": "f4cc26a9-f247-4729-96f3-d61861a61351", - "persistent": true, - "priority": 3, - "metadata": { - "mocklab": { - "created": { - "at": "2020-01-01T00:00:00.000Z", - "via": "SYSTEM" - } - } - } - }, { "id": "6d9e3ba1-00dd-4040-89c3-a856e4b77da2", "name": "List the groups that are assigned to the organization. - default", @@ -17105,6 +17843,6 @@ } ], "meta": { - "total": 457 + "total": 477 } } \ No newline at end of file From 64d1d55c8ba7f40612860170da67d799f8093307 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 29 Sep 2026 05:46:32 +0000 Subject: [PATCH 2/3] [fern-replay] advance lockfile --- .fern/replay.lock | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.fern/replay.lock b/.fern/replay.lock index 9f02f0f67..f51283faf 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -48,5 +48,11 @@ generations: cli_version: unknown generator_versions: fernapi/fern-ruby-sdk: 1.24.1 -current_generation: 83074ed870797568e512cc7f0fb71dc679cdd7f4 + - commit_sha: ddd12c1ca38e6c93db2c1d30e4194a2ecbca03ba + tree_hash: fa2bf11afbbd64aff874ac158dfaf67412ee73d7 + timestamp: 2026-09-29T05:46:29.187Z + cli_version: unknown + generator_versions: + fernapi/fern-ruby-sdk: 1.24.1 +current_generation: ddd12c1ca38e6c93db2c1d30e4194a2ecbca03ba patches: [] From 38043170420e5e5bf02545187cf2f90a75775b60 Mon Sep 17 00:00:00 2001 From: Kunal Dawar Date: Wed, 30 Sep 2026 13:14:59 +0530 Subject: [PATCH 3/3] Restore auth_client require and timeout/headers params in client.rb --- lib/auth0/client.rb | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/lib/auth0/client.rb b/lib/auth0/client.rb index cce20f615..bf30f8628 100644 --- a/lib/auth0/client.rb +++ b/lib/auth0/client.rb @@ -4,27 +4,23 @@ module Auth0 class Management # @param token [String] # @param base_url [String, nil] - # @param tenant_domain [String, nil] - # @param max_retries [Integer] + # @param timeout [Float, nil] Request timeout in seconds. + # @param max_retries [Integer, nil] Maximum number of request retries. + # @param headers [Hash, nil] Additional headers to include in requests. # # @return [void] - def initialize(token:, base_url: nil, tenant_domain: nil, max_retries: 2) - unless tenant_domain.nil? - tenant_domain_value = tenant_domain.nil? ? "{TENANT}.auth0.com" : tenant_domain - environment_url_templates = { - Auth0::Environment::DEFAULT => "https://#{tenant_domain_value}/api/v2" - } - base_url = base_url.nil? ? "https://#{tenant_domain_value}/api/v2" : environment_url_templates.fetch(base_url, base_url) - end - - @raw_client = Auth0::Internal::Http::RawClient.new( + def initialize(token:, base_url: nil, timeout: nil, max_retries: nil, headers: nil) + raw_client_opts = { base_url: base_url || Auth0::Environment::DEFAULT, headers: { "X-Fern-Language" => "Ruby", Authorization: "Bearer #{token}" - }, - max_retries: max_retries - ) + }.merge(headers || {}) + } + raw_client_opts[:timeout] = timeout if timeout + raw_client_opts[:max_retries] = max_retries if max_retries + + @raw_client = Auth0::Internal::Http::RawClient.new(**raw_client_opts) end # @return [Auth0::Actions::Client] @@ -263,3 +259,5 @@ def verifiable_credentials end end end + +require_relative "auth_client"