types-boto3-dynamodb 1.35.71__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,349 @@
1
+ """
2
+ Type annotations for dynamodb service ServiceResource
3
+
4
+ [Open documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/)
5
+
6
+ Usage::
7
+
8
+ ```python
9
+ from boto3.session import Session
10
+
11
+ from types_boto3_dynamodb.service_resource import DynamoDBServiceResource
12
+ import types_boto3_dynamodb.service_resource as dynamodb_resources
13
+
14
+ session = Session()
15
+ resource: DynamoDBServiceResource = session.resource("dynamodb")
16
+
17
+ my_table: dynamodb_resources.Table = resource.Table(...)
18
+ ```
19
+
20
+ Copyright 2024 Vlad Emelianov
21
+ """
22
+
23
+ import sys
24
+ from datetime import datetime
25
+ from typing import Iterator, List, Sequence
26
+
27
+ from boto3.dynamodb.table import BatchWriter
28
+ from boto3.resources.base import ResourceMeta, ServiceResource
29
+ from boto3.resources.collection import ResourceCollection
30
+
31
+ from .client import DynamoDBClient
32
+ from .literals import TableStatusType
33
+ from .type_defs import (
34
+ ArchivalSummaryTypeDef,
35
+ AttributeDefinitionTypeDef,
36
+ BatchGetItemInputServiceResourceBatchGetItemTypeDef,
37
+ BatchGetItemOutputServiceResourceTypeDef,
38
+ BatchWriteItemInputServiceResourceBatchWriteItemTypeDef,
39
+ BatchWriteItemOutputServiceResourceTypeDef,
40
+ BillingModeSummaryTypeDef,
41
+ CreateTableInputServiceResourceCreateTableTypeDef,
42
+ DeleteItemInputTableDeleteItemTypeDef,
43
+ DeleteItemOutputTableTypeDef,
44
+ DeleteTableOutputTypeDef,
45
+ GetItemInputTableGetItemTypeDef,
46
+ GetItemOutputTableTypeDef,
47
+ GlobalSecondaryIndexDescriptionTypeDef,
48
+ KeySchemaElementTypeDef,
49
+ LocalSecondaryIndexDescriptionTypeDef,
50
+ OnDemandThroughputTypeDef,
51
+ ProvisionedThroughputDescriptionTypeDef,
52
+ PutItemInputTablePutItemTypeDef,
53
+ PutItemOutputTableTypeDef,
54
+ QueryInputTableQueryTypeDef,
55
+ QueryOutputTableTypeDef,
56
+ ReplicaDescriptionTypeDef,
57
+ RestoreSummaryTypeDef,
58
+ ScanInputTableScanTypeDef,
59
+ ScanOutputTableTypeDef,
60
+ SSEDescriptionTypeDef,
61
+ StreamSpecificationTypeDef,
62
+ TableClassSummaryTypeDef,
63
+ TableWarmThroughputDescriptionTypeDef,
64
+ UpdateItemInputTableUpdateItemTypeDef,
65
+ UpdateItemOutputTableTypeDef,
66
+ UpdateTableInputTableUpdateTypeDef,
67
+ )
68
+
69
+ if sys.version_info >= (3, 12):
70
+ from typing import Unpack
71
+ else:
72
+ from typing_extensions import Unpack
73
+
74
+ __all__ = ("DynamoDBServiceResource", "ServiceResourceTablesCollection", "Table")
75
+
76
+ class ServiceResourceTablesCollection(ResourceCollection):
77
+ """
78
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/service-resource/tables.html#DynamoDB.ServiceResource.tables)
79
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#serviceresourcetablescollection)
80
+ """
81
+ def all(self) -> "ServiceResourceTablesCollection":
82
+ """
83
+ Get all items from the collection, optionally with a custom page size and item
84
+ count limit.
85
+
86
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/service-resource/tables.html#DynamoDB.ServiceResource.all)
87
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#serviceresourcetablescollection)
88
+ """
89
+
90
+ def filter( # type: ignore
91
+ self, *, ExclusiveStartTableName: str = ..., Limit: int = ...
92
+ ) -> "ServiceResourceTablesCollection":
93
+ """
94
+ Get items from the collection, passing keyword arguments along as parameters to
95
+ the underlying service operation, which are typically used to filter the
96
+ results.
97
+
98
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/service-resource/tables.html#filter)
99
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#serviceresourcetablescollection)
100
+ """
101
+
102
+ def limit(self, count: int) -> "ServiceResourceTablesCollection":
103
+ """
104
+ Return at most this many Tables.
105
+
106
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/service-resource/tables.html#limit)
107
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#serviceresourcetablescollection)
108
+ """
109
+
110
+ def page_size(self, count: int) -> "ServiceResourceTablesCollection":
111
+ """
112
+ Fetch at most this many Tables per service request.
113
+
114
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/service-resource/tables.html#page_size)
115
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#serviceresourcetablescollection)
116
+ """
117
+
118
+ def pages(self) -> Iterator[List["Table"]]:
119
+ """
120
+ A generator which yields pages of Tables.
121
+
122
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/service-resource/tables.html#pages)
123
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#serviceresourcetablescollection)
124
+ """
125
+
126
+ def __iter__(self) -> Iterator["Table"]:
127
+ """
128
+ A generator which yields Tables.
129
+
130
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/service-resource/tables.html#__iter__)
131
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#serviceresourcetablescollection)
132
+ """
133
+
134
+ class Table(ServiceResource):
135
+ """
136
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/index.html#DynamoDB.Table)
137
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#table)
138
+ """
139
+
140
+ name: str
141
+ attribute_definitions: List[AttributeDefinitionTypeDef]
142
+ table_name: str
143
+ key_schema: List[KeySchemaElementTypeDef]
144
+ table_status: TableStatusType
145
+ creation_date_time: datetime
146
+ provisioned_throughput: ProvisionedThroughputDescriptionTypeDef
147
+ table_size_bytes: int
148
+ item_count: int
149
+ table_arn: str
150
+ table_id: str
151
+ billing_mode_summary: BillingModeSummaryTypeDef
152
+ local_secondary_indexes: List[LocalSecondaryIndexDescriptionTypeDef]
153
+ global_secondary_indexes: List[GlobalSecondaryIndexDescriptionTypeDef]
154
+ stream_specification: StreamSpecificationTypeDef
155
+ latest_stream_label: str
156
+ latest_stream_arn: str
157
+ global_table_version: str
158
+ replicas: List[ReplicaDescriptionTypeDef]
159
+ restore_summary: RestoreSummaryTypeDef
160
+ sse_description: SSEDescriptionTypeDef
161
+ archival_summary: ArchivalSummaryTypeDef
162
+ table_class_summary: TableClassSummaryTypeDef
163
+ deletion_protection_enabled: bool
164
+ on_demand_throughput: OnDemandThroughputTypeDef
165
+ warm_throughput: TableWarmThroughputDescriptionTypeDef
166
+ meta: "DynamoDBResourceMeta" # type: ignore
167
+
168
+ def get_available_subresources(self) -> Sequence[str]:
169
+ """
170
+ Returns a list of all the available sub-resources for this Table.
171
+
172
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/get_available_subresources.html)
173
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#tableget_available_subresources-method)
174
+ """
175
+
176
+ def delete(self) -> DeleteTableOutputTypeDef:
177
+ """
178
+ The <code>DeleteTable</code> operation deletes a table and all of its items.
179
+
180
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/delete.html)
181
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#tabledelete-method)
182
+ """
183
+
184
+ def delete_item(
185
+ self, **kwargs: Unpack[DeleteItemInputTableDeleteItemTypeDef]
186
+ ) -> DeleteItemOutputTableTypeDef:
187
+ """
188
+ Deletes a single item in a table by primary key.
189
+
190
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/delete_item.html)
191
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#tabledelete_item-method)
192
+ """
193
+
194
+ def get_item(
195
+ self, **kwargs: Unpack[GetItemInputTableGetItemTypeDef]
196
+ ) -> GetItemOutputTableTypeDef:
197
+ """
198
+ The <code>GetItem</code> operation returns a set of attributes for the item
199
+ with the given primary key.
200
+
201
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/get_item.html)
202
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#tableget_item-method)
203
+ """
204
+
205
+ def put_item(
206
+ self, **kwargs: Unpack[PutItemInputTablePutItemTypeDef]
207
+ ) -> PutItemOutputTableTypeDef:
208
+ """
209
+ Creates a new item, or replaces an old item with a new item.
210
+
211
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/put_item.html)
212
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#tableput_item-method)
213
+ """
214
+
215
+ def query(self, **kwargs: Unpack[QueryInputTableQueryTypeDef]) -> QueryOutputTableTypeDef:
216
+ """
217
+ You must provide the name of the partition key attribute and a single value for
218
+ that attribute.
219
+
220
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/query.html)
221
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#tablequery-method)
222
+ """
223
+
224
+ def scan(self, **kwargs: Unpack[ScanInputTableScanTypeDef]) -> ScanOutputTableTypeDef:
225
+ """
226
+ The <code>Scan</code> operation returns one or more items and item attributes
227
+ by accessing every item in a table or a secondary index.
228
+
229
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/scan.html)
230
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#tablescan-method)
231
+ """
232
+
233
+ def update(self, **kwargs: Unpack[UpdateTableInputTableUpdateTypeDef]) -> "_Table":
234
+ """
235
+ Modifies the provisioned throughput settings, global secondary indexes, or
236
+ DynamoDB Streams settings for a given table.
237
+
238
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/update.html)
239
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#tableupdate-method)
240
+ """
241
+
242
+ def update_item(
243
+ self, **kwargs: Unpack[UpdateItemInputTableUpdateItemTypeDef]
244
+ ) -> UpdateItemOutputTableTypeDef:
245
+ """
246
+ Edits an existing item's attributes, or adds a new item to the table if it does
247
+ not already exist.
248
+
249
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/update_item.html)
250
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#tableupdate_item-method)
251
+ """
252
+
253
+ def wait_until_exists(self) -> None:
254
+ """
255
+ Waits until Table is exists.
256
+
257
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/wait_until_exists.html)
258
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#tablewait_until_exists-method)
259
+ """
260
+
261
+ def wait_until_not_exists(self) -> None:
262
+ """
263
+ Waits until Table is not_exists.
264
+
265
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/wait_until_not_exists.html)
266
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#tablewait_until_not_exists-method)
267
+ """
268
+
269
+ def batch_writer(self, overwrite_by_pkeys: List[str] = ...) -> BatchWriter:
270
+ """
271
+ Create a batch writer object.
272
+
273
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/batch_writer.html)
274
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#tablebatch_writer-method)
275
+ """
276
+
277
+ def load(self) -> None:
278
+ """
279
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/load.html)
280
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#tableload-method)
281
+ """
282
+
283
+ def reload(self) -> None:
284
+ """
285
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/table/reload.html)
286
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#tablereload-method)
287
+ """
288
+
289
+ _Table = Table
290
+
291
+ class DynamoDBResourceMeta(ResourceMeta):
292
+ client: DynamoDBClient
293
+
294
+ class DynamoDBServiceResource(ServiceResource):
295
+ """
296
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/service-resource/index.html)
297
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/)
298
+ """
299
+
300
+ meta: "DynamoDBResourceMeta" # type: ignore
301
+ tables: ServiceResourceTablesCollection
302
+
303
+ def get_available_subresources(self) -> Sequence[str]:
304
+ """
305
+ Returns a list of all the available sub-resources for this resource.
306
+
307
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/service-resource/get_available_subresources.html)
308
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#dynamodbserviceresourceget_available_subresources-method)
309
+ """
310
+
311
+ def batch_get_item(
312
+ self, **kwargs: Unpack[BatchGetItemInputServiceResourceBatchGetItemTypeDef]
313
+ ) -> BatchGetItemOutputServiceResourceTypeDef:
314
+ """
315
+ The <code>BatchGetItem</code> operation returns the attributes of one or more
316
+ items from one or more tables.
317
+
318
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/service-resource/batch_get_item.html)
319
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#dynamodbserviceresourcebatch_get_item-method)
320
+ """
321
+
322
+ def batch_write_item(
323
+ self, **kwargs: Unpack[BatchWriteItemInputServiceResourceBatchWriteItemTypeDef]
324
+ ) -> BatchWriteItemOutputServiceResourceTypeDef:
325
+ """
326
+ The <code>BatchWriteItem</code> operation puts or deletes multiple items in one
327
+ or more tables.
328
+
329
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/service-resource/batch_write_item.html)
330
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#dynamodbserviceresourcebatch_write_item-method)
331
+ """
332
+
333
+ def create_table(
334
+ self, **kwargs: Unpack[CreateTableInputServiceResourceCreateTableTypeDef]
335
+ ) -> "_Table":
336
+ """
337
+ The <code>CreateTable</code> operation adds a new table to your account.
338
+
339
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/service-resource/create_table.html)
340
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#dynamodbserviceresourcecreate_table-method)
341
+ """
342
+
343
+ def Table(self, name: str) -> "_Table":
344
+ """
345
+ Creates a Table resource.
346
+
347
+ [Show boto3 documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb/service-resource/Table.html)
348
+ [Show types-boto3 documentation](https://youtype.github.io/types_boto3_docs/types_boto3_dynamodb/service_resource/#dynamodbserviceresourcetable-method)
349
+ """