auth0 6.3.0 → 6.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/.fern/metadata.json +5 -4
  3. data/.fern/replay.lock +7 -1
  4. data/.version +1 -1
  5. data/CHANGELOG.md +6 -0
  6. data/examples/ruby-api/Gemfile.lock +1 -1
  7. data/lib/auth0/clients/types/create_client_request_content.rb +2 -0
  8. data/lib/auth0/experimentation/client.rb +10 -0
  9. data/lib/auth0/experimentation/experiments/client.rb +304 -0
  10. data/lib/auth0/experimentation/experiments/types/create_experiment_request_content.rb +27 -0
  11. data/lib/auth0/experimentation/experiments/types/list_experiments_request_parameters.rb +21 -0
  12. data/lib/auth0/experimentation/experiments/types/update_experiment_request_parameters.rb +25 -0
  13. data/lib/auth0/experimentation/experiments/types/update_experiment_status_request_content.rb +15 -0
  14. data/lib/auth0/experimentation/feature_flags/client.rb +280 -0
  15. data/lib/auth0/experimentation/feature_flags/types/create_feature_flag_request_content.rb +17 -0
  16. data/lib/auth0/experimentation/feature_flags/types/list_feature_flags_request_parameters.rb +19 -0
  17. data/lib/auth0/experimentation/feature_flags/types/update_feature_flag_request_content.rb +19 -0
  18. data/lib/auth0/experimentation/feature_flags/types/update_feature_flag_status_request_content.rb +15 -0
  19. data/lib/auth0/experimentation/feature_flags/variations/client.rb +230 -0
  20. data/lib/auth0/experimentation/feature_flags/variations/types/create_variation_request_content.rb +21 -0
  21. data/lib/auth0/experimentation/feature_flags/variations/types/update_variation_request_content.rb +23 -0
  22. data/lib/auth0/experimentation/segments/client.rb +228 -0
  23. data/lib/auth0/experimentation/segments/types/create_segment_request_content.rb +17 -0
  24. data/lib/auth0/experimentation/segments/types/list_segments_request_parameters.rb +17 -0
  25. data/lib/auth0/experimentation/segments/types/update_segment_request_content.rb +19 -0
  26. data/lib/auth0/organizations/client.rb +0 -5
  27. data/lib/auth0/resource_servers/types/create_resource_server_request_content.rb +2 -0
  28. data/lib/auth0/resource_servers/types/update_resource_server_request_content.rb +2 -0
  29. data/lib/auth0/types/allocation_item.rb +27 -0
  30. data/lib/auth0/types/allocation_request_item.rb +19 -0
  31. data/lib/auth0/types/{connection_deletion_behavior_enum.rb → allocation_strategy_enum.rb} +3 -3
  32. data/lib/auth0/types/async_approval_notifications_channels_enum.rb +1 -0
  33. data/lib/auth0/types/authentication_flow_enum.rb +16 -0
  34. data/lib/auth0/types/client_oidc_backchannel_logout_initiators_enum.rb +1 -0
  35. data/lib/auth0/types/client_oidc_support_allowed_scopes_enum.rb +14 -0
  36. data/lib/auth0/types/client_oidc_support_post.rb +15 -0
  37. data/lib/auth0/types/create_experiment_response_content.rb +45 -0
  38. data/lib/auth0/types/create_feature_flag_parameters.rb +23 -0
  39. data/lib/auth0/types/create_feature_flag_response_content.rb +23 -0
  40. data/lib/auth0/types/create_resource_server_response_content.rb +2 -0
  41. data/lib/auth0/types/create_segment_response_content.rb +21 -0
  42. data/lib/auth0/types/create_variation_response_content.rb +21 -0
  43. data/lib/auth0/types/{organization_deletion_behavior_enum.rb → default_config_enum.rb} +3 -3
  44. data/lib/auth0/types/experiment_list_item.rb +45 -0
  45. data/lib/auth0/types/experiment_status_enum.rb +15 -0
  46. data/lib/auth0/types/experiment_transition_status_enum.rb +14 -0
  47. data/lib/auth0/types/experiment_validation_error.rb +11 -0
  48. data/lib/auth0/types/feature_flag.rb +23 -0
  49. data/lib/auth0/types/feature_flag_config_param.rb +13 -0
  50. data/lib/auth0/types/feature_flag_config_param_type_enum.rb +15 -0
  51. data/lib/auth0/types/feature_flag_config_params.rb +23 -0
  52. data/lib/auth0/types/feature_flag_status_enum.rb +13 -0
  53. data/lib/auth0/types/feature_flag_type_enum.rb +12 -0
  54. data/lib/auth0/types/get_experiment_response_content.rb +45 -0
  55. data/lib/auth0/types/get_feature_flag_response_content.rb +23 -0
  56. data/lib/auth0/types/get_resource_server_response_content.rb +2 -0
  57. data/lib/auth0/types/get_segment_response_content.rb +21 -0
  58. data/lib/auth0/types/get_variation_response_content.rb +21 -0
  59. data/lib/auth0/types/list_experiments_response_content.rb +11 -0
  60. data/lib/auth0/types/list_feature_flags_response_content.rb +11 -0
  61. data/lib/auth0/types/list_segments_response_content.rb +11 -0
  62. data/lib/auth0/types/list_variations_response_content.rb +9 -0
  63. data/lib/auth0/types/oauth_scope.rb +3 -1
  64. data/lib/auth0/types/resource_server.rb +2 -0
  65. data/lib/auth0/types/resource_server_search_response.rb +2 -0
  66. data/lib/auth0/types/segment.rb +21 -0
  67. data/lib/auth0/types/segment_contains_expression.rb +9 -0
  68. data/lib/auth0/types/segment_ends_with_expression.rb +9 -0
  69. data/lib/auth0/types/segment_exists_expression.rb +9 -0
  70. data/lib/auth0/types/segment_match_conditions.rb +30 -0
  71. data/lib/auth0/types/segment_match_expression.rb +19 -0
  72. data/lib/auth0/types/segment_not_match_conditions.rb +30 -0
  73. data/lib/auth0/types/segment_rule.rb +11 -0
  74. data/lib/auth0/types/segment_starts_with_expression.rb +9 -0
  75. data/lib/auth0/types/segment_type_enum.rb +12 -0
  76. data/lib/auth0/types/segment_type_filter_enum.rb +12 -0
  77. data/lib/auth0/types/update_experiment_response_content.rb +45 -0
  78. data/lib/auth0/types/update_experiment_status_response_content.rb +45 -0
  79. data/lib/auth0/types/update_feature_flag_parameters.rb +23 -0
  80. data/lib/auth0/types/update_feature_flag_response_content.rb +23 -0
  81. data/lib/auth0/types/update_feature_flag_status_response_content.rb +23 -0
  82. data/lib/auth0/types/update_resource_server_response_content.rb +2 -0
  83. data/lib/auth0/types/update_segment_response_content.rb +21 -0
  84. data/lib/auth0/types/update_variation_overrides_map.rb +23 -0
  85. data/lib/auth0/types/update_variation_response_content.rb +21 -0
  86. data/lib/auth0/types/validate_experiment_response_content.rb +11 -0
  87. data/lib/auth0/types/variation.rb +21 -0
  88. data/lib/auth0/types/variation_overrides_map.rb +23 -0
  89. data/lib/auth0/users/client.rb +24 -17
  90. data/lib/auth0/version.rb +1 -1
  91. data/lib/auth0.rb +68 -9
  92. data/wiremock/wiremock-mappings.json +861 -123
  93. metadata +70 -11
  94. data/lib/auth0/organizations/organization_template/client.rb +0 -132
  95. data/lib/auth0/types/organization_template.rb +0 -39
  96. data/lib/auth0/types/organization_template_allowed_strategy_enum.rb +0 -17
  97. data/lib/auth0/types/organization_template_role_visibility_enum.rb +0 -13
  98. data/lib/auth0/types/organization_template_role_visibility_override.rb +0 -12
  99. data/lib/auth0/types/organization_template_role_visibility_policy.rb +0 -12
  100. data/lib/auth0/types/organization_template_use_for_organization_discovery.rb +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cdd34814af8763e14c4a6e1fe6435225a0316a5d937fbc214647230755d860bf
