in src/dynamodb_encryption_sdk/structures.py [0:0]
def refresh_indexed_attributes(self, client):
"""Use the provided boto3 DynamoDB client to determine all indexes for this table.
:param client: Pre-configured boto3 DynamoDB client
:type client: botocore.client.BaseClient
"""
table = client.describe_table(TableName=self.name)["Table"]
self._primary_index = TableIndex.from_key_schema(table["KeySchema"])
self._secondary_indexes = []
for group in ("LocalSecondaryIndexes", "GlobalSecondaryIndexes"):
try:
for index in table[group]:
self._secondary_indexes.append(TableIndex.from_key_schema(index["KeySchema"]))
except KeyError:
pass # Not all tables will have secondary indexes.