AwsClientFactory.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. <?php
  2. declare(strict_types=1);
  3. namespace AsyncAws\Core;
  4. use AsyncAws\AppSync\AppSyncClient;
  5. use AsyncAws\Athena\AthenaClient;
  6. use AsyncAws\CloudFormation\CloudFormationClient;
  7. use AsyncAws\CloudFront\CloudFrontClient;
  8. use AsyncAws\CloudWatch\CloudWatchClient;
  9. use AsyncAws\CloudWatchLogs\CloudWatchLogsClient;
  10. use AsyncAws\CodeBuild\CodeBuildClient;
  11. use AsyncAws\CodeCommit\CodeCommitClient;
  12. use AsyncAws\CodeDeploy\CodeDeployClient;
  13. use AsyncAws\CognitoIdentityProvider\CognitoIdentityProviderClient;
  14. use AsyncAws\Comprehend\ComprehendClient;
  15. use AsyncAws\Core\Credentials\CacheProvider;
  16. use AsyncAws\Core\Credentials\ChainProvider;
  17. use AsyncAws\Core\Credentials\CredentialProvider;
  18. use AsyncAws\Core\Exception\InvalidArgument;
  19. use AsyncAws\Core\Exception\MissingDependency;
  20. use AsyncAws\Core\Sts\StsClient;
  21. use AsyncAws\DynamoDb\DynamoDbClient;
  22. use AsyncAws\Ecr\EcrClient;
  23. use AsyncAws\ElastiCache\ElastiCacheClient;
  24. use AsyncAws\EventBridge\EventBridgeClient;
  25. use AsyncAws\Firehose\FirehoseClient;
  26. use AsyncAws\Iam\IamClient;
  27. use AsyncAws\Iot\IotClient;
  28. use AsyncAws\IotData\IotDataClient;
  29. use AsyncAws\Kinesis\KinesisClient;
  30. use AsyncAws\Kms\KmsClient;
  31. use AsyncAws\Lambda\LambdaClient;
  32. use AsyncAws\MediaConvert\MediaConvertClient;
  33. use AsyncAws\RdsDataService\RdsDataServiceClient;
  34. use AsyncAws\Rekognition\RekognitionClient;
  35. use AsyncAws\Route53\Route53Client;
  36. use AsyncAws\S3\S3Client;
  37. use AsyncAws\Scheduler\SchedulerClient;
  38. use AsyncAws\SecretsManager\SecretsManagerClient;
  39. use AsyncAws\Ses\SesClient;
  40. use AsyncAws\Sns\SnsClient;
  41. use AsyncAws\Sqs\SqsClient;
  42. use AsyncAws\Ssm\SsmClient;
  43. use AsyncAws\StepFunctions\StepFunctionsClient;
  44. use AsyncAws\TimestreamQuery\TimestreamQueryClient;
  45. use AsyncAws\TimestreamWrite\TimestreamWriteClient;
  46. use AsyncAws\Translate\TranslateClient;
  47. use AsyncAws\XRay\XRayClient;
  48. use Psr\Log\LoggerInterface;
  49. use Psr\Log\NullLogger;
  50. use Symfony\Component\HttpClient\HttpClient;
  51. use Symfony\Contracts\HttpClient\HttpClientInterface;
  52. /**
  53. * Factory that instantiate API clients.
  54. *
  55. * @author Tobias Nyholm <tobias.nyholm@gmail.com>
  56. */
  57. class AwsClientFactory
  58. {
  59. /**
  60. * @var array
  61. */
  62. private $serviceCache;
  63. /**
  64. * @var HttpClientInterface
  65. */
  66. private $httpClient;
  67. /**
  68. * @var Configuration
  69. */
  70. private $configuration;
  71. /**
  72. * @var CredentialProvider
  73. */
  74. private $credentialProvider;
  75. /**
  76. * @var LoggerInterface|null
  77. */
  78. private $logger;
  79. /**
  80. * @param Configuration|array $configuration
  81. */
  82. public function __construct($configuration = [], ?CredentialProvider $credentialProvider = null, ?HttpClientInterface $httpClient = null, ?LoggerInterface $logger = null)
  83. {
  84. if (\is_array($configuration)) {
  85. $configuration = Configuration::create($configuration);
  86. } elseif (!$configuration instanceof Configuration) {
  87. throw new InvalidArgument(sprintf('Second argument to "%s::__construct()" must be an array or an instance of "%s"', __CLASS__, Configuration::class));
  88. }
  89. $this->httpClient = $httpClient ?? HttpClient::create();
  90. $this->logger = $logger ?? new NullLogger();
  91. $this->configuration = $configuration;
  92. $this->credentialProvider = $credentialProvider ?? new CacheProvider(ChainProvider::createDefaultChain($this->httpClient, $this->logger));
  93. }
  94. public function appSync(): AppSyncClient
  95. {
  96. if (!class_exists(AppSyncClient::class)) {
  97. throw MissingDependency::create('async-aws/app-sync', 'AppSync');
  98. }
  99. if (!isset($this->serviceCache[__METHOD__])) {
  100. $this->serviceCache[__METHOD__] = new AppSyncClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  101. }
  102. return $this->serviceCache[__METHOD__];
  103. }
  104. public function cloudFormation(): CloudFormationClient
  105. {
  106. if (!class_exists(CloudFormationClient::class)) {
  107. throw MissingDependency::create('async-aws/cloud-formation', 'CloudFormation');
  108. }
  109. if (!isset($this->serviceCache[__METHOD__])) {
  110. $this->serviceCache[__METHOD__] = new CloudFormationClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  111. }
  112. return $this->serviceCache[__METHOD__];
  113. }
  114. public function cloudFront(): CloudFrontClient
  115. {
  116. if (!class_exists(CloudFrontClient::class)) {
  117. throw MissingDependency::create('async-aws/cloud-front', 'CloudFront');
  118. }
  119. if (!isset($this->serviceCache[__METHOD__])) {
  120. $this->serviceCache[__METHOD__] = new CloudFrontClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  121. }
  122. return $this->serviceCache[__METHOD__];
  123. }
  124. public function cloudWatch(): CloudWatchClient
  125. {
  126. if (!class_exists(CloudWatchClient::class)) {
  127. throw MissingDependency::create('async-aws/cloud-watch', 'CloudWatch');
  128. }
  129. if (!isset($this->serviceCache[__METHOD__])) {
  130. $this->serviceCache[__METHOD__] = new CloudWatchClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  131. }
  132. return $this->serviceCache[__METHOD__];
  133. }
  134. public function cloudWatchLogs(): CloudWatchLogsClient
  135. {
  136. if (!class_exists(CloudWatchLogsClient::class)) {
  137. throw MissingDependency::create('async-aws/cloud-watch-logs', 'CloudWatchLogs');
  138. }
  139. if (!isset($this->serviceCache[__METHOD__])) {
  140. $this->serviceCache[__METHOD__] = new CloudWatchLogsClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  141. }
  142. return $this->serviceCache[__METHOD__];
  143. }
  144. public function codeBuild(): CodeBuildClient
  145. {
  146. if (!class_exists(CodeBuildClient::class)) {
  147. throw MissingDependency::create('async-aws/code-build', 'CodeBuild');
  148. }
  149. if (!isset($this->serviceCache[__METHOD__])) {
  150. $this->serviceCache[__METHOD__] = new CodeBuildClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  151. }
  152. return $this->serviceCache[__METHOD__];
  153. }
  154. public function codeCommit(): CodeCommitClient
  155. {
  156. if (!class_exists(CodeCommitClient::class)) {
  157. throw MissingDependency::create('async-aws/code-commit', 'CodeCommit');
  158. }
  159. if (!isset($this->serviceCache[__METHOD__])) {
  160. $this->serviceCache[__METHOD__] = new CodeCommitClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  161. }
  162. return $this->serviceCache[__METHOD__];
  163. }
  164. public function codeDeploy(): CodeDeployClient
  165. {
  166. if (!class_exists(CodeDeployClient::class)) {
  167. throw MissingDependency::create('async-aws/code-deploy', 'CodeDeploy');
  168. }
  169. if (!isset($this->serviceCache[__METHOD__])) {
  170. $this->serviceCache[__METHOD__] = new CodeDeployClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  171. }
  172. return $this->serviceCache[__METHOD__];
  173. }
  174. public function comprehend(): ComprehendClient
  175. {
  176. if (!class_exists(ComprehendClient::class)) {
  177. throw MissingDependency::create('async-aws/comprehend', 'ComprehendClient');
  178. }
  179. if (!isset($this->serviceCache[__METHOD__])) {
  180. $this->serviceCache[__METHOD__] = new ComprehendClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  181. }
  182. return $this->serviceCache[__METHOD__];
  183. }
  184. public function dynamoDb(): DynamoDbClient
  185. {
  186. if (!class_exists(DynamoDbClient::class)) {
  187. throw MissingDependency::create('async-aws/dynamo-db', 'DynamoDb');
  188. }
  189. if (!isset($this->serviceCache[__METHOD__])) {
  190. $this->serviceCache[__METHOD__] = new DynamoDbClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  191. }
  192. return $this->serviceCache[__METHOD__];
  193. }
  194. public function ecr(): EcrClient
  195. {
  196. if (!class_exists(EcrClient::class)) {
  197. throw MissingDependency::create('async-aws/ecr', 'ECR');
  198. }
  199. if (!isset($this->serviceCache[__METHOD__])) {
  200. $this->serviceCache[__METHOD__] = new EcrClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  201. }
  202. return $this->serviceCache[__METHOD__];
  203. }
  204. public function elastiCache(): ElastiCacheClient
  205. {
  206. if (!class_exists(ElastiCacheClient::class)) {
  207. throw MissingDependency::create('async-aws/elasti-cache', 'ElastiCache');
  208. }
  209. if (!isset($this->serviceCache[__METHOD__])) {
  210. $this->serviceCache[__METHOD__] = new ElastiCacheClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  211. }
  212. return $this->serviceCache[__METHOD__];
  213. }
  214. public function eventBridge(): EventBridgeClient
  215. {
  216. if (!class_exists(EventBridgeClient::class)) {
  217. throw MissingDependency::create('async-aws/event-bridge', 'EventBridge');
  218. }
  219. if (!isset($this->serviceCache[__METHOD__])) {
  220. $this->serviceCache[__METHOD__] = new EventBridgeClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  221. }
  222. return $this->serviceCache[__METHOD__];
  223. }
  224. public function firehose(): FirehoseClient
  225. {
  226. if (!class_exists(FirehoseClient::class)) {
  227. throw MissingDependency::create('async-aws/firehose', 'Firehose');
  228. }
  229. if (!isset($this->serviceCache[__METHOD__])) {
  230. $this->serviceCache[__METHOD__] = new FirehoseClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  231. }
  232. return $this->serviceCache[__METHOD__];
  233. }
  234. public function iam(): IamClient
  235. {
  236. if (!class_exists(IamClient::class)) {
  237. throw MissingDependency::create('async-aws/iam', 'IAM');
  238. }
  239. if (!isset($this->serviceCache[__METHOD__])) {
  240. $this->serviceCache[__METHOD__] = new IamClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  241. }
  242. return $this->serviceCache[__METHOD__];
  243. }
  244. public function iot(): IotClient
  245. {
  246. if (!class_exists(IotClient::class)) {
  247. throw MissingDependency::create('async-aws/iot', 'Iot');
  248. }
  249. if (!isset($this->serviceCache[__METHOD__])) {
  250. $this->serviceCache[__METHOD__] = new IotClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  251. }
  252. return $this->serviceCache[__METHOD__];
  253. }
  254. public function iotData(): IotDataClient
  255. {
  256. if (!class_exists(IotDataClient::class)) {
  257. throw MissingDependency::create('async-aws/iot-data', 'IotData');
  258. }
  259. if (!isset($this->serviceCache[__METHOD__])) {
  260. $this->serviceCache[__METHOD__] = new IotDataClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  261. }
  262. return $this->serviceCache[__METHOD__];
  263. }
  264. public function kinesis(): KinesisClient
  265. {
  266. if (!class_exists(KinesisClient::class)) {
  267. throw MissingDependency::create('aws/kinesis', 'Kinesis');
  268. }
  269. if (!isset($this->serviceCache[__METHOD__])) {
  270. $this->serviceCache[__METHOD__] = new KinesisClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  271. }
  272. return $this->serviceCache[__METHOD__];
  273. }
  274. public function kms(): KmsClient
  275. {
  276. if (!class_exists(KmsClient::class)) {
  277. throw MissingDependency::create('aws/kms', 'Kms');
  278. }
  279. if (!isset($this->serviceCache[__METHOD__])) {
  280. $this->serviceCache[__METHOD__] = new KmsClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  281. }
  282. return $this->serviceCache[__METHOD__];
  283. }
  284. public function lambda(): LambdaClient
  285. {
  286. if (!class_exists(LambdaClient::class)) {
  287. throw MissingDependency::create('async-aws/lambda', 'Lambda');
  288. }
  289. if (!isset($this->serviceCache[__METHOD__])) {
  290. $this->serviceCache[__METHOD__] = new LambdaClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  291. }
  292. return $this->serviceCache[__METHOD__];
  293. }
  294. public function mediaConvert(): MediaConvertClient
  295. {
  296. if (!class_exists(MediaConvertClient::class)) {
  297. throw MissingDependency::create('async-aws/media-convert', 'MediaConvert');
  298. }
  299. if (!isset($this->serviceCache[__METHOD__])) {
  300. $this->serviceCache[__METHOD__] = new MediaConvertClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  301. }
  302. return $this->serviceCache[__METHOD__];
  303. }
  304. public function rdsDataService(): RdsDataServiceClient
  305. {
  306. if (!class_exists(RdsDataServiceClient::class)) {
  307. throw MissingDependency::create('async-aws/rds-data-service', 'RdsDataService');
  308. }
  309. if (!isset($this->serviceCache[__METHOD__])) {
  310. $this->serviceCache[__METHOD__] = new RdsDataServiceClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  311. }
  312. return $this->serviceCache[__METHOD__];
  313. }
  314. public function rekognition(): RekognitionClient
  315. {
  316. if (!class_exists(RekognitionClient::class)) {
  317. throw MissingDependency::create('aws/rekognition', 'Rekognition');
  318. }
  319. if (!isset($this->serviceCache[__METHOD__])) {
  320. $this->serviceCache[__METHOD__] = new RekognitionClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  321. }
  322. return $this->serviceCache[__METHOD__];
  323. }
  324. public function route53(): Route53Client
  325. {
  326. if (!class_exists(Route53Client::class)) {
  327. throw MissingDependency::create('aws/route53', 'Route53');
  328. }
  329. if (!isset($this->serviceCache[__METHOD__])) {
  330. $this->serviceCache[__METHOD__] = new Route53Client($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  331. }
  332. return $this->serviceCache[__METHOD__];
  333. }
  334. public function s3(): S3Client
  335. {
  336. if (!class_exists(S3Client::class)) {
  337. throw MissingDependency::create('async-aws/s3', 'S3');
  338. }
  339. if (!isset($this->serviceCache[__METHOD__])) {
  340. $this->serviceCache[__METHOD__] = new S3Client($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  341. }
  342. return $this->serviceCache[__METHOD__];
  343. }
  344. public function scheduler(): SchedulerClient
  345. {
  346. if (!class_exists(SchedulerClient::class)) {
  347. throw MissingDependency::create('async-aws/scheduler', 'Scheduler');
  348. }
  349. if (!isset($this->serviceCache[__METHOD__])) {
  350. $this->serviceCache[__METHOD__] = new SchedulerClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  351. }
  352. return $this->serviceCache[__METHOD__];
  353. }
  354. public function secretsManager(): SecretsManagerClient
  355. {
  356. if (!class_exists(SecretsManagerClient::class)) {
  357. throw MissingDependency::create('async-aws/secret-manager', 'SecretsManager');
  358. }
  359. if (!isset($this->serviceCache[__METHOD__])) {
  360. $this->serviceCache[__METHOD__] = new SecretsManagerClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  361. }
  362. return $this->serviceCache[__METHOD__];
  363. }
  364. public function ses(): SesClient
  365. {
  366. if (!class_exists(SesClient::class)) {
  367. throw MissingDependency::create('async-aws/ses', 'SES');
  368. }
  369. if (!isset($this->serviceCache[__METHOD__])) {
  370. $this->serviceCache[__METHOD__] = new SesClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  371. }
  372. return $this->serviceCache[__METHOD__];
  373. }
  374. public function sns(): SnsClient
  375. {
  376. if (!class_exists(SnsClient::class)) {
  377. throw MissingDependency::create('async-aws/sns', 'SNS');
  378. }
  379. if (!isset($this->serviceCache[__METHOD__])) {
  380. $this->serviceCache[__METHOD__] = new SnsClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  381. }
  382. return $this->serviceCache[__METHOD__];
  383. }
  384. public function sqs(): SqsClient
  385. {
  386. if (!class_exists(SqsClient::class)) {
  387. throw MissingDependency::create('async-aws/sqs', 'SQS');
  388. }
  389. if (!isset($this->serviceCache[__METHOD__])) {
  390. $this->serviceCache[__METHOD__] = new SqsClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  391. }
  392. return $this->serviceCache[__METHOD__];
  393. }
  394. public function ssm(): SsmClient
  395. {
  396. if (!class_exists(SsmClient::class)) {
  397. throw MissingDependency::create('async-aws/ssm', 'SSM');
  398. }
  399. if (!isset($this->serviceCache[__METHOD__])) {
  400. $this->serviceCache[__METHOD__] = new SsmClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  401. }
  402. return $this->serviceCache[__METHOD__];
  403. }
  404. public function sts(): StsClient
  405. {
  406. if (!isset($this->serviceCache[__METHOD__])) {
  407. $this->serviceCache[__METHOD__] = new StsClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  408. }
  409. return $this->serviceCache[__METHOD__];
  410. }
  411. public function stepFunctions(): StepFunctionsClient
  412. {
  413. if (!class_exists(StepFunctionsClient::class)) {
  414. throw MissingDependency::create('async-aws/step-functions', 'StepFunctions');
  415. }
  416. if (!isset($this->serviceCache[__METHOD__])) {
  417. $this->serviceCache[__METHOD__] = new StepFunctionsClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  418. }
  419. return $this->serviceCache[__METHOD__];
  420. }
  421. public function timestreamQuery(): TimestreamQueryClient
  422. {
  423. if (!class_exists(TimestreamQueryClient::class)) {
  424. throw MissingDependency::create('async-aws/timestream-query', 'TimestreamQuery');
  425. }
  426. if (!isset($this->serviceCache[__METHOD__])) {
  427. $this->serviceCache[__METHOD__] = new TimestreamQueryClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  428. }
  429. return $this->serviceCache[__METHOD__];
  430. }
  431. public function timestreamWrite(): TimestreamWriteClient
  432. {
  433. if (!class_exists(TimestreamWriteClient::class)) {
  434. throw MissingDependency::create('async-aws/timestream-write', 'TimestreamWrite');
  435. }
  436. if (!isset($this->serviceCache[__METHOD__])) {
  437. $this->serviceCache[__METHOD__] = new TimestreamWriteClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  438. }
  439. return $this->serviceCache[__METHOD__];
  440. }
  441. public function translate(): TranslateClient
  442. {
  443. if (!class_exists(TranslateClient::class)) {
  444. throw MissingDependency::create('async-aws/translate', 'Translate');
  445. }
  446. if (!isset($this->serviceCache[__METHOD__])) {
  447. $this->serviceCache[__METHOD__] = new TranslateClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  448. }
  449. return $this->serviceCache[__METHOD__];
  450. }
  451. public function xRay(): XRayClient
  452. {
  453. if (!class_exists(XRayClient::class)) {
  454. throw MissingDependency::create('async-aws/x-ray', 'XRay');
  455. }
  456. if (!isset($this->serviceCache[__METHOD__])) {
  457. $this->serviceCache[__METHOD__] = new XRayClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  458. }
  459. return $this->serviceCache[__METHOD__];
  460. }
  461. public function cognitoIdentityProvider(): CognitoIdentityProviderClient
  462. {
  463. if (!class_exists(CognitoIdentityProviderClient::class)) {
  464. throw MissingDependency::create('aws/cognito-identity-provider', 'CognitoIdentityProvider');
  465. }
  466. if (!isset($this->serviceCache[__METHOD__])) {
  467. $this->serviceCache[__METHOD__] = new CognitoIdentityProviderClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  468. }
  469. return $this->serviceCache[__METHOD__];
  470. }
  471. public function athena(): AthenaClient
  472. {
  473. if (!class_exists(AthenaClient::class)) {
  474. throw MissingDependency::create('async-aws/athena', 'Athena');
  475. }
  476. if (!isset($this->serviceCache[__METHOD__])) {
  477. $this->serviceCache[__METHOD__] = new AthenaClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger);
  478. }
  479. return $this->serviceCache[__METHOD__];
  480. }
  481. }