Skip to content

Commit ff05aa3

Browse files
algolia-botFluf22
andcommitted
fix(clients): validate empty string for required string parameters (generated)
algolia/api-clients-automation#6338 Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com> Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
1 parent 37b7d09 commit ff05aa3

11 files changed

Lines changed: 742 additions & 0 deletions

lib/algolia/api/abtesting_client.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ def custom_delete_with_http_info(path, parameters = nil, request_options = {})
124124
if @api_client.config.client_side_validation && path.nil?
125125
raise ArgumentError, "Parameter `path` is required when calling `custom_delete`."
126126
end
127+
# verify the required parameter 'path' is not empty
128+
if @api_client.config.client_side_validation && path.empty?
129+
raise ArgumentError, "Parameter `path` is required when calling `custom_delete`."
130+
end
127131

128132
path = "/{path}".sub("{" + "path" + "}", path.to_s)
129133
query_params = {}
@@ -167,6 +171,10 @@ def custom_get_with_http_info(path, parameters = nil, request_options = {})
167171
if @api_client.config.client_side_validation && path.nil?
168172
raise ArgumentError, "Parameter `path` is required when calling `custom_get`."
169173
end
174+
# verify the required parameter 'path' is not empty
175+
if @api_client.config.client_side_validation && path.empty?
176+
raise ArgumentError, "Parameter `path` is required when calling `custom_get`."
177+
end
170178

