Skip to content

Commit 50ca1d8

Browse files
Update generated code (#1379)
* update generated code * Fix PSALM * Update src/Service/DynamoDb/CHANGELOG.md --------- Co-authored-by: Jérémy Derussé <[email protected]>
1 parent cc1cd99 commit 50ca1d8

9 files changed

+67
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Added
66

77
- AWS enhancement: Documentation updates.
8+
- AWS api-change: Adds deletion protection support to DynamoDB tables. Tables with deletion protection enabled cannot be deleted. Deletion protection is disabled by default, can be enabled via the CreateTable or UpdateTable APIs, and is visible in TableDescription. This setting is not replicated for Global Tables.
89

910
## 1.3.0
1011

src/DynamoDbClient.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ public function batchWriteItem($input): BatchWriteItemOutput
174174
* SSESpecification?: SSESpecification|array,
175175
* Tags?: Tag[],
176176
* TableClass?: TableClass::*,
177+
* DeletionProtectionEnabled?: bool,
177178
*
178179
* @region?: string,
179180
* }|CreateTableInput $input
@@ -721,6 +722,7 @@ public function updateItem($input): UpdateItemOutput
721722
* SSESpecification?: SSESpecification|array,
722723
* ReplicaUpdates?: ReplicationGroupUpdate[],
723724
* TableClass?: TableClass::*,
725+
* DeletionProtectionEnabled?: bool,
724726
*
725727
* @region?: string,
726728
* }|UpdateTableInput $input

src/Input/CreateTableInput.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,13 @@ final class CreateTableInput extends Input
116116
*/
117117
private $tableClass;
118118

119+
/**
120+
* Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.
121+
*
122+
* @var bool|null
123+
*/
124+
private $deletionProtectionEnabled;
125+
119126
/**
120127
* @param array{
121128
* AttributeDefinitions?: AttributeDefinition[],
@@ -129,6 +136,7 @@ final class CreateTableInput extends Input
129136
* SSESpecification?: SSESpecification|array,
130137
* Tags?: Tag[],
131138
* TableClass?: TableClass::*,
139+
* DeletionProtectionEnabled?: bool,
132140
*
133141
* @region?: string,
134142
* } $input
@@ -146,6 +154,7 @@ public function __construct(array $input = [])
146154
$this->sseSpecification = isset($input['SSESpecification']) ? SSESpecification::create($input['SSESpecification']) : null;
147155
$this->tags = isset($input['Tags']) ? array_map([Tag::class, 'create'], $input['Tags']) : null;
148156
$this->tableClass = $input['TableClass'] ?? null;
157+
$this->deletionProtectionEnabled = $input['DeletionProtectionEnabled'] ?? null;
149158
parent::__construct($input);
150159
}
151160

@@ -170,6 +179,11 @@ public function getBillingMode(): ?string
170179
return $this->billingMode;
171180
}
172181

182+
public function getDeletionProtectionEnabled(): ?bool
183+
{
184+
return $this->deletionProtectionEnabled;
185+
}
186+
173187
/**
174188
* @return GlobalSecondaryIndex[]
175189
*/
@@ -275,6 +289,13 @@ public function setBillingMode(?string $value): self
275289
return $this;
276290
}
277291

292+
public function setDeletionProtectionEnabled(?bool $value): self
293+
{
294+
$this->deletionProtectionEnabled = $value;
295+
296+
return $this;
297+
}
298+
278299
/**
279300
* @param GlobalSecondaryIndex[] $value
280301
*/
@@ -427,6 +448,9 @@ private function requestBody(): array
427448
}
428449
$payload['TableClass'] = $v;
429450
}
451+
if (null !== $v = $this->deletionProtectionEnabled) {
452+
$payload['DeletionProtectionEnabled'] = (bool) $v;
453+
}
430454

431455
return $payload;
432456
}

src/Input/UpdateTableInput.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ final class UpdateTableInput extends Input
9090
*/
9191
private $tableClass;
9292

93+
/**
94+
* Indicates whether deletion protection is to be enabled (true) or disabled (false) on the table.
95+
*
96+
* @var bool|null
97+
*/
98+
private $deletionProtectionEnabled;
99+
93100
/**
94101
* @param array{
95102
* AttributeDefinitions?: AttributeDefinition[],
@@ -101,6 +108,7 @@ final class UpdateTableInput extends Input
101108
* SSESpecification?: SSESpecification|array,
102109
* ReplicaUpdates?: ReplicationGroupUpdate[],
103110
* TableClass?: TableClass::*,
111+
* DeletionProtectionEnabled?: bool,
104112
*
105113
* @region?: string,
106114
* } $input
@@ -116,6 +124,7 @@ public function __construct(array $input = [])
116124
$this->sseSpecification = isset($input['SSESpecification']) ? SSESpecification::create($input['SSESpecification']) : null;
117125
$this->replicaUpdates = isset($input['ReplicaUpdates']) ? array_map([ReplicationGroupUpdate::class, 'create'], $input['ReplicaUpdates']) : null;
118126
$this->tableClass = $input['TableClass'] ?? null;
127+
$this->deletionProtectionEnabled = $input['DeletionProtectionEnabled'] ?? null;
119128
parent::__construct($input);
120129
}
121130

@@ -140,6 +149,11 @@ public function getBillingMode(): ?string
140149
return $this->billingMode;
141150
}
142151

152+
public function getDeletionProtectionEnabled(): ?bool
153+
{
154+
return $this->deletionProtectionEnabled;
155+
}
156+
143157
/**
144158
* @return GlobalSecondaryIndexUpdate[]
145159
*/
@@ -229,6 +243,13 @@ public function setBillingMode(?string $value): self
229243
return $this;
230244
}
231245

