Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"variables": {
"${LATEST}": "3.342.36"
"${LATEST}": "3.343.0"
},
"endpoints": "https://raw.githubusercontent.com/aws/aws-sdk-php/${LATEST}/src/data/endpoints.json",
"services": {
Expand Down
1 change: 1 addition & 0 deletions src/Service/Kinesis/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Added

- AWS api-change: added `eu-isoe-west-1` region
- AWS api-change: Amazon KDS now supports tagging and attribute-based access control (ABAC) for enhanced fan-out consumers.

### Changed

Expand Down
12 changes: 12 additions & 0 deletions src/Service/Kinesis/src/Exception/InternalFailureException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

namespace AsyncAws\Kinesis\Exception;

use AsyncAws\Core\Exception\Http\ClientException;

/**
* The processing of the request failed because of an unknown error, exception, or failure.
*/
final class InternalFailureException extends ClientException
{
}
3 changes: 2 additions & 1 deletion src/Service/Kinesis/src/Input/AddTagsToStreamInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ final class AddTagsToStreamInput extends Input
private $streamName;

/**
* A set of up to 10 key-value pairs to use to create the tags.
* A set of up to 50 key-value pairs to use to create the tags. A tag consists of a required key and an optional value.
* You can add up to 50 tags per resource.
*
* @required
*
Expand Down
2 changes: 1 addition & 1 deletion src/Service/Kinesis/src/Input/CreateStreamInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ final class CreateStreamInput extends Input
private $streamModeDetails;

/**
* A set of up to 10 key-value pairs to use to create the tags.
* A set of up to 50 key-value pairs to use to create the tags. A tag consists of a required key and an optional value.
*
* @var array<string, string>|null
*/
Expand Down
38 changes: 38 additions & 0 deletions src/Service/Kinesis/src/Input/RegisterStreamConsumerInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,34 @@ final class RegisterStreamConsumerInput extends Input
*/
private $consumerName;

/**
* A set of up to 50 key-value pairs. A tag consists of a required key and an optional value.
*
* @var array<string, string>|null
*/
private $tags;

/**
* @param array{
* StreamARN?: string,
* ConsumerName?: string,
* Tags?: null|array<string, string>,
* '@region'?: string|null,
* } $input
*/
public function __construct(array $input = [])
{
$this->streamArn = $input['StreamARN'] ?? null;
$this->consumerName = $input['ConsumerName'] ?? null;
$this->tags = $input['Tags'] ?? null;
parent::__construct($input);
}

/**
* @param array{
* StreamARN?: string,
* ConsumerName?: string,
* Tags?: null|array<string, string>,
* '@region'?: string|null,
* }|RegisterStreamConsumerInput $input
*/
Expand All @@ -67,6 +77,14 @@ public function getStreamArn(): ?string
return $this->streamArn;
}

/**
* @return array<string, string>
*/
public function getTags(): array
{
return $this->tags ?? [];
}

/**
* @internal
*/
Expand Down Expand Up @@ -107,6 +125,16 @@ public function setStreamArn(?string $value): self
return $this;
}

/**
* @param array<string, string> $value
*/
public function setTags(array $value): self
{
$this->tags = $value;

return $this;
}