4
- data.tar.gz: 245b66bbddb2838693109d99f557ac7bb801f274ed141f01fe9c2e918ef7323c
3
+ metadata.gz: c0ee008c469f95695eb60571f4ab79355846375df2cb681eb3bead53350eabdc
4
+ data.tar.gz: 274ca0c5c3ed5bd0ca1c064304a547b2133b3b8b57e086a8e721fc6db5f4ed4b
5
5
  SHA512:
6
- metadata.gz: c717e94de8376afc15caac98ada3f9987aa4849d4bb403b255b74a113f97a3961d6ac247683e50aae907d228c239c0af5e91d48258c37926a6262cf1516eb69e
7
- data.tar.gz: 8a6ec6c299f4cd9368b0556d6225911577a5dfc5950152c0ba45e96a89749638a527ffb1cd0ce7cac8be35d7932a41182b8718afdf57874ba39b8c8a5ee07214
6
+ metadata.gz: 3fafaf658bcec42cbd757cba5b05e0f3a511f1065857cb30751e539e0e5b61c004861c337274d8146cb555e7500c16b7307ba6a9ac6d5b732f78af1adad387e9
7
+ data.tar.gz: 5c2d1b45e193299f235426a4ea46a6fb31082c48faa73e5959bda6f4daefb93ed68f935e1cbdb1f1912067ec50b943e89d65f48432d1eaf7618381fb49e79e43
data/.fern/metadata.json CHANGED
@@ -10,8 +10,9 @@
10
10
  "offsetSemantics": "page-index",
