Skip to content

Commit 32cb56a

Browse files
committed
docs: fix docstrings and typehints in structures
1 parent f285a34 commit 32cb56a

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

src/aws_encryption_sdk/materials_managers/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from aws_encryption_sdk.structures import DataKey, EncryptedDataKey, KeyringTrace, RawDataKey
2626

2727
try: # Python 3.5.0 and 3.5.1 have incompatible typing modules
28-
from typing import Any, FrozenSet, Iterable, Tuple, Union # noqa pylint: disable=unused-import
28+
from typing import Any, Iterable, Tuple, Union # noqa pylint: disable=unused-import
2929
except ImportError: # pragma: no cover
3030
# We only actually need these imports when running the mypy checks
3131
pass
@@ -238,10 +238,10 @@ def __init__(
238238

239239
@property
240240
def encrypted_data_keys(self):
241-
# type: () -> FrozenSet[EncryptedDataKey]
241+
# type: () -> Tuple[EncryptedDataKey]
242242
"""Return a read-only version of the encrypted data keys.
243243
244-
:rtype: frozenset
244+
:rtype: Tuple[EncryptedDataKey]
245245
"""
246246
return tuple(self._encrypted_data_keys)
247247

src/aws_encryption_sdk/structures.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ class KeyringTrace(object):
113113
.. versionadded:: 1.5.0
114114
115115
:param MasterKeyInfo wrapping_key: Wrapping key used
116-
:param flags: Actions performed
117-
:type flags: set of :class:`KeyringTraceFlag`
116+
:param Set[KeyringTraceFlag] flags: Actions performed
118117
"""
119118

120119
wrapping_key = attr.ib(validator=instance_of(MasterKeyInfo))
@@ -126,19 +125,14 @@ class MessageHeader(object):
126125
# pylint: disable=too-many-instance-attributes
127126
"""Deserialized message header object.
128127
129-
:param version: Message format version, per spec
130-
:type version: SerializationVersion
131-
:param type: Message content type, per spec
132-
:type type: ObjectType
133-
:param algorithm: Algorithm to use for encryption
134-
:type algorithm: Algorithm
128+
:param SerializationVersion version: Message format version, per spec
129+
:param ObjectType type: Message content type, per spec
130+
:param AlgorithmSuite algorithm: Algorithm to use for encryption
135131
:param bytes message_id: Message ID
136-
:param dict encryption_context: Dictionary defining encryption context
137-
:param encrypted_data_keys: Encrypted data keys
138-
:type encrypted_data_keys: set of :class:`aws_encryption_sdk.structures.EncryptedDataKey`
139-
:param content_type: Message content framing type (framed/non-framed)
140-
:type content_type: ContentType
141-
:param bytes content_aad_length: empty
132+
:param Dict[str,str] encryption_context: Dictionary defining encryption context
133+
:param Sequence[EncryptedDataKey] encrypted_data_keys: Encrypted data keys
134+
:param ContentType content_type: Message content framing type (framed/non-framed)
135+
:param int content_aad_length: empty
142136
:param int header_iv_length: Bytes in Initialization Vector value found in header
143137
:param int frame_length: Length of message frame in bytes
144138
"""

0 commit comments

Comments
 (0)