Skip to content

Commit cce588a

Browse files
Added StepFunctions client (#1050)
1 parent 203e494 commit cce588a

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/AwsClientFactory.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
use AsyncAws\Sns\SnsClient;
3131
use AsyncAws\Sqs\SqsClient;
3232
use AsyncAws\Ssm\SsmClient;
33+
use AsyncAws\StepFunctions\StepFunctionsClient;
3334
use Psr\Log\LoggerInterface;
3435
use Psr\Log\NullLogger;
3536
use Symfony\Component\HttpClient\HttpClient;
@@ -333,12 +334,21 @@ public function ssm(): SsmClient
333334

334335
public function sts(): StsClient
335336
{
336-
if (!class_exists(StsClient::class)) {
337-
throw MissingDependency::create('async-aws/core', 'STS');
337+
if (!isset($this->serviceCache[__METHOD__])) {
338+
$this->serviceCache[__METHOD__] = new StsClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
339+
}
340+
341+
return $this->serviceCache[__METHOD__];
342+
}
343+
344+
public function stepFunctions(): StepFunctionsClient
345+
{
346+
if (!class_exists(StepFunctionsClient::class)) {
347+
throw MissingDependency::create('async-aws/step-functions', 'StepFunctions');
338348
}
339349

340350
if (!isset($this->serviceCache[__METHOD__])) {
341-
$this->serviceCache[__METHOD__] = new StsClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
351+
$this->serviceCache[__METHOD__] = new StepFunctionsClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
342352
}
343353

344354
return $this->serviceCache[__METHOD__];

0 commit comments

Comments
 (0)