11
11
  "useDefaultRequestParameterValues": true
12
12
  },
13
- "originGitCommit": "147c530f85f27d4dbbec076dde0bcd7a4b17ed5c",
14
- "originGitCommitIsDirty": true,
15
- "invokedBy": "manual",
16
- "sdkVersion": "6.2.1"
13
+ "originGitCommit": "d0c167e92ed941d977b98e76601bd970b0e5ecea",
14
+ "originGitCommitIsDirty": false,
15
+ "invokedBy": "ci",
16
+ "ciProvider": "github",
17
+ "sdkVersion": "6.3.1"
17
18
  }
data/.fern/replay.lock CHANGED
@@ -48,5 +48,11 @@ generations:
48
48
  cli_version: unknown
49
49
  generator_versions:
50
50
  fernapi/fern-ruby-sdk: 1.24.1
51
- current_generation: 83074ed870797568e512cc7f0fb71dc679cdd7f4
51
+ - commit_sha: ddd12c1ca38e6c93db2c1d30e4194a2ecbca03ba
52
+ tree_hash: fa2bf11afbbd64aff874ac158dfaf67412ee73d7
53
+ timestamp: 2026-09-29T05:46:29.187Z
54
+ cli_version: unknown
55
+ generator_versions:
56
+ fernapi/fern-ruby-sdk: 1.24.1
57
+ current_generation: ddd12c1ca38e6c93db2c1d30e4194a2ecbca03ba
52
58
  patches: []