171179
path = "/{path}".sub("{" + "path" + "}", path.to_s)
172180
query_params = {}
@@ -211,6 +219,10 @@ def custom_post_with_http_info(path, parameters = nil, body = nil, request_optio
211219
if @api_client.config.client_side_validation && path.nil?
212220
raise ArgumentError, "Parameter `path` is required when calling `custom_post`."
213221
end
222+
# verify the required parameter 'path' is not empty
223+
if @api_client.config.client_side_validation && path.empty?
224+
raise ArgumentError, "Parameter `path` is required when calling `custom_post`."
225+
end
214226

215227
path = "/{path}".sub("{" + "path" + "}", path.to_s)
216228
query_params = {}
@@ -256,6 +268,10 @@ def custom_put_with_http_info(path, parameters = nil, body = nil, request_option
256268
if @api_client.config.client_side_validation && path.nil?
257269
raise ArgumentError, "Parameter `path` is required when calling `custom_put`."
258270
end
271+
# verify the required parameter 'path' is not empty
272+
if @api_client.config.client_side_validation && path.empty?
273+
raise ArgumentError, "Parameter `path` is required when calling `custom_put`."
274+
end
259275

260276
path = "/{path}".sub("{" + "path" + "}", path.to_s)
261277
query_params = {}

lib/algolia/api/abtesting_v3_client.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ def custom_delete_with_http_info(path, parameters = nil, request_options = {})
124124
if @api_client.config.client_side_validation && path.nil?
125125
raise ArgumentError, "Parameter `path` is required when calling `custom_delete`."
126126
end
127+
# verify the required parameter 'path' is not empty
128+
if @api_client.config.client_side_validation && path.empty?
129+
raise ArgumentError, "Parameter `path` is required when calling `custom_delete`."
130+
end
127131

128132
path = "/{path}".sub("{" + "path" + "}", path.to_s)
129133
query_params = {}
@@ -167,6 +171,10 @@ def custom_get_with_http_info(path, parameters = nil, request_options = {})
167171
if @api_client.config.client_side_validation && path.nil?
168172
raise ArgumentError, "Parameter `path` is required when calling `custom_get`."
169173
end
174+
# verify the required parameter 'path' is not empty
175+
if @api_client.config.client_side_validation && path.empty?
176+
raise ArgumentError, "Parameter `path` is required when calling `custom_get`."
177+
end
170178

171179
path = "/{path}".sub("{" + "path" + "}", path.to_s)
172180
query_params = {}
@@ -211,6 +219,10 @@ def custom_post_with_http_info(path, parameters = nil, body = nil, request_optio
211219
if @api_client.config.client_side_validation && path.nil?
212220
raise ArgumentError, "Parameter `path` is required when calling `custom_post`."
213221
end
222+
# verify the required parameter 'path' is not empty
223+
if @api_client.config.client_side_validation && path.empty?
224+
raise ArgumentError, "Parameter `path` is required when calling `custom_post`."
225+
end
214226

215227
path = "/{path}".sub("{" + "path" + "}", path.to_s)
216228
query_params = {}
@@ -256,6 +268,10 @@ def custom_put_with_http_info(path, parameters = nil, body = nil, request_option
256268
if @api_client.config.client_side_validation && path.nil?
257269
raise ArgumentError, "Parameter `path` is required when calling `custom_put`."
258270
end
271+
# verify the required parameter 'path' is not empty
272+
if @api_client.config.client_side_validation && path.empty?
273+
raise ArgumentError, "Parameter `path` is required when calling `custom_put`."
274+
end
259275

260276
path = "/{path}".sub("{" + "path" + "}", path.to_s)
261277
query_params = {}

lib/algolia/api/analytics_client.rb

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ def custom_delete_with_http_info(path, parameters = nil, request_options = {})
8080
if @api_client.config.client_side_validation && path.nil?
8181
raise ArgumentError, "Parameter `path` is required when calling `custom_delete`."
8282
end
83+
# verify the required parameter 'path' is not empty
84+
if @api_client.config.client_side_validation && path.empty?
85+
raise ArgumentError, "Parameter `path` is required when calling `custom_delete`."
86+
end
8387

8488
path = "/{path}".sub("{" + "path" + "}", path.to_s)
8589
query_params = {}
@@ -123,6 +127,10 @@ def custom_get_with_http_info(path, parameters = nil, request_options = {})
123127
if @api_client.config.client_side_validation && path.nil?
124128
raise ArgumentError, "Parameter `path` is required when calling `custom_get`."
125129
end
130+
# verify the required parameter 'path' is not empty
131+
if @api_client.config.client_side_validation && path.empty?
132+
raise ArgumentError, "Parameter `path` is required when calling `custom_get`."
133+
end
126134

127135
path = "/{path}".sub("{" + "path" + "}", path.to_s)
128136
query_params = {}
@@ -167,6 +175,10 @@ def custom_post_with_http_info(path, parameters = nil, body = nil, request_optio
167175
if @api_client.config.client_side_validation && path.nil?
168176
raise ArgumentError, "Parameter `path` is required when calling `custom_post`."
169177
end
178+
# verify the required parameter 'path' is not empty
179+
if @api_client.config.client_side_validation && path.empty?
180+
raise ArgumentError, "Parameter `path` is required when calling `custom_post`."
181+
end
170182

171183
path = "/{path}".sub("{" + "path" + "}", path.to_s)
172184
query_params = {}
@@ -212,6 +224,10 @@ def custom_put_with_http_info(path, parameters = nil, body = nil, request_option
212224
if @api_client.config.client_side_validation && path.nil?
213225
raise ArgumentError, "Parameter `path` is required when calling `custom_put`."
214226
end
227+
# verify the required parameter 'path' is not empty
228+
if @api_client.config.client_side_validation && path.empty?
229+
raise ArgumentError, "Parameter `path` is required when calling `custom_put`."
230+
end
215231

216232
path = "/{path}".sub("{" + "path" + "}", path.to_s)
217233
query_params = {}
@@ -260,6 +276,10 @@ def get_add_to_cart_rate_with_http_info(index, start_date = nil, end_date = nil,
260276
if @api_client.config.client_side_validation && index.nil?
261277
raise ArgumentError, "Parameter `index` is required when calling `get_add_to_cart_rate`."
262278
end
279+
# verify the required parameter 'index' is not empty
280+
if @api_client.config.client_side_validation && index.empty?
281+
raise ArgumentError, "Parameter `index` is required when calling `get_add_to_cart_rate`."
282+
end
263283

264284
path = "/2/conversions/addToCartRate"
265285
query_params = {}
@@ -323,6 +343,10 @@ def get_average_click_position_with_http_info(
323343
if @api_client.config.client_side_validation && index.nil?
324344
raise ArgumentError, "Parameter `index` is required when calling `get_average_click_position`."
325345
end
346+
# verify the required parameter 'index' is not empty
347+
if @api_client.config.client_side_validation && index.empty?
348+
raise ArgumentError, "Parameter `index` is required when calling `get_average_click_position`."
349+
end
326350

327351
path = "/2/clicks/averageClickPosition"
328352
query_params = {}
@@ -380,6 +404,10 @@ def get_click_positions_with_http_info(index, start_date = nil, end_date = nil,
380404
if @api_client.config.client_side_validation && index.nil?
381405
raise ArgumentError, "Parameter `index` is required when calling `get_click_positions`."
382406
end
407+
# verify the required parameter 'index' is not empty
408+
if @api_client.config.client_side_validation && index.empty?
409+
raise ArgumentError, "Parameter `index` is required when calling `get_click_positions`."
410+
end
383411

384412
path = "/2/clicks/positions"
385413
query_params = {}
@@ -437,6 +465,10 @@ def get_click_through_rate_with_http_info(index, start_date = nil, end_date = ni
437465
if @api_client.config.client_side_validation && index.nil?
438466
raise ArgumentError, "Parameter `index` is required when calling `get_click_through_rate`."
439467
end
468+
# verify the required parameter 'index' is not empty
469+
if @api_client.config.client_side_validation && index.empty?
470+
raise ArgumentError, "Parameter `index` is required when calling `get_click_through_rate`."
471+
end
440472

441473
path = "/2/clicks/clickThroughRate"
442474
query_params = {}
@@ -494,6 +526,10 @@ def get_conversion_rate_with_http_info(index, start_date = nil, end_date = nil,
494526
if @api_client.config.client_side_validation && index.nil?
495527
raise ArgumentError, "Parameter `index` is required when calling `get_conversion_rate`."
496528
end
529+
# verify the required parameter 'index' is not empty
530+
if @api_client.config.client_side_validation && index.empty?
531+
raise ArgumentError, "Parameter `index` is required when calling `get_conversion_rate`."
532+
end
497533

498534
path = "/2/conversions/conversionRate"
499535
query_params = {}
@@ -551,6 +587,10 @@ def get_no_click_rate_with_http_info(index, start_date = nil, end_date = nil, ta
551587
if @api_client.config.client_side_validation && index.nil?
552588
raise ArgumentError, "Parameter `index` is required when calling `get_no_click_rate`."
553589
end
590+
# verify the required parameter 'index' is not empty
591+
if @api_client.config.client_side_validation && index.empty?
592+
raise ArgumentError, "Parameter `index` is required when calling `get_no_click_rate`."
593+
end
554594

555595
path = "/2/searches/noClickRate"
556596
query_params = {}
@@ -605,6 +645,10 @@ def get_no_results_rate_with_http_info(index, start_date = nil, end_date = nil,
605645
if @api_client.config.client_side_validation && index.nil?
606646
raise ArgumentError, "Parameter `index` is required when calling `get_no_results_rate`."
607647
end
648+
# verify the required parameter 'index' is not empty
649+
if @api_client.config.client_side_validation && index.empty?
650+
raise ArgumentError, "Parameter `index` is required when calling `get_no_results_rate`."
651+
end
608652

609653
path = "/2/searches/noResultRate"
610654
query_params = {}
@@ -662,6 +706,10 @@ def get_purchase_rate_with_http_info(index, start_date = nil, end_date = nil, ta
662706
if @api_client.config.client_side_validation && index.nil?
663707
raise ArgumentError, "Parameter `index` is required when calling `get_purchase_rate`."
664708
end
709+
# verify the required parameter 'index' is not empty
710+
if @api_client.config.client_side_validation && index.empty?
711+
raise ArgumentError, "Parameter `index` is required when calling `get_purchase_rate`."
712+
end
665713

666714
path = "/2/conversions/purchaseRate"
667715
query_params = {}
@@ -719,6 +767,10 @@ def get_revenue_with_http_info(index, start_date = nil, end_date = nil, tags = n
719767
if @api_client.config.client_side_validation && index.nil?
720768
raise ArgumentError, "Parameter `index` is required when calling `get_revenue`."
721769
end
770+
# verify the required parameter 'index' is not empty
771+
if @api_client.config.client_side_validation && index.empty?
772+
raise ArgumentError, "Parameter `index` is required when calling `get_revenue`."
773+
end
722774

723775
path = "/2/conversions/revenue"
724776
query_params = {}
@@ -773,6 +825,10 @@ def get_searches_count_with_http_info(index, start_date = nil, end_date = nil, t
773825
if @api_client.config.client_side_validation && index.nil?
774826
raise ArgumentError, "Parameter `index` is required when calling `get_searches_count`."
775827
end
828+
# verify the required parameter 'index' is not empty
829+
if @api_client.config.client_side_validation && index.empty?
830+
raise ArgumentError, "Parameter `index` is required when calling `get_searches_count`."
831+
end
776832

777833
path = "/2/searches/count"
778834
query_params = {}
@@ -840,6 +896,10 @@ def get_searches_no_clicks_with_http_info(
840896
if @api_client.config.client_side_validation && index.nil?
841897
raise ArgumentError, "Parameter `index` is required when calling `get_searches_no_clicks`."
842898
end
899+
# verify the required parameter 'index' is not empty
900+
if @api_client.config.client_side_validation && index.empty?
901+
raise ArgumentError, "Parameter `index` is required when calling `get_searches_no_clicks`."
902+
end
843903

844904
path = "/2/searches/noClicks"
845905
query_params = {}
@@ -927,6 +987,10 @@ def get_searches_no_results_with_http_info(
927987
if @api_client.config.client_side_validation && index.nil?
928988
raise ArgumentError, "Parameter `index` is required when calling `get_searches_no_results`."
929989
end
990+
# verify the required parameter 'index' is not empty
991+
if @api_client.config.client_side_validation && index.empty?
992+
raise ArgumentError, "Parameter `index` is required when calling `get_searches_no_results`."
993+
end
930994

931995
path = "/2/searches/noResults"
932996
query_params = {}
@@ -1001,6 +1065,10 @@ def get_status_with_http_info(index, request_options = {})
10011065
if @api_client.config.client_side_validation && index.nil?
10021066
raise ArgumentError, "Parameter `index` is required when calling `get_status`."
10031067
end
1068+
# verify the required parameter 'index' is not empty
1069+
if @api_client.config.client_side_validation && index.empty?
1070+
raise ArgumentError, "Parameter `index` is required when calling `get_status`."
1071+
end
10041072

10051073
path = "/2/status"
10061074
query_params = {}
@@ -1059,6 +1127,10 @@ def get_top_countries_with_http_info(
10591127
if @api_client.config.client_side_validation && index.nil?
10601128
raise ArgumentError, "Parameter `index` is required when calling `get_top_countries`."
10611129
end
1130+
# verify the required parameter 'index' is not empty
1131+
if @api_client.config.client_side_validation && index.empty?
1132+
raise ArgumentError, "Parameter `index` is required when calling `get_top_countries`."
1133+
end
10621134

10631135
path = "/2/countries"
10641136
query_params = {}
@@ -1140,6 +1212,10 @@ def get_top_filter_attributes_with_http_info(
11401212
if @api_client.config.client_side_validation && index.nil?
11411213
raise ArgumentError, "Parameter `index` is required when calling `get_top_filter_attributes`."
11421214
end
1215+
# verify the required parameter 'index' is not empty
1216+
if @api_client.config.client_side_validation && index.empty?
1217+
raise ArgumentError, "Parameter `index` is required when calling `get_top_filter_attributes`."
1218+
end
11431219

11441220
path = "/2/filters"
11451221
query_params = {}
@@ -1235,10 +1311,18 @@ def get_top_filter_for_attribute_with_http_info(
12351311
if @api_client.config.client_side_validation && attribute.nil?
12361312
raise ArgumentError, "Parameter `attribute` is required when calling `get_top_filter_for_attribute`."
12371313
end
1314+
# verify the required parameter 'attribute' is not empty
1315+
if @api_client.config.client_side_validation && attribute.empty?
1316+
raise ArgumentError, "Parameter `attribute` is required when calling `get_top_filter_for_attribute`."
1317+
end
12381318
# verify the required parameter 'index' is set
12391319
if @api_client.config.client_side_validation && index.nil?
12401320
raise ArgumentError, "Parameter `index` is required when calling `get_top_filter_for_attribute`."
12411321
end
1322+
# verify the required parameter 'index' is not empty
1323+
if @api_client.config.client_side_validation && index.empty?
1324+
raise ArgumentError, "Parameter `index` is required when calling `get_top_filter_for_attribute`."
1325+
end
12421326

12431327
path = "/2/filters/{attribute}".sub("{" + "attribute" + "}", Transport.encode_uri(attribute.to_s))
12441328
query_params = {}
@@ -1335,6 +1419,10 @@ def get_top_filters_no_results_with_http_info(
13351419
if @api_client.config.client_side_validation && index.nil?
13361420
raise ArgumentError, "Parameter `index` is required when calling `get_top_filters_no_results`."
13371421
end
1422+
# verify the required parameter 'index' is not empty
1423+
if @api_client.config.client_side_validation && index.empty?
1424+
raise ArgumentError, "Parameter `index` is required when calling `get_top_filters_no_results`."
1425+
end
13381426

13391427
path = "/2/filters/noResults"
13401428
query_params = {}
@@ -1432,6 +1520,10 @@ def get_top_hits_with_http_info(
14321520
if @api_client.config.client_side_validation && index.nil?
14331521
raise ArgumentError, "Parameter `index` is required when calling `get_top_hits`."
14341522
end
1523+
# verify the required parameter 'index' is not empty
1524+
if @api_client.config.client_side_validation && index.empty?
1525+
raise ArgumentError, "Parameter `index` is required when calling `get_top_hits`."
1526+
end
14351527

14361528
path = "/2/hits"
14371529
query_params = {}
@@ -1536,6 +1628,10 @@ def get_top_searches_with_http_info(
15361628
if @api_client.config.client_side_validation && index.nil?
15371629
raise ArgumentError, "Parameter `index` is required when calling `get_top_searches`."
15381630
end
1631+
# verify the required parameter 'index' is not empty
1632+
if @api_client.config.client_side_validation && index.empty?
1633+
raise ArgumentError, "Parameter `index` is required when calling `get_top_searches`."
1634+
end
15391635

15401636
path = "/2/searches"
15411637
query_params = {}
@@ -1626,6 +1722,10 @@ def get_users_count_with_http_info(index, start_date = nil, end_date = nil, tags
16261722
if @api_client.config.client_side_validation && index.nil?
16271723
raise ArgumentError, "Parameter `index` is required when calling `get_users_count`."
16281724
end
1725+
# verify the required parameter 'index' is not empty
1726+
if @api_client.config.client_side_validation && index.empty?
1727+
raise ArgumentError, "Parameter `index` is required when calling `get_users_count`."
1728+
end
16291729

16301730
path = "/2/users/count"
16311731
query_params = {}

0 commit comments

Comments
 (0)