From 1594762f39a8df4cb97cc56d96c23d85bcea4403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Barray?= Date: Mon, 1 Aug 2022 15:30:40 +0200 Subject: [PATCH] Create new IotData client (#1278) * Create new IotData client * fix ci --- CHANGELOG.md | 6 ++++++ src/AwsClientFactory.php | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d2e976..37ec97a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ ### Added +- Added support for Iot Data + +## 1.16.0 + +### Added + - Added support for endpoint discovery - Added support for Iot Core diff --git a/src/AwsClientFactory.php b/src/AwsClientFactory.php index 9eb01d3..c7dfabb 100644 --- a/src/AwsClientFactory.php +++ b/src/AwsClientFactory.php @@ -27,6 +27,7 @@ use AsyncAws\Firehose\FirehoseClient; use AsyncAws\Iam\IamClient; use AsyncAws\Iot\IotClient; +use AsyncAws\IotData\IotDataClient; use AsyncAws\Kinesis\KinesisClient; use AsyncAws\Kms\KmsClient; use AsyncAws\Lambda\LambdaClient; @@ -306,6 +307,19 @@ public function iot(): IotClient return $this->serviceCache[__METHOD__]; } + public function iotData(): IotDataClient + { + if (!class_exists(IotDataClient::class)) { + throw MissingDependency::create('async-aws/iot-data', 'IotData'); + } + + if (!isset($this->serviceCache[__METHOD__])) { + $this->serviceCache[__METHOD__] = new IotDataClient($this->configuration, $this->credentialProvider, $this->httpClient, $this->logger); + } + + return $this->serviceCache[__METHOD__]; + } + public function kinesis(): KinesisClient { if (!class_exists(KinesisClient::class)) {