You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/Api/AnalyticsClient.php
+72-16Lines changed: 72 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -744,8 +744,8 @@ public function getSearchesCount($index, $startDate = null, $endDate = null, $ta
744
744
* @param string $index Index name. (required)
745
745
* @param string $startDate Start date of the period to analyze, in `YYYY-MM-DD` format. (optional)
746
746
* @param string $endDate End date of the period to analyze, in `YYYY-MM-DD` format. (optional)
747
-
* @param int $limit Number of items to return. (optional, default to 10)
748
-
* @param int $offset Position of the first item to return. (optional, default to 0)
747
+
* @param int $limit Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved. (optional, default to 10)
748
+
* @param int $offset Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved. (optional, default to 0)
749
749
* @param string $tags Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/). (optional)
750
750
* @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions
751
751
*
@@ -759,6 +759,13 @@ public function getSearchesNoClicks($index, $startDate = null, $endDate = null,
759
759
'Parameter `index` is required when calling `getSearchesNoClicks`.'
760
760
);
761
761
}
762
+
if (null !== $limit && $limit > 1000) {
763
+
thrownew \InvalidArgumentException('invalid value for "$limit" when calling AnalyticsClient.getSearchesNoClicks, must be smaller than or equal to 1000.');
764
+
}
765
+
766
+
if (null !== $offset && $offset > 1000) {
767
+
thrownew \InvalidArgumentException('invalid value for "$offset" when calling AnalyticsClient.getSearchesNoClicks, must be smaller than or equal to 1000.');
768
+
}
762
769
if (null !== $offset && $offset < 0) {
763
770
thrownew \InvalidArgumentException('invalid value for "$offset" when calling AnalyticsClient.getSearchesNoClicks, must be bigger than or equal to 0.');
764
771
}
@@ -804,8 +811,8 @@ public function getSearchesNoClicks($index, $startDate = null, $endDate = null,
804
811
* @param string $index Index name. (required)
805
812
* @param string $startDate Start date of the period to analyze, in `YYYY-MM-DD` format. (optional)
806
813
* @param string $endDate End date of the period to analyze, in `YYYY-MM-DD` format. (optional)
807
-
* @param int $limit Number of items to return. (optional, default to 10)
808
-
* @param int $offset Position of the first item to return. (optional, default to 0)
814
+
* @param int $limit Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved. (optional, default to 10)
815
+
* @param int $offset Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved. (optional, default to 0)
809
816
* @param string $tags Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/). (optional)
810
817
* @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions
811
818
*
@@ -819,6 +826,13 @@ public function getSearchesNoResults($index, $startDate = null, $endDate = null,
819
826
'Parameter `index` is required when calling `getSearchesNoResults`.'
820
827
);
821
828
}
829
+
if (null !== $limit && $limit > 1000) {
830
+
thrownew \InvalidArgumentException('invalid value for "$limit" when calling AnalyticsClient.getSearchesNoResults, must be smaller than or equal to 1000.');
831
+
}
832
+
833
+
if (null !== $offset && $offset > 1000) {
834
+
thrownew \InvalidArgumentException('invalid value for "$offset" when calling AnalyticsClient.getSearchesNoResults, must be smaller than or equal to 1000.');
835
+
}
822
836
if (null !== $offset && $offset < 0) {
823
837
thrownew \InvalidArgumentException('invalid value for "$offset" when calling AnalyticsClient.getSearchesNoResults, must be bigger than or equal to 0.');
824
838
}
@@ -896,8 +910,8 @@ public function getStatus($index, $requestOptions = [])
896
910
* @param string $index Index name. (required)
897
911
* @param string $startDate Start date of the period to analyze, in `YYYY-MM-DD` format. (optional)
898
912
* @param string $endDate End date of the period to analyze, in `YYYY-MM-DD` format. (optional)
899
-
* @param int $limit Number of items to return. (optional, default to 10)
900
-
* @param int $offset Position of the first item to return. (optional, default to 0)
913
+
* @param int $limit Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved. (optional, default to 10)
914
+
* @param int $offset Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved. (optional, default to 0)
901
915
* @param string $tags Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/). (optional)
902
916
* @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions
903
917
*
@@ -911,6 +925,13 @@ public function getTopCountries($index, $startDate = null, $endDate = null, $lim
911
925
'Parameter `index` is required when calling `getTopCountries`.'
912
926
);
913
927
}
928
+
if (null !== $limit && $limit > 1000) {
929
+
thrownew \InvalidArgumentException('invalid value for "$limit" when calling AnalyticsClient.getTopCountries, must be smaller than or equal to 1000.');
930
+
}
931
+
932
+
if (null !== $offset && $offset > 1000) {
933
+
thrownew \InvalidArgumentException('invalid value for "$offset" when calling AnalyticsClient.getTopCountries, must be smaller than or equal to 1000.');
934
+
}
914
935
if (null !== $offset && $offset < 0) {
915
936
thrownew \InvalidArgumentException('invalid value for "$offset" when calling AnalyticsClient.getTopCountries, must be bigger than or equal to 0.');
916
937
}
@@ -957,8 +978,8 @@ public function getTopCountries($index, $startDate = null, $endDate = null, $lim
957
978
* @param string $search Search query. (optional)
958
979
* @param string $startDate Start date of the period to analyze, in `YYYY-MM-DD` format. (optional)
959
980
* @param string $endDate End date of the period to analyze, in `YYYY-MM-DD` format. (optional)
960
-
* @param int $limit Number of items to return. (optional, default to 10)
961
-
* @param int $offset Position of the first item to return. (optional, default to 0)
981
+
* @param int $limit Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved. (optional, default to 10)
982
+
* @param int $offset Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved. (optional, default to 0)
962
983
* @param string $tags Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/). (optional)
963
984
* @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions
964
985
*
@@ -972,6 +993,13 @@ public function getTopFilterAttributes($index, $search = null, $startDate = null
972
993
'Parameter `index` is required when calling `getTopFilterAttributes`.'
973
994
);
974
995
}
996
+
if (null !== $limit && $limit > 1000) {
997
+
thrownew \InvalidArgumentException('invalid value for "$limit" when calling AnalyticsClient.getTopFilterAttributes, must be smaller than or equal to 1000.');
998
+
}
999
+
1000
+
if (null !== $offset && $offset > 1000) {
1001
+
thrownew \InvalidArgumentException('invalid value for "$offset" when calling AnalyticsClient.getTopFilterAttributes, must be smaller than or equal to 1000.');
1002
+
}
975
1003
if (null !== $offset && $offset < 0) {
976
1004
thrownew \InvalidArgumentException('invalid value for "$offset" when calling AnalyticsClient.getTopFilterAttributes, must be bigger than or equal to 0.');
977
1005
}
@@ -1023,8 +1051,8 @@ public function getTopFilterAttributes($index, $search = null, $startDate = null
1023
1051
* @param string $search Search query. (optional)
1024
1052
* @param string $startDate Start date of the period to analyze, in `YYYY-MM-DD` format. (optional)
1025
1053
* @param string $endDate End date of the period to analyze, in `YYYY-MM-DD` format. (optional)
1026
-
* @param int $limit Number of items to return. (optional, default to 10)
1027
-
* @param int $offset Position of the first item to return. (optional, default to 0)
1054
+
* @param int $limit Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved. (optional, default to 10)
1055
+
* @param int $offset Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved. (optional, default to 0)
1028
1056
* @param string $tags Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/). (optional)
1029
1057
* @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions
1030
1058
*
@@ -1044,6 +1072,13 @@ public function getTopFilterForAttribute($attribute, $index, $search = null, $st
1044
1072
'Parameter `index` is required when calling `getTopFilterForAttribute`.'
1045
1073
);
1046
1074
}
1075
+
if (null !== $limit && $limit > 1000) {
1076
+
thrownew \InvalidArgumentException('invalid value for "$limit" when calling AnalyticsClient.getTopFilterForAttribute, must be smaller than or equal to 1000.');
1077
+
}
1078
+
1079
+
if (null !== $offset && $offset > 1000) {
1080
+
thrownew \InvalidArgumentException('invalid value for "$offset" when calling AnalyticsClient.getTopFilterForAttribute, must be smaller than or equal to 1000.');
1081
+
}
1047
1082
if (null !== $offset && $offset < 0) {
1048
1083
thrownew \InvalidArgumentException('invalid value for "$offset" when calling AnalyticsClient.getTopFilterForAttribute, must be bigger than or equal to 0.');
1049
1084
}
@@ -1103,8 +1138,8 @@ public function getTopFilterForAttribute($attribute, $index, $search = null, $st
1103
1138
* @param string $search Search query. (optional)
1104
1139
* @param string $startDate Start date of the period to analyze, in `YYYY-MM-DD` format. (optional)
1105
1140
* @param string $endDate End date of the period to analyze, in `YYYY-MM-DD` format. (optional)
1106
-
* @param int $limit Number of items to return. (optional, default to 10)
1107
-
* @param int $offset Position of the first item to return. (optional, default to 0)
1141
+
* @param int $limit Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved. (optional, default to 10)
1142
+
* @param int $offset Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved. (optional, default to 0)
1108
1143
* @param string $tags Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/). (optional)
1109
1144
* @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions
1110
1145
*
@@ -1118,6 +1153,13 @@ public function getTopFiltersNoResults($index, $search = null, $startDate = null
1118
1153
'Parameter `index` is required when calling `getTopFiltersNoResults`.'
1119
1154
);
1120
1155
}
1156
+
if (null !== $limit && $limit > 1000) {
1157
+
thrownew \InvalidArgumentException('invalid value for "$limit" when calling AnalyticsClient.getTopFiltersNoResults, must be smaller than or equal to 1000.');
1158
+
}
1159
+
1160
+
if (null !== $offset && $offset > 1000) {
1161
+
thrownew \InvalidArgumentException('invalid value for "$offset" when calling AnalyticsClient.getTopFiltersNoResults, must be smaller than or equal to 1000.');
1162
+
}
1121
1163
if (null !== $offset && $offset < 0) {
1122
1164
thrownew \InvalidArgumentException('invalid value for "$offset" when calling AnalyticsClient.getTopFiltersNoResults, must be bigger than or equal to 0.');
1123
1165
}
@@ -1170,8 +1212,8 @@ public function getTopFiltersNoResults($index, $search = null, $startDate = null
1170
1212
* @param bool $revenueAnalytics Whether to include revenue-related metrics in the response. If true, metrics related to click and conversion events are also included in the response. (optional, default to false)
1171
1213
* @param string $startDate Start date of the period to analyze, in `YYYY-MM-DD` format. (optional)
1172
1214
* @param string $endDate End date of the period to analyze, in `YYYY-MM-DD` format. (optional)
1173
-
* @param int $limit Number of items to return. (optional, default to 10)
1174
-
* @param int $offset Position of the first item to return. (optional, default to 0)
1215
+
* @param int $limit Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved. (optional, default to 10)
1216
+
* @param int $offset Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved. (optional, default to 0)
1175
1217
* @param string $tags Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/). (optional)
1176
1218
* @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions
1177
1219
*
@@ -1185,6 +1227,13 @@ public function getTopHits($index, $search = null, $clickAnalytics = null, $reve
1185
1227
'Parameter `index` is required when calling `getTopHits`.'
1186
1228
);
1187
1229
}
1230
+
if (null !== $limit && $limit > 1000) {
1231
+
thrownew \InvalidArgumentException('invalid value for "$limit" when calling AnalyticsClient.getTopHits, must be smaller than or equal to 1000.');
1232
+
}
1233
+
1234
+
if (null !== $offset && $offset > 1000) {
1235
+
thrownew \InvalidArgumentException('invalid value for "$offset" when calling AnalyticsClient.getTopHits, must be smaller than or equal to 1000.');
1236
+
}
1188
1237
if (null !== $offset && $offset < 0) {
1189
1238
thrownew \InvalidArgumentException('invalid value for "$offset" when calling AnalyticsClient.getTopHits, must be bigger than or equal to 0.');
1190
1239
}
@@ -1246,8 +1295,8 @@ public function getTopHits($index, $search = null, $clickAnalytics = null, $reve
1246
1295
* @param string $endDate End date of the period to analyze, in `YYYY-MM-DD` format. (optional)
1247
1296
* @param array $orderBy Attribute by which to order the response items. If the `clickAnalytics` parameter is false, only `searchCount` is available. (optional)
1248
1297
* @param array $direction Sorting direction of the results: ascending or descending. (optional)
1249
-
* @param int $limit Number of items to return. (optional, default to 10)
1250
-
* @param int $offset Position of the first item to return. (optional, default to 0)
1298
+
* @param int $limit Number of items to return. Combined with the `offset` parameter, only the first 1000 items can be retrieved. (optional, default to 10)
1299
+
* @param int $offset Position of the first item to return. Combined with the `limit` parameter, only the first 1000 items can be retrieved. (optional, default to 0)
1251
1300
* @param string $tags Tags by which to segment the analytics. You can combine multiple tags with `OR` and `AND`. Tags must be URL-encoded. For more information, see [Segment your analytics data](https://www.algolia.com/doc/guides/search-analytics/guides/segments/). (optional)
1252
1301
* @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions
1253
1302
*
@@ -1261,6 +1310,13 @@ public function getTopSearches($index, $clickAnalytics = null, $revenueAnalytics
1261
1310
'Parameter `index` is required when calling `getTopSearches`.'
1262
1311
);
1263
1312
}
1313
+
if (null !== $limit && $limit > 1000) {
1314
+
thrownew \InvalidArgumentException('invalid value for "$limit" when calling AnalyticsClient.getTopSearches, must be smaller than or equal to 1000.');
1315
+
}
1316
+
1317
+
if (null !== $offset && $offset > 1000) {
1318
+
thrownew \InvalidArgumentException('invalid value for "$offset" when calling AnalyticsClient.getTopSearches, must be smaller than or equal to 1000.');
1319
+
}
1264
1320
if (null !== $offset && $offset < 0) {
1265
1321
thrownew \InvalidArgumentException('invalid value for "$offset" when calling AnalyticsClient.getTopSearches, must be bigger than or equal to 0.');
0 commit comments