data/.version CHANGED
@@ -1 +1 @@
1
- v6.3.0
1
+ v6.4.0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## [v6.4.0](https://github.com/auth0/ruby-auth0/tree/v6.4.0) (2026-09-30)
4
+ [Full Changelog](https://github.com/auth0/ruby-auth0/compare/v6.3.0...v6.4.0)
5
+
6
+ **Added**
7
+ - feat: adds Experiment Center APIs (EA), client OIDC support, and consent non-repudiation; removes organization template sub-client [\#808](https://github.com/auth0/ruby-auth0/pull/808) ([fern-api[bot]](https://github.com/apps/fern-api))
8
+
3
9
  ## [v6.3.0](https://github.com/auth0/ruby-auth0/tree/v6.3.0) (2026-09-16)
4
10
  [Full Changelog](https://github.com/auth0/ruby-auth0/compare/v6.2.0...v6.3.0)
5
11
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- auth0 (6.3.0)
4
+ auth0 (6.4.0)
5
5
  addressable (~> 2.8)
6
6
  jwt (>= 2.7, < 4.0)
7
7
  rest-client (~> 2.1)
@@ -119,6 +119,8 @@ module Auth0
119
119
  field :my_organization_configuration, -> { Auth0::Types::ClientMyOrganizationPostConfiguration }, optional: true, nullable: false
120
120
 
121
121
  field :async_approval_notification_channels, -> { Internal::Types::Array[Auth0::Types::AsyncApprovalNotificationsChannelsEnum] }, optional: true, nullable: false
122
+
123
+ field :oidc_support, -> { Auth0::Types::ClientOidcSupportPost }, optional: true, nullable: false
122
124
  end
123
125
  end
124
126
  end
@@ -14,6 +14,16 @@ module Auth0
14
14
  def experiments
15
15
  @experiments ||= Auth0::Experimentation::Experiments::Client.new(client: @client)
16
16
  end
17
+
18
+ # @return [Auth0::FeatureFlags::Client]
19
+ def feature_flags
20
+ @feature_flags ||= Auth0::Experimentation::FeatureFlags::Client.new(client: @client)
21
+ end
22
+
23
+ # @return [Auth0::Segments::Client]
24
+ def segments
25
+ @segments ||= Auth0::Experimentation::Segments::Client.new(client: @client)
26
+ end
17
27
  end
18
28
  end
19
29
  end
@@ -11,6 +11,226 @@ module Auth0
11
11
  @client = client
12
12
  end
13
13
 
14
+ # Retrieve a paginated list of experiments for the tenant, with optional filters.
15
+ #
16
+ # @param request_options [Hash]
17
+ # @param params [Hash]
18
+ # @option request_options [String] :base_url
19
+ # @option request_options [Hash{String => Object}] :additional_headers
20
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
21
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
22
+ # @option request_options [Integer] :timeout_in_seconds
23
+ # @option params [String, nil] :from
24
+ # @option params [Integer, nil] :take
25
+ # @option params [Auth0::Types::ExperimentStatusEnum, nil] :status
26
+ # @option params [String, nil] :authentication_flow
27
+ # @option params [String, nil] :feature_flag_id
28
+ #
29
+ # @example
30
+ # client.experimentation.experiments.list(
31
+ # from: "from",
32
+ # take: 1,
33
+ # status: "draft",
34
+ # authentication_flow: "authentication_flow",
35
+ # feature_flag_id: "feature_flag_id"
36
+ # )
37
+ #
38
+ # @return [Auth0::Types::ListExperimentsResponseContent]
39
+ def list(request_options: {}, **params)
40
+ params = Auth0::Internal::Types::Utils.normalize_keys(params)
41
+ query_params = {}
42
+ query_params["from"] = params[:from] if params.key?(:from)
43
+ query_params["take"] = params.fetch(:take, 50)
44
+ query_params["status"] = params[:status] if params.key?(:status)
45
+ query_params["authentication_flow"] = params[:authentication_flow] if params.key?(:authentication_flow)
46
+ query_params["feature_flag_id"] = params[:feature_flag_id] if params.key?(:feature_flag_id)
47
+
48
+ Auth0::Internal::CursorItemIterator.new(
49
+ cursor_field: :next_,
50
+ item_field: :experiments,
51
+ initial_cursor: query_params["from"]
52
+ ) do |next_cursor|
53
+ query_params["from"] = next_cursor
54
+ request = Auth0::Internal::JSON::Request.new(
55
+ base_url: request_options[:base_url],
56
+ method: "GET",
57
+ path: "experimentation/experiments",
58
+ query: query_params,
59
+ request_options: request_options
60
+ )
61
+ begin
62
+ response = @client.send(request)
63
+ rescue Net::HTTPRequestTimeout
64
+ raise Auth0::Errors::TimeoutError
65
+ end
66
+ code = response.code.to_i
67
+ if code.between?(200, 299)
68
+ parsed_response = (response.body.to_s.empty? ? nil : Auth0::Types::ListExperimentsResponseContent.load(response.body))
69
+ [parsed_response, response]
70
+ else
71
+ error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
72
+ raise error_class.new(response.body, code: code)
73
+ end
74
+ end
75
+ end
76
+
77
+ # Create a new experiment for A/B testing.
78
+ #
79
+ # @param request_options [Hash]
80
+ # @param params [Auth0::Experimentation::Experiments::Types::CreateExperimentRequestContent]
81
+ # @option request_options [String] :base_url
82
+ # @option request_options [Hash{String => Object}] :additional_headers
83
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
84
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
85
+ # @option request_options [Integer] :timeout_in_seconds
86
+ #
87
+ # @example
88
+ # client.experimentation.experiments.create(
89
+ # name: "name",
90
+ # feature_flag_id: "feature_flag_id",
91
+ # authentication_flow: "authentication"
92
+ # )
93
+ #
94
+ # @return [Auth0::Types::CreateExperimentResponseContent]
95
+ def create(request_options: {}, **params)
96
+ params = Auth0::Internal::Types::Utils.normalize_keys(params)
97
+ request = Auth0::Internal::JSON::Request.new(
98
+ base_url: request_options[:base_url],
99
+ method: "POST",
100
+ path: "experimentation/experiments",
101
+ body: Auth0::Experimentation::Experiments::Types::CreateExperimentRequestContent.new(params).to_h,
102
+ request_options: request_options
103
+ )
104
+ begin
105
+ response = @client.send(request)
106
+ rescue Net::HTTPRequestTimeout
107
+ raise Auth0::Errors::TimeoutError
108
+ end
109
+ code = response.code.to_i
110
+ if code.between?(200, 299)
111
+ (response.body.to_s.empty? ? nil : Auth0::Types::CreateExperimentResponseContent.load(response.body))
112
+ else
113
+ error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
114
+ raise error_class.new(response.body, code: code)
115
+ end
116
+ end
117
+
118
+ # Retrieve a single experiment with its allocations by ID.
119
+ #
120
+ # @param request_options [Hash]
121
+ # @param params [Hash]
122
+ # @option request_options [String] :base_url
123
+ # @option request_options [Hash{String => Object}] :additional_headers
124
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
125
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
126
+ # @option request_options [Integer] :timeout_in_seconds
127
+ # @option params [String] :id
128
+ #
129
+ # @example
130
+ # client.experimentation.experiments.get(id: "id")
131
+ #
132
+ # @return [Auth0::Types::GetExperimentResponseContent]
133
+ def get(request_options: {}, **params)
134
+ params = Auth0::Internal::Types::Utils.normalize_keys(params)
135
+ request = Auth0::Internal::JSON::Request.new(
136
+ base_url: request_options[:base_url],
137
+ method: "GET",
138
+ path: "experimentation/experiments/#{URI.encode_uri_component(params[:id].to_s)}",
139
+ request_options: request_options
140
+ )
141
+ begin
142
+ response = @client.send(request)
143
+ rescue Net::HTTPRequestTimeout
144
+ raise Auth0::Errors::TimeoutError
145
+ end
146
+ code = response.code.to_i
147
+ if code.between?(200, 299)
148
+ (response.body.to_s.empty? ? nil : Auth0::Types::GetExperimentResponseContent.load(response.body))
149
+ else
150
+ error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
151
+ raise error_class.new(response.body, code: code)
152
+ end
153
+ end
154
+
155
+ # Permanently delete an experiment and its allocations by ID. Active experiments cannot be deleted; pause or
156
+ # complete first. Idempotent: returns 204 even if the experiment does not exist.
157
+ #
158
+ # @param request_options [Hash]
159
+ # @param params [Hash]
160
+ # @option request_options [String] :base_url
161
+ # @option request_options [Hash{String => Object}] :additional_headers
162
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
163
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
164
+ # @option request_options [Integer] :timeout_in_seconds
165
+ # @option params [String] :id
166
+ #
167
+ # @example
168
+ # client.experimentation.experiments.delete(id: "id")
169
+ #
170
+ # @return [untyped]
171
+ def delete(request_options: {}, **params)
172
+ params = Auth0::Internal::Types::Utils.normalize_keys(params)
173
+ request = Auth0::Internal::JSON::Request.new(
174
+ base_url: request_options[:base_url],
175
+ method: "DELETE",
176
+ path: "experimentation/experiments/#{URI.encode_uri_component(params[:id].to_s)}",
177
+ request_options: request_options
178
+ )
179
+ begin
180
+ response = @client.send(request)
181
+ rescue Net::HTTPRequestTimeout
182
+ raise Auth0::Errors::TimeoutError
183
+ end
184
+ code = response.code.to_i
185
+ return if code.between?(200, 299)
186
+
187
+ error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
188
+ raise error_class.new(response.body, code: code)
189
+ end
190
+
191
+ # Partially update an experiment by ID. Only provided fields are updated. Providing allocations replaces the
192
+ # entire allocations set.
193
+ #
194
+ # @param request_options [Hash]
195
+ # @param params [Auth0::Experimentation::Experiments::Types::UpdateExperimentRequestParameters]
196
+ # @option request_options [String] :base_url
197
+ # @option request_options [Hash{String => Object}] :additional_headers
198
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
199
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
200
+ # @option request_options [Integer] :timeout_in_seconds
201
+ # @option params [String] :id
202
+ #
203
+ # @example
204
+ # client.experimentation.experiments.update(id: "id")
205
+ #
206
+ # @return [Auth0::Types::UpdateExperimentResponseContent]
207
+ def update(request_options: {}, **params)
208
+ params = Auth0::Internal::Types::Utils.normalize_keys(params)
209
+ request_data = Auth0::Experimentation::Experiments::Types::UpdateExperimentRequestParameters.new(params).to_h
210
+ non_body_param_names = %w[id]
211
+ body = request_data.except(*non_body_param_names)
212
+
213
+ request = Auth0::Internal::JSON::Request.new(
214
+ base_url: request_options[:base_url],
215
+ method: "PATCH",
216
+ path: "experimentation/experiments/#{URI.encode_uri_component(params[:id].to_s)}",
217
+ body: body,
218
+ request_options: request_options
219
+ )
220
+ begin
221
+ response = @client.send(request)
222
+ rescue Net::HTTPRequestTimeout
223
+ raise Auth0::Errors::TimeoutError
224
+ end
225
+ code = response.code.to_i
226
+ if code.between?(200, 299)
227
+ (response.body.to_s.empty? ? nil : Auth0::Types::UpdateExperimentResponseContent.load(response.body))
228
+ else
229
+ error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
230
+ raise error_class.new(response.body, code: code)
231
+ end
232
+ end
233
+
14
234
  # Increments the current ramp index to the requested target level. Up-only: the target must be the immediate
15
235
  # next level in the schedule. Idempotent: calling with the current level returns success without writing
16
236
  # anything.
@@ -57,6 +277,90 @@ module Auth0
57
277
  raise error_class.new(response.body, code: code)
58
278
  end
59
279
  end
280
+
281
+ # Transitions an experiment through its lifecycle: draft → active, active → paused, paused → active,
282
+ # active/paused → completed. Activation runs full readiness validation.
283
+ #
284
+ # @param request_options [Hash]
285
+ # @param params [Auth0::Experimentation::Experiments::Types::UpdateExperimentStatusRequestContent]
286
+ # @option request_options [String] :base_url
287
+ # @option request_options [Hash{String => Object}] :additional_headers
288
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
289
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
290
+ # @option request_options [Integer] :timeout_in_seconds
291
+ # @option params [String] :id
292
+ #
293
+ # @example
294
+ # client.experimentation.experiments.update_status(
295
+ # id: "id",
296
+ # status: "active"
297
+ # )
298
+ #
299
+ # @return [Auth0::Types::UpdateExperimentStatusResponseContent]
300
+ def update_status(request_options: {}, **params)
301
+ params = Auth0::Internal::Types::Utils.normalize_keys(params)
302
+ request_data = Auth0::Experimentation::Experiments::Types::UpdateExperimentStatusRequestContent.new(params).to_h
303
+ non_body_param_names = %w[id]
304
+ body = request_data.except(*non_body_param_names)
305
+
306
+ request = Auth0::Internal::JSON::Request.new(
307
+ base_url: request_options[:base_url],
308
+ method: "POST",
309
+ path: "experimentation/experiments/#{URI.encode_uri_component(params[:id].to_s)}/status",
310
+ body: body,
311
+ request_options: request_options
312
+ )
313
+ begin
314
+ response = @client.send(request)
315
+ rescue Net::HTTPRequestTimeout
316
+ raise Auth0::Errors::TimeoutError
317
+ end
318
+ code = response.code.to_i
319
+ if code.between?(200, 299)
320
+ (response.body.to_s.empty? ? nil : Auth0::Types::UpdateExperimentStatusResponseContent.load(response.body))
321
+ else
322
+ error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
323
+ raise error_class.new(response.body, code: code)
324
+ end
325
+ end
326
+
327
+ # Checks whether an experiment is ready to be activated. Returns is_valid boolean and an errors array describing
328
+ # any blockers. Read-only; no state is modified.
329
+ #
330
+ # @param request_options [Hash]
331
+ # @param params [Hash]
332
+ # @option request_options [String] :base_url
333
+ # @option request_options [Hash{String => Object}] :additional_headers
334
+ # @option request_options [Hash{String => Object}] :additional_query_parameters
335
+ # @option request_options [Hash{String => Object}] :additional_body_parameters
336
+ # @option request_options [Integer] :timeout_in_seconds
337
+ # @option params [String] :id
338
+ #
339
+ # @example
340
+ # client.experimentation.experiments.validate(id: "id")
341
+ #
342
+ # @return [Auth0::Types::ValidateExperimentResponseContent]
343
+ def validate(request_options: {}, **params)
344
+ params = Auth0::Internal::Types::Utils.normalize_keys(params)
345
+ request = Auth0::Internal::JSON::Request.new(
346
+ base_url: request_options[:base_url],
347
+ method: "POST",
348
+ path: "experimentation/experiments/#{URI.encode_uri_component(params[:id].to_s)}/validate",
349
+ request_options: request_options
350
+ )
351
+ begin
352
+ response = @client.send(request)
353
+ rescue Net::HTTPRequestTimeout
354
+ raise Auth0::Errors::TimeoutError
355
+ end
356
+ code = response.code.to_i
357
+ if code.between?(200, 299)
358
+ (response.body.to_s.empty? ? nil : Auth0::Types::ValidateExperimentResponseContent.load(response.body))
359
+ else
360
+ error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
361
+ raise error_class.new(response.body, code: code)
362
+ end
363
+ end
60
364
  end
61
365
  end
62
366
  end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Auth0
4
+ module Experimentation
5
+ module Experiments
6
+ module Types
7
+ class CreateExperimentRequestContent < Internal::Types::Model
8
+ field :name, -> { String }, optional: false, nullable: false
9
+
10
+ field :description, -> { String }, optional: true, nullable: false
11
+
12
+ field :feature_flag_id, -> { String }, optional: false, nullable: false
13
+
14
+ field :authentication_flow, -> { Auth0::Types::AuthenticationFlowEnum }, optional: false, nullable: false
15
+
16
+ field :default_config, -> { Auth0::Types::DefaultConfigEnum }, optional: true, nullable: false
17
+
18
+ field :allocation_strategy, -> { Auth0::Types::AllocationStrategyEnum }, optional: true, nullable: false
19
+
20
+ field :allocations, -> { Internal::Types::Array[Auth0::Types::AllocationRequestItem] }, optional: true, nullable: false
21
+
22
+ field :levels, -> { Internal::Types::Array[Integer] }, optional: true, nullable: false
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Auth0
4
+ module Experimentation
5
+ module Experiments
6
+ module Types
7
+ class ListExperimentsRequestParameters < Internal::Types::Model
8
+ field :from, -> { String }, optional: true, nullable: false
9
+
10
+ field :take, -> { Integer }, optional: true, nullable: false
11
+
12
+ field :status, -> { Auth0::Types::ExperimentStatusEnum }, optional: true, nullable: false
13
+
14
+ field :authentication_flow, -> { String }, optional: true, nullable: false
15
+
16
+ field :feature_flag_id, -> { String }, optional: true, nullable: false
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Auth0
4
+ module Experimentation
5
+ module Experiments
6
+ module Types
7
+ class UpdateExperimentRequestParameters < Internal::Types::Model
8
+ field :id, -> { String }, optional: false, nullable: false
9
+
10
+ field :name, -> { String }, optional: true, nullable: false
11
+
12
+ field :description, -> { String }, optional: true, nullable: false
13
+
14
+ field :authentication_flow, -> { Auth0::Types::AuthenticationFlowEnum }, optional: true, nullable: false
15
+
16
+ field :allocations, -> { Internal::Types::Array[Auth0::Types::AllocationRequestItem] }, optional: true, nullable: false
17
+
18
+ field :default_config, -> { Auth0::Types::DefaultConfigEnum }, optional: true, nullable: false
19
+
20
+ field :levels, -> { Internal::Types::Array[Integer] }, optional: true, nullable: false
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Auth0
4
+ module Experimentation
5
+ module Experiments
6
+ module Types
7
+ class UpdateExperimentStatusRequestContent < Internal::Types::Model
8
+ field :id, -> { String }, optional: false, nullable: false
9
+
10
+ field :status, -> { Auth0::Types::ExperimentTransitionStatusEnum }, optional: false, nullable: false
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end