246+
public function setDeletionProtectionEnabled(?bool $value): self
247+
{
248+
$this->deletionProtectionEnabled = $value;
249+
250+
return $this;
251+
}
252+
232253
/**
233254
* @param GlobalSecondaryIndexUpdate[] $value
234255
*/
@@ -339,6 +360,9 @@ private function requestBody(): array
339360
}
340361
$payload['TableClass'] = $v;
341362
}
363+
if (null !== $v = $this->deletionProtectionEnabled) {
364+
$payload['DeletionProtectionEnabled'] = (bool) $v;
365+
}
342366

343367
return $payload;
344368
}

src/Result/CreateTableOutput.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ private function populateResultTableDescription(array $json): TableDescription
309309
'SSEDescription' => empty($json['SSEDescription']) ? null : $this->populateResultSSEDescription($json['SSEDescription']),
310310
'ArchivalSummary' => empty($json['ArchivalSummary']) ? null : $this->populateResultArchivalSummary($json['ArchivalSummary']),
311311
'TableClassSummary' => empty($json['TableClassSummary']) ? null : $this->populateResultTableClassSummary($json['TableClassSummary']),
312+
'DeletionProtectionEnabled' => isset($json['DeletionProtectionEnabled']) ? filter_var($json['DeletionProtectionEnabled'], \FILTER_VALIDATE_BOOLEAN) : null,
312313
]);
313314
}
314315
}

src/Result/DeleteTableOutput.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ private function populateResultTableDescription(array $json): TableDescription
309309
'SSEDescription' => empty($json['SSEDescription']) ? null : $this->populateResultSSEDescription($json['SSEDescription']),
310310
'ArchivalSummary' => empty($json['ArchivalSummary']) ? null : $this->populateResultArchivalSummary($json['ArchivalSummary']),
311311
'TableClassSummary' => empty($json['TableClassSummary']) ? null : $this->populateResultTableClassSummary($json['TableClassSummary']),
312+
'DeletionProtectionEnabled' => isset($json['DeletionProtectionEnabled']) ? filter_var($json['DeletionProtectionEnabled'], \FILTER_VALIDATE_BOOLEAN) : null,
312313
]);
313314
}
314315
}

src/Result/DescribeTableOutput.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ private function populateResultTableDescription(array $json): TableDescription
309309
'SSEDescription' => empty($json['SSEDescription']) ? null : $this->populateResultSSEDescription($json['SSEDescription']),
310310
'ArchivalSummary' => empty($json['ArchivalSummary']) ? null : $this->populateResultArchivalSummary($json['ArchivalSummary']),
311311
'TableClassSummary' => empty($json['TableClassSummary']) ? null : $this->populateResultTableClassSummary($json['TableClassSummary']),
312+
'DeletionProtectionEnabled' => isset($json['DeletionProtectionEnabled']) ? filter_var($json['DeletionProtectionEnabled'], \FILTER_VALIDATE_BOOLEAN) : null,
312313
]);
313314
}
314315
}

src/Result/UpdateTableOutput.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ private function populateResultTableDescription(array $json): TableDescription
309309
'SSEDescription' => empty($json['SSEDescription']) ? null : $this->populateResultSSEDescription($json['SSEDescription']),
310310
'ArchivalSummary' => empty($json['ArchivalSummary']) ? null : $this->populateResultArchivalSummary($json['ArchivalSummary']),
311311
'TableClassSummary' => empty($json['TableClassSummary']) ? null : $this->populateResultTableClassSummary($json['TableClassSummary']),
312+
'DeletionProtectionEnabled' => isset($json['DeletionProtectionEnabled']) ? filter_var($json['DeletionProtectionEnabled'], \FILTER_VALIDATE_BOOLEAN) : null,
312313
]);
313314
}
314315
}

src/ValueObject/TableDescription.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ final class TableDescription
130130
*/
131131
private $tableClassSummary;
132132

133+
/**
134+
* Indicates whether deletion protection is enabled (true) or disabled (false) on the table.
135+
*/
136+
private $deletionProtectionEnabled;
137+
133138
/**
134139
* @param array{
135140
* AttributeDefinitions?: null|AttributeDefinition[],
@@ -154,6 +159,7 @@ final class TableDescription
154159
* SSEDescription?: null|SSEDescription|array,
155160
* ArchivalSummary?: null|ArchivalSummary|array,
156161
* TableClassSummary?: null|TableClassSummary|array,
162+
* DeletionProtectionEnabled?: null|bool,
157163
* } $input
158164
*/
159165
public function __construct(array $input)
@@ -180,6 +186,7 @@ public function __construct(array $input)
180186
$this->sseDescription = isset($input['SSEDescription']) ? SSEDescription::create($input['SSEDescription']) : null;
181187
$this->archivalSummary = isset($input['ArchivalSummary']) ? ArchivalSummary::create($input['ArchivalSummary']) : null;
182188
$this->tableClassSummary = isset($input['TableClassSummary']) ? TableClassSummary::create($input['TableClassSummary']) : null;
189+
$this->deletionProtectionEnabled = $input['DeletionProtectionEnabled'] ?? null;
183190
}
184191

185192
public static function create($input): self
@@ -210,6 +217,11 @@ public function getCreationDateTime(): ?\DateTimeImmutable
210217
return $this->creationDateTime;
211218
}
212219

220+
public function getDeletionProtectionEnabled(): ?bool
221+
{
222+
return $this->deletionProtectionEnabled;
223+
}
224+
213225
/**
214226
* @return GlobalSecondaryIndexDescription[]
215227
*/

0 commit comments

Comments
 (0)