private function requestBody(): array
{
$payload = [];
Expand All @@ -118,6 +146,16 @@ private function requestBody(): array
throw new InvalidArgument(\sprintf('Missing parameter "ConsumerName" for "%s". The value cannot be null.', __CLASS__));
}
$payload['ConsumerName'] = $v;
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;
}
Expand Down
24 changes: 20 additions & 4 deletions src/Service/Kinesis/src/KinesisClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use AsyncAws\Kinesis\Exception\AccessDeniedException;
use AsyncAws\Kinesis\Exception\ExpiredIteratorException;
use AsyncAws\Kinesis\Exception\ExpiredNextTokenException;
use AsyncAws\Kinesis\Exception\InternalFailureException;
use AsyncAws\Kinesis\Exception\InvalidArgumentException;
use AsyncAws\Kinesis\Exception\KMSAccessDeniedException;
use AsyncAws\Kinesis\Exception\KMSDisabledException;
Expand Down Expand Up @@ -151,10 +152,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.
* You can add tags to the stream when making a `CreateStream` request by setting the `Tags` parameter. If you pass the
* `Tags` parameter, in addition to having the `kinesis:CreateStream` permission, you must also have the
* `kinesis:AddTagsToStream` permission for the stream that will be created. The `kinesis:TagResource` permission
* won’t work to tag streams on creation. Tags will take effect from the `CREATING` status of the stream, but you
* can't make any updates to the tags until the stream is in `ACTIVE` state.
*
* [^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
Expand Down Expand Up @@ -603,6 +605,7 @@ public function enableEnhancedMonitoring($input): EnhancedMonitoringOutput
*
* @throws AccessDeniedException
* @throws ExpiredIteratorException
* @throws InternalFailureException
* @throws InvalidArgumentException
* @throws KMSAccessDeniedException
* @throws KMSDisabledException
Expand All @@ -619,6 +622,7 @@ public function getRecords($input): GetRecordsOutput
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'GetRecords', 'region' => $input->getRegion(), 'exceptionMapping' => [
'AccessDeniedException' => AccessDeniedException::class,
'ExpiredIteratorException' => ExpiredIteratorException::class,
'InternalFailureException' => InternalFailureException::class,
'InvalidArgumentException' => InvalidArgumentException::class,
'KMSAccessDeniedException' => KMSAccessDeniedException::class,
'KMSDisabledException' => KMSDisabledException::class,
Expand Down Expand Up @@ -683,6 +687,7 @@ public function getRecords($input): GetRecordsOutput
* }|GetShardIteratorInput $input
*
* @throws AccessDeniedException
* @throws InternalFailureException
* @throws InvalidArgumentException
* @throws ProvisionedThroughputExceededException
* @throws ResourceNotFoundException
Expand All @@ -692,6 +697,7 @@ public function getShardIterator($input): GetShardIteratorOutput
$input = GetShardIteratorInput::create($input);
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'GetShardIterator', 'region' => $input->getRegion(), 'exceptionMapping' => [
'AccessDeniedException' => AccessDeniedException::class,
'InternalFailureException' => InternalFailureException::class,
'InvalidArgumentException' => InvalidArgumentException::class,
'ProvisionedThroughputExceededException' => ProvisionedThroughputExceededException::class,
'ResourceNotFoundException' => ResourceNotFoundException::class,
Expand Down Expand Up @@ -1037,6 +1043,7 @@ public function mergeShards($input): Result
* }|PutRecordInput $input
*
* @throws AccessDeniedException
* @throws InternalFailureException
* @throws InvalidArgumentException
* @throws KMSAccessDeniedException
* @throws KMSDisabledException
Expand All @@ -1052,6 +1059,7 @@ public function putRecord($input): PutRecordOutput
$input = PutRecordInput::create($input);
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'PutRecord', 'region' => $input->getRegion(), 'exceptionMapping' => [
'AccessDeniedException' => AccessDeniedException::class,
'InternalFailureException' => InternalFailureException::class,
'InvalidArgumentException' => InvalidArgumentException::class,
'KMSAccessDeniedException' => KMSAccessDeniedException::class,
'KMSDisabledException' => KMSDisabledException::class,
Expand Down Expand Up @@ -1135,6 +1143,7 @@ public function putRecord($input): PutRecordOutput
* }|PutRecordsInput $input
*
* @throws AccessDeniedException
* @throws InternalFailureException
* @throws InvalidArgumentException
* @throws KMSAccessDeniedException
* @throws KMSDisabledException
Expand All @@ -1150,6 +1159,7 @@ public function putRecords($input): PutRecordsOutput
$input = PutRecordsInput::create($input);
$response = $this->getResponse($input->request(), new RequestContext(['operation' => 'PutRecords', 'region' => $input->getRegion(), 'exceptionMapping' => [
'AccessDeniedException' => AccessDeniedException::class,
'InternalFailureException' => InternalFailureException::class,
'InvalidArgumentException' => InvalidArgumentException::class,
'KMSAccessDeniedException' => KMSAccessDeniedException::class,
'KMSDisabledException' => KMSDisabledException::class,
Expand All @@ -1170,6 +1180,11 @@ public function putRecords($input): PutRecordsOutput
* every shard you subscribe to. This rate is unaffected by the total number of consumers that read from the same
* stream.
*
* You can add tags to the registered consumer when making a `RegisterStreamConsumer` request by setting the `Tags`
* parameter. If you pass the `Tags` parameter, in addition to having the `kinesis:RegisterStreamConsumer` permission,
* you must also have the `kinesis:TagResource` permission for the consumer that will be registered. Tags will take
* effect from the `CREATING` status of the consumer.
*
* 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 operation, see Enhanced Fan-Out Using the Kinesis Data Streams API [^1].
Expand All @@ -1186,6 +1201,7 @@ public function putRecords($input): PutRecordsOutput
* @param array{
* StreamARN: string,
* ConsumerName: string,
* Tags?: null|array<string, string>,
* '@region'?: string|null,
* }|RegisterStreamConsumerInput $input
*
Expand Down
2 changes: 1 addition & 1 deletion src/Service/Kinesis/src/ValueObject/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use AsyncAws\Core\Exception\InvalidArgument;

/**
* Metadata assigned to the stream, consisting of a key-value pair.
* Metadata assigned to the stream or consumer, consisting of a key-value pair.
*/
final class Tag
{
Expand Down