diff --git a/manifest.json b/manifest.json index 39b12e945..4bdf436de 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "variables": { - "${LATEST}": "3.322.3" + "${LATEST}": "3.322.4" }, "endpoints": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/endpoints.json", "services": { diff --git a/src/Service/Kinesis/CHANGELOG.md b/src/Service/Kinesis/CHANGELOG.md index 74607484a..aec396024 100644 --- a/src/Service/Kinesis/CHANGELOG.md +++ b/src/Service/Kinesis/CHANGELOG.md @@ -2,6 +2,10 @@ ## NOT RELEASED +### Added + +- AWS api-change: This release includes support to add tags when creating a stream + ### Changed - Enable compiler optimization for the `sprintf` function. diff --git a/src/Service/Kinesis/composer.json b/src/Service/Kinesis/composer.json index 5da7f1953..bfa235217 100644 --- a/src/Service/Kinesis/composer.json +++ b/src/Service/Kinesis/composer.json @@ -28,7 +28,7 @@ }, "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.1-dev" } } } diff --git a/src/Service/Kinesis/src/Input/CreateStreamInput.php b/src/Service/Kinesis/src/Input/CreateStreamInput.php index 9c40668d0..b6242ad8f 100644 --- a/src/Service/Kinesis/src/Input/CreateStreamInput.php +++ b/src/Service/Kinesis/src/Input/CreateStreamInput.php @@ -41,11 +41,19 @@ final class CreateStreamInput extends Input */ private $streamModeDetails; + /** + * A set of up to 10 key-value pairs to use to create the tags. + * + * @var array|null + */ + private $tags; + /** * @param array{ * StreamName?: string, * ShardCount?: null|int, * StreamModeDetails?: null|StreamModeDetails|array, + * Tags?: null|array, * '@region'?: string|null, * } $input */ @@ -54,6 +62,7 @@ public function __construct(array $input = []) $this->streamName = $input['StreamName'] ?? null; $this->shardCount = $input['ShardCount'] ?? null; $this->streamModeDetails = isset($input['StreamModeDetails']) ? StreamModeDetails::create($input['StreamModeDetails']) : null; + $this->tags = $input['Tags'] ?? null; parent::__construct($input); } @@ -62,6 +71,7 @@ public function __construct(array $input = []) * StreamName?: string, * ShardCount?: null|int, * StreamModeDetails?: null|StreamModeDetails|array, + * Tags?: null|array, * '@region'?: string|null, * }|CreateStreamInput $input */ @@ -85,6 +95,14 @@ public function getStreamName(): ?string return $this->streamName; } + /** + * @return array + */ + public function getTags(): array + { + return $this->tags ?? []; + } + /** * @internal */ @@ -132,6 +150,16 @@ public function setStreamName(?string $value): self return $this; } + /** + * @param array $value + */ + public function setTags(array $value): self + { + $this->tags = $value; + + return $this; + } + private function requestBody(): array { $payload = []; @@ -145,6 +173,16 @@ private function requestBody(): array if (null !== $v = $this->streamModeDetails) { $payload['StreamModeDetails'] = $v->requestBody(); } + if (null !== $v = $this->tags) { + if (empty($v)) { + $payload['Tags'] = new \stdClass(); + } else { + $payload['Tags'] = []; + foreach ($v as $name => $mv) { + $payload['Tags'][$name] = $mv; + } + } + } return $payload; } diff --git a/src/Service/Kinesis/src/KinesisClient.php b/src/Service/Kinesis/src/KinesisClient.php index f24a86479..e3f467466 100644 --- a/src/Service/Kinesis/src/KinesisClient.php +++ b/src/Service/Kinesis/src/KinesisClient.php @@ -151,6 +151,11 @@ public function addTagsToStream($input): Result * * CreateStream has a limit of five transactions per second per account. * + * You can add tags to the stream when making a `CreateStream` request by setting the `Tags` parameter. If you pass + * `Tags` parameter, in addition to having `kinesis:createStream` permission, you must also have + * `kinesis:addTagsToStream` permission for the stream that will be created. Tags will take effect from the `CREATING` + * status of the stream. + * * [^1]: https://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html * [^2]: https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html * @@ -161,6 +166,7 @@ public function addTagsToStream($input): Result * StreamName: string, * ShardCount?: null|int, * StreamModeDetails?: null|StreamModeDetails|array, + * Tags?: null|array, * '@region'?: string|null, * }|CreateStreamInput $input * @@ -1166,13 +1172,13 @@ public function putRecords($input): PutRecordsOutput * * You can register up to 20 consumers per stream. A given consumer can only be registered with one stream at a time. * - * For an example of how to use this operations, see Enhanced Fan-Out Using the Kinesis Data Streams API [^1]. + * For an example of how to use this operation, see Enhanced Fan-Out Using the Kinesis Data Streams API [^1]. * * The use of this operation has a limit of five transactions per second per account. Also, only 5 consumers can be * created simultaneously. In other words, you cannot have more than 5 consumers in a `CREATING` status at the same * time. Registering a 6th consumer while there are 5 in a `CREATING` status results in a `LimitExceededException`. * - * [^1]: /streams/latest/dev/building-enhanced-consumers-api.html + * [^1]: https://docs.aws.amazon.com/streams/latest/dev/building-enhanced-consumers-api.html * * @see https://docs.aws.amazon.com/kinesis/latest/APIReference/API_RegisterStreamConsumer.html * @see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-kinesis-2013-12-02.html#registerstreamconsumer