Skip to content

Commit 40a1854

Browse files
Update generated code (#1769)
update generated code
1 parent fe3cfff commit 40a1854

File tree

4 files changed

+51
-3
lines changed

4 files changed

+51
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## NOT RELEASED
44

5+
### Added
6+
7+
- AWS api-change: This release includes support to add tags when creating a stream
8+
59
### Changed
610

711
- Enable compiler optimization for the `sprintf` function.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"extra": {
3030
"branch-alias": {
31-
"dev-master": "3.0-dev"
31+
"dev-master": "3.1-dev"
3232
}
3333
}
3434
}

src/Input/CreateStreamInput.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,19 @@ final class CreateStreamInput extends Input
4141
*/
4242
private $streamModeDetails;
4343

44+
/**
45+
* A set of up to 10 key-value pairs to use to create the tags.
46+
*
47+
* @var array<string, string>|null
48+
*/
49+
private $tags;
50+
4451
/**
4552
* @param array{
4653
* StreamName?: string,
4754
* ShardCount?: null|int,
4855
* StreamModeDetails?: null|StreamModeDetails|array,
56+
* Tags?: null|array<string, string>,
4957
* '@region'?: string|null,
5058
* } $input
5159
*/
@@ -54,6 +62,7 @@ public function __construct(array $input = [])
5462
$this->streamName = $input['StreamName'] ?? null;
5563
$this->shardCount = $input['ShardCount'] ?? null;
5664
$this->streamModeDetails = isset($input['StreamModeDetails']) ? StreamModeDetails::create($input['StreamModeDetails']) : null;
65+
$this->tags = $input['Tags'] ?? null;
5766
parent::__construct($input);
5867
}
5968

@@ -62,6 +71,7 @@ public function __construct(array $input = [])
6271
* StreamName?: string,
6372
* ShardCount?: null|int,
6473
* StreamModeDetails?: null|StreamModeDetails|array,
74+
* Tags?: null|array<string, string>,
6575
* '@region'?: string|null,
6676
* }|CreateStreamInput $input
6777
*/
@@ -85,6 +95,14 @@ public function getStreamName(): ?string
8595
return $this->streamName;
8696
}
8797

98+
/**
99+
* @return array<string, string>
100+
*/
101+
public function getTags(): array
102+
{
103+
return $this->tags ?? [];
104+
}
105+
88106
/**
89107
* @internal
90108
*/
@@ -132,6 +150,16 @@ public function setStreamName(?string $value): self
132150
return $this;
133151
}
134152

153+
/**
154+
* @param array<string, string> $value
155+
*/
156+
public function setTags(array $value): self
157+
{
158+
$this->tags = $value;
159+
160+
return $this;
161+
}
162+
135163
private function requestBody(): array
136164
{
137165
$payload = [];
@@ -145,6 +173,16 @@ private function requestBody(): array
145173
if (null !== $v = $this->streamModeDetails) {
146174
$payload['StreamModeDetails'] = $v->requestBody();
147175
}
176+
if (null !== $v = $this->tags) {
177+
if (empty($v)) {
178+
$payload['Tags'] = new \stdClass();
179+
} else {
180+
$payload['Tags'] = [];
181+
foreach ($v as $name => $mv) {
182+
$payload['Tags'][$name] = $mv;
183+
}
184+
}
185+
}
148186

149187
return $payload;
150188
}

src/KinesisClient.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ public function addTagsToStream($input): Result
151151
*
152152
* CreateStream has a limit of five transactions per second per account.
153153
*
154+
* You can add tags to the stream when making a `CreateStream` request by setting the `Tags` parameter. If you pass
155+
* `Tags` parameter, in addition to having `kinesis:createStream` permission, you must also have
156+
* `kinesis:addTagsToStream` permission for the stream that will be created. Tags will take effect from the `CREATING`
157+
* status of the stream.
158+
*
154159
* [^1]: https://docs.aws.amazon.com/kinesis/latest/dev/service-sizes-and-limits.html
155160
* [^2]: https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html
156161
*
@@ -161,6 +166,7 @@ public function addTagsToStream($input): Result
161166
* StreamName: string,
162167
* ShardCount?: null|int,
163168
* StreamModeDetails?: null|StreamModeDetails|array,
169+
* Tags?: null|array<string, string>,
164170
* '@region'?: string|null,
165171
* }|CreateStreamInput $input
166172
*
@@ -1166,13 +1172,13 @@ public function putRecords($input): PutRecordsOutput
11661172
*
11671173
* You can register up to 20 consumers per stream. A given consumer can only be registered with one stream at a time.
11681174
*
1169-
* For an example of how to use this operations, see Enhanced Fan-Out Using the Kinesis Data Streams API [^1].
1175+
* For an example of how to use this operation, see Enhanced Fan-Out Using the Kinesis Data Streams API [^1].
11701176
*
11711177
* The use of this operation has a limit of five transactions per second per account. Also, only 5 consumers can be
11721178
* created simultaneously. In other words, you cannot have more than 5 consumers in a `CREATING` status at the same
11731179
* time. Registering a 6th consumer while there are 5 in a `CREATING` status results in a `LimitExceededException`.
11741180
*
1175-
* [^1]: /streams/latest/dev/building-enhanced-consumers-api.html
1181+
* [^1]: https://docs.aws.amazon.com/streams/latest/dev/building-enhanced-consumers-api.html
11761182
*
11771183
* @see https://docs.aws.amazon.com/kinesis/latest/APIReference/API_RegisterStreamConsumer.html
11781184
* @see https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-kinesis-2013-12-02.html#registerstreamconsumer

0 commit comments

Comments
 (0)