Skip to content

Commit d894459

Browse files
authored
Add Ssm Client (#489)
* Add SSM client * Improve Generation docuementation * Add metods to SSM * Fix pagination without result * Add tests * Add entry in AwsPackagesProvider * Add entry in AwsClientFactory * Fix CS * Removed useless entry in contrib * Bump SSM test requirements
1 parent 254c75e commit d894459

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

src/AwsClientFactory.php

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use AsyncAws\Ses\SesClient;
2222
use AsyncAws\Sns\SnsClient;
2323
use AsyncAws\Sqs\SqsClient;
24+
use AsyncAws\Ssm\SsmClient;
2425
use Psr\Log\LoggerInterface;
2526
use Psr\Log\NullLogger;
2627
use Symfony\Component\HttpClient\HttpClient;
@@ -158,27 +159,40 @@ public function sns(): SnsClient
158159
return $this->serviceCache[__METHOD__];
159160
}
160161

161-
public function sts(): StsClient
162+
public function sqs(): SqsClient
162163
{
163-
if (!class_exists(StsClient::class)) {
164-
throw MissingDependency::create('async-aws/core', 'STS');
164+
if (!class_exists(SqsClient::class)) {
165+
throw MissingDependency::create('async-aws/sqs', 'SQS');
165166
}
166167

167168
if (!isset($this->serviceCache[__METHOD__])) {
168-
$this->serviceCache[__METHOD__] = new StsClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
169+
$this->serviceCache[__METHOD__] = new SqsClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
169170
}
170171

171172
return $this->serviceCache[__METHOD__];
172173
}
173174

174-
public function sqs(): SqsClient
175+
public function ssm(): SsmClient
175176
{
176-
if (!class_exists(SqsClient::class)) {
177-
throw MissingDependency::create('async-aws/sqs', 'SQS');
177+
if (!class_exists(SsmClient::class)) {
178+
throw MissingDependency::create('async-aws/ssm', 'SSM');
178179
}
179180

180181
if (!isset($this->serviceCache[__METHOD__])) {
181-
$this->serviceCache[__METHOD__] = new SqsClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
182+
$this->serviceCache[__METHOD__] = new SsmClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
183+
}
184+
185+
return $this->serviceCache[__METHOD__];
186+
}
187+
188+
public function sts(): StsClient
189+
{
190+
if (!class_exists(StsClient::class)) {
191+
throw MissingDependency::create('async-aws/core', 'STS');
192+
}
193+
194+
if (!isset($this->serviceCache[__METHOD__])) {
195+
$this->serviceCache[__METHOD__] = new StsClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
182196
}
183197

184198
return $this->serviceCache[__METHOD__];

0 commit comments

Comments
 (0)