Skip to content

Commit f2a4321

Browse files
algolia-botshortcutsmillotpFluf22
committed
feat(generators): allow per-spec timeouts [skip-bc] (generated)
algolia/api-clients-automation#4173 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]> Co-authored-by: Pierre Millot <[email protected]> Co-authored-by: Thomas Raffray <[email protected]>
1 parent 1051966 commit f2a4321

9 files changed

+126
-14
lines changed

lib/Configuration/AbtestingConfig.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,18 @@ public static function create($appId, $apiKey, $region = null)
2525

2626
return parent::create($appId, $apiKey, $region);
2727
}
28+
29+
public function getDefaultConfiguration()
30+
{
31+
return [
32+
'appId' => '',
33+
'apiKey' => '',
34+
'hosts' => null,
35+
'hasFullHosts' => false,
36+
'readTimeout' => 5,
37+
'writeTimeout' => 30,
38+
'connectTimeout' => 2,
39+
'defaultHeaders' => [],
40+
];
41+
}
2842
}

lib/Configuration/AnalyticsConfig.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,18 @@ public static function create($appId, $apiKey, $region = null)
2525

2626
return parent::create($appId, $apiKey, $region);
2727
}
28+
29+
public function getDefaultConfiguration()
30+
{
31+
return [
32+
'appId' => '',
33+
'apiKey' => '',
34+
'hosts' => null,
35+
'hasFullHosts' => false,
36+
'readTimeout' => 5,
37+
'writeTimeout' => 30,
38+
'connectTimeout' => 2,
39+
'defaultHeaders' => [],
40+
];
41+
}
2842
}

lib/Configuration/IngestionConfig.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,18 @@ public static function create($appId, $apiKey, $region = null)
2626

2727
return parent::create($appId, $apiKey, $region);
2828
}
29+
30+
public function getDefaultConfiguration()
31+
{
32+
return [
33+
'appId' => '',
34+
'apiKey' => '',
35+
'hosts' => null,
36+
'hasFullHosts' => false,
37+
'readTimeout' => 25,
38+
'writeTimeout' => 25,
39+
'connectTimeout' => 25,
40+
'defaultHeaders' => [],
41+
];
42+
}
2943
}

lib/Configuration/InsightsConfig.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,18 @@ public static function create($appId, $apiKey, $region = null)
2525

2626
return parent::create($appId, $apiKey, $region);
2727
}
28+
29+
public function getDefaultConfiguration()
30+
{
31+
return [
32+
'appId' => '',
33+
'apiKey' => '',
34+
'hosts' => null,
35+
'hasFullHosts' => false,
36+
'readTimeout' => 5,
37+
'writeTimeout' => 30,
38+
'connectTimeout' => 2,
39+
'defaultHeaders' => [],
40+
];
41+
}
2842
}

lib/Configuration/MonitoringConfig.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,18 @@
77
class MonitoringConfig extends Configuration
88
{
99
protected $clientName = 'Monitoring';
10+
11+
public function getDefaultConfiguration()
12+
{
13+
return [
14+
'appId' => '',
15+
'apiKey' => '',
16+
'hosts' => null,
17+
'hasFullHosts' => false,
18+
'readTimeout' => 5,
19+
'writeTimeout' => 30,
20+
'connectTimeout' => 2,
21+
'defaultHeaders' => [],
22+
];
23+
}
1024
}

lib/Configuration/PersonalizationConfig.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,18 @@ public static function create($appId, $apiKey, $region = null)
2626

2727
return parent::create($appId, $apiKey, $region);
2828
}
29+
30+
public function getDefaultConfiguration()
31+
{
32+
return [
33+
'appId' => '',
34+
'apiKey' => '',
35+
'hosts' => null,
36+
'hasFullHosts' => false,
37+
'readTimeout' => 5,
38+
'writeTimeout' => 30,
39+
'connectTimeout' => 2,
40+
'defaultHeaders' => [],
41+
];
42+
}
2943
}

lib/Configuration/QuerySuggestionsConfig.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,18 @@ public static function create($appId, $apiKey, $region = null)
2626

2727
return parent::create($appId, $apiKey, $region);
2828
}
29+
30+
public function getDefaultConfiguration()
31+
{
32+
return [
33+
'appId' => '',
34+
'apiKey' => '',
35+
'hosts' => null,
36+
'hasFullHosts' => false,
37+
'readTimeout' => 5,
38+
'writeTimeout' => 30,
39+
'connectTimeout' => 2,
40+
'defaultHeaders' => [],
41+
];
42+
}
2943
}

lib/Configuration/RecommendConfig.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,18 @@
77
class RecommendConfig extends Configuration
88
{
99
protected $clientName = 'Recommend';
10+
11+
public function getDefaultConfiguration()
12+
{
13+
return [
14+
'appId' => '',
15+
'apiKey' => '',
16+
'hosts' => null,
17+
'hasFullHosts' => false,
18+
'readTimeout' => 5,
19+
'writeTimeout' => 30,
20+
'connectTimeout' => 2,
21+
'defaultHeaders' => [],
22+
];
23+
}
1024
}

lib/Configuration/SearchConfig.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,31 +21,31 @@ public static function create($appId, $apiKey)
2121
return new static($config);
2222
}
2323

24+
public function getWaitTaskTimeBeforeRetry()
25+
{
26+
return $this->config['waitTaskTimeBeforeRetry'];
27+
}
28+
29+
public function getDefaultMaxRetries()
30+
{
31+
return $this->config['defaultMaxRetries'];
32+
}
33+
2434
public function getDefaultConfiguration()
2535
{
2636
return [
2737
'appId' => '',
2838
'apiKey' => '',
2939
'hosts' => null,
3040
'hasFullHosts' => false,
31-
'readTimeout' => $this->defaultReadTimeout,
32-
'writeTimeout' => $this->defaultWriteTimeout,
33-
'connectTimeout' => $this->defaultConnectTimeout,
41+
'readTimeout' => 5,
42+
'writeTimeout' => 30,
43+
'connectTimeout' => 2,
44+
'defaultHeaders' => [],
3445
'waitTaskTimeBeforeRetry' => $this->defaultWaitTaskTimeBeforeRetry,
3546
'defaultMaxRetries' => $this->defaultMaxRetries,
36-
'defaultHeaders' => [],
3747
'defaultForwardToReplicas' => null,
3848
'batchSize' => 1000,
3949
];
4050
}
41-
42-
public function getWaitTaskTimeBeforeRetry()
43-
{
44-
return $this->config['waitTaskTimeBeforeRetry'];
45-
}
46-
47-
public function getDefaultMaxRetries()
48-
{
49-
return $this->config['defaultMaxRetries'];
50-
}
5151
}

0 commit comments

Comments
 (0)