Skip to content

Commit 2201e4a

Browse files
author
Lucas McDonald
committed
m
1 parent 9057fcb commit 2201e4a

File tree

12 files changed

+478
-342
lines changed

12 files changed

+478
-342
lines changed

DynamoDbEncryption/runtimes/python/src/aws_dbesdk_dynamodb/smithygenerated/aws_cryptography_dbencryptionsdk_dynamodb/client.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@
3737

3838

3939
class DynamoDbEncryption:
40-
"""Client for DynamoDbEncryption
40+
"""Client for DynamoDbEncryption.
4141
4242
:param config: Configuration for the client.
4343
"""
4444

4545
def __init__(
46-
self, config: DynamoDbEncryptionConfig | None = None, dafny_client: IDynamoDbEncryptionClient | None = None
46+
self,
47+
config: DynamoDbEncryptionConfig | None = None,
48+
dafny_client: IDynamoDbEncryptionClient | None = None,
4749
):
4850
if config is None:
4951
self._config = Config()
@@ -63,9 +65,12 @@ def __init__(
6365
def create_dynamo_db_encryption_branch_key_id_supplier(
6466
self, input: CreateDynamoDbEncryptionBranchKeyIdSupplierInput
6567
) -> CreateDynamoDbEncryptionBranchKeyIdSupplierOutput:
66-
"""Create a Branch Key Supplier for use with the Hierarchical Keyring that decides what Branch Key to use based on the primary key of the DynamoDB item being read or written.
68+
"""Create a Branch Key Supplier for use with the Hierarchical Keyring
69+
that decides what Branch Key to use based on the primary key of the
70+
DynamoDB item being read or written.
6771
68-
:param input: Inputs for creating a Branch Key Supplier from a DynamoDB Key Branch Key Id Supplier
72+
:param input: Inputs for creating a Branch Key Supplier from a
73+
DynamoDB Key Branch Key Id Supplier
6974
"""
7075
return self._execute_operation(
7176
input=input,
@@ -130,7 +135,10 @@ def _handle_execution(
130135
except AttributeError:
131136
config.interceptors = []
132137
_client_interceptors = config.interceptors
133-
client_interceptors = cast(list[Interceptor[Input, Output, DafnyRequest, DafnyResponse]], _client_interceptors)
138+
client_interceptors = cast(
139+
list[Interceptor[Input, Output, DafnyRequest, DafnyResponse]],
140+
_client_interceptors,
141+
)
134142
interceptors = client_interceptors
135143

136144
try:
@@ -224,7 +232,10 @@ def _handle_execution(
224232
# At this point, the context's request will have been definitively set, and
225233
# The response will be set either with the modeled output or an exception. The
226234
# transport_request and transport_response may be set or None.
227-
execution_context = cast(InterceptorContext[Input, Output, DafnyRequest | None, DafnyResponse | None], context)
235+
execution_context = cast(
236+
InterceptorContext[Input, Output, DafnyRequest | None, DafnyResponse | None],
237+
context,
238+
)
228239
return self._finalize_execution(interceptors, execution_context)
229240

230241
def _handle_attempt(
@@ -281,7 +292,10 @@ def _handle_attempt(
281292
# the response is either set or an exception, and the transport_resposne is either set or
282293
# None. This will also be true after _finalize_attempt because there is no opportunity
283294
# there to set the transport_response.
284-
attempt_context = cast(InterceptorContext[Input, Output, DafnyRequest, DafnyResponse | None], context)
295+
attempt_context = cast(
296+
InterceptorContext[Input, Output, DafnyRequest, DafnyResponse | None],
297+
context,
298+
)
285299
return self._finalize_attempt(interceptors, attempt_context)
286300

287301
def _finalize_attempt(

DynamoDbEncryption/runtimes/python/src/aws_dbesdk_dynamodb/smithygenerated/aws_cryptography_dbencryptionsdk_dynamodb/config.py

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,10 @@ def __init__(
3636
):
3737
"""Constructor.
3838
39-
:param interceptors: The list of interceptors, which are hooks that are called
40-
during the execution of a request.
41-
42-
:param retry_strategy: The retry strategy for issuing retry tokens and computing
43-
retry delays.
44-
39+
:param interceptors: The list of interceptors, which are hooks
40+
that are called during the execution of a request.
41+
:param retry_strategy: The retry strategy for issuing retry
42+
tokens and computing retry delays.
4543
:param dafnyImplInterface:
4644
"""
4745
self.interceptors = interceptors or []
@@ -57,7 +55,7 @@ class DynamoDbEncryptionConfig(Config):
5755
def __init__(
5856
self,
5957
):
60-
"""Constructor for DynamoDbEncryptionConfig"""
58+
"""Constructor for DynamoDbEncryptionConfig."""
6159
super().__init__()
6260

6361
def as_dict(self) -> Dict[str, Any]:
@@ -79,20 +77,16 @@ def __eq__(self, other: Any) -> bool:
7977

8078

8179
def dafny_config_to_smithy_config(dafny_config) -> DynamoDbEncryptionConfig:
82-
"""
83-
Converts the provided Dafny shape for this localService's config
84-
into the corresponding Smithy-modelled shape.
85-
"""
80+
"""Converts the provided Dafny shape for this localService's config into
81+
the corresponding Smithy-modelled shape."""
8682
return aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.dafny_to_smithy.aws_cryptography_dbencryptionsdk_dynamodb_DynamoDbEncryptionConfig(
8783
dafny_config
8884
)
8985

9086

9187
def smithy_config_to_dafny_config(smithy_config) -> DafnyDynamoDbEncryptionConfig:
92-
"""
93-
Converts the provided Smithy-modelled shape for this localService's config
94-
into the corresponding Dafny shape.
95-
"""
88+
"""Converts the provided Smithy-modelled shape for this localService's
89+
config into the corresponding Dafny shape."""
9690
return aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.smithy_to_dafny.aws_cryptography_dbencryptionsdk_dynamodb_DynamoDbEncryptionConfig(
9791
smithy_config
9892
)

DynamoDbEncryption/runtimes/python/src/aws_dbesdk_dynamodb/smithygenerated/aws_cryptography_dbencryptionsdk_dynamodb/dafnyImplInterface.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
# SPDX-License-Identifier: Apache-2.0
33
# Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
44

5-
from aws_dbesdk_dynamodb.internaldafny.generated.DynamoDbEncryption import DynamoDbEncryptionClient
5+
from aws_dbesdk_dynamodb.internaldafny.generated.DynamoDbEncryption import (
6+
DynamoDbEncryptionClient,
7+
)
68
from .dafny_protocol import DafnyRequest
79

810

DynamoDbEncryption/runtimes/python/src/aws_dbesdk_dynamodb/smithygenerated/aws_cryptography_dbencryptionsdk_dynamodb/dafny_to_smithy.py

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
import aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_structuredencryption.dafny_to_smithy
3535

3636

37-
def aws_cryptography_dbencryptionsdk_dynamodb_GetBranchKeyIdFromDdbKeyInput(dafny_input):
37+
def aws_cryptography_dbencryptionsdk_dynamodb_GetBranchKeyIdFromDdbKeyInput(
38+
dafny_input,
39+
):
3840
return aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.models.GetBranchKeyIdFromDdbKeyInput(
3941
ddb_key={
4042
b"".join(ord(c).to_bytes(2, "big") for c in key).decode(
@@ -47,13 +49,17 @@ def aws_cryptography_dbencryptionsdk_dynamodb_GetBranchKeyIdFromDdbKeyInput(dafn
4749
)
4850

4951

50-
def aws_cryptography_dbencryptionsdk_dynamodb_GetBranchKeyIdFromDdbKeyOutput(dafny_input):
52+
def aws_cryptography_dbencryptionsdk_dynamodb_GetBranchKeyIdFromDdbKeyOutput(
53+
dafny_input,
54+
):
5155
return aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.models.GetBranchKeyIdFromDdbKeyOutput(
5256
branch_key_id=b"".join(ord(c).to_bytes(2, "big") for c in dafny_input.branchKeyId).decode("utf-16-be"),
5357
)
5458

5559

56-
def aws_cryptography_dbencryptionsdk_dynamodb_DynamoDbKeyBranchKeyIdSupplierReference(dafny_input):
60+
def aws_cryptography_dbencryptionsdk_dynamodb_DynamoDbKeyBranchKeyIdSupplierReference(
61+
dafny_input,
62+
):
5763
if hasattr(dafny_input, "_native_impl"):
5864
return dafny_input._native_impl
5965

@@ -65,7 +71,9 @@ def aws_cryptography_dbencryptionsdk_dynamodb_DynamoDbKeyBranchKeyIdSupplierRefe
6571
return DynamoDbKeyBranchKeyIdSupplier(_impl=dafny_input)
6672

6773

68-
def aws_cryptography_dbencryptionsdk_dynamodb_CreateDynamoDbEncryptionBranchKeyIdSupplierInput(dafny_input):
74+
def aws_cryptography_dbencryptionsdk_dynamodb_CreateDynamoDbEncryptionBranchKeyIdSupplierInput(
75+
dafny_input,
76+
):
6977
return aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.models.CreateDynamoDbEncryptionBranchKeyIdSupplierInput(
7078
ddb_key_branch_key_id_supplier=(
7179
(
@@ -79,7 +87,9 @@ def aws_cryptography_dbencryptionsdk_dynamodb_CreateDynamoDbEncryptionBranchKeyI
7987
)
8088

8189

82-
def aws_cryptography_dbencryptionsdk_dynamodb_GetEncryptedDataKeyDescriptionUnion(dafny_input):
90+
def aws_cryptography_dbencryptionsdk_dynamodb_GetEncryptedDataKeyDescriptionUnion(
91+
dafny_input,
92+
):
8393
# Convert GetEncryptedDataKeyDescriptionUnion
8494
if isinstance(dafny_input, GetEncryptedDataKeyDescriptionUnion_header):
8595
GetEncryptedDataKeyDescriptionUnion_union_value = aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.models.GetEncryptedDataKeyDescriptionUnionHeader(
@@ -102,15 +112,19 @@ def aws_cryptography_dbencryptionsdk_dynamodb_GetEncryptedDataKeyDescriptionUnio
102112
return GetEncryptedDataKeyDescriptionUnion_union_value
103113

104114

105-
def aws_cryptography_dbencryptionsdk_dynamodb_GetEncryptedDataKeyDescriptionInput(dafny_input):
115+
def aws_cryptography_dbencryptionsdk_dynamodb_GetEncryptedDataKeyDescriptionInput(
116+
dafny_input,
117+
):
106118
return aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.models.GetEncryptedDataKeyDescriptionInput(
107119
input=aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.dafny_to_smithy.aws_cryptography_dbencryptionsdk_dynamodb_GetEncryptedDataKeyDescriptionUnion(
108120
dafny_input.input
109121
),
110122
)
111123

112124

113-
def aws_cryptography_dbencryptionsdk_dynamodb_CreateDynamoDbEncryptionBranchKeyIdSupplierOutput(dafny_input):
125+
def aws_cryptography_dbencryptionsdk_dynamodb_CreateDynamoDbEncryptionBranchKeyIdSupplierOutput(
126+
dafny_input,
127+
):
114128
return aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.models.CreateDynamoDbEncryptionBranchKeyIdSupplierOutput(
115129
branch_key_id_supplier=(
116130
(
@@ -145,7 +159,9 @@ def aws_cryptography_dbencryptionsdk_dynamodb_EncryptedDataKeyDescription(dafny_
145159
)
146160

147161

148-
def aws_cryptography_dbencryptionsdk_dynamodb_GetEncryptedDataKeyDescriptionOutput(dafny_input):
162+
def aws_cryptography_dbencryptionsdk_dynamodb_GetEncryptedDataKeyDescriptionOutput(
163+
dafny_input,
164+
):
149165
return aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.models.GetEncryptedDataKeyDescriptionOutput(
150166
encrypted_data_key_description_output=[
151167
aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.dafny_to_smithy.aws_cryptography_dbencryptionsdk_dynamodb_EncryptedDataKeyDescription(
@@ -359,7 +375,9 @@ def aws_cryptography_dbencryptionsdk_dynamodb_CompoundBeacon(dafny_input):
359375

360376

361377
def aws_cryptography_dbencryptionsdk_dynamodb_KeyStoreReference(dafny_input):
362-
from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.client import KeyStore
378+
from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.client import (
379+
KeyStore,
380+
)
363381

364382
return KeyStore(config=None, dafny_client=dafny_input)
365383

@@ -600,7 +618,9 @@ def aws_cryptography_dbencryptionsdk_dynamodb_DynamoDbEncryptionConfig(dafny_inp
600618
)
601619

602620

603-
def aws_cryptography_dbencryptionsdk_dynamodb_LegacyDynamoDbEncryptorReference(dafny_input):
621+
def aws_cryptography_dbencryptionsdk_dynamodb_LegacyDynamoDbEncryptorReference(
622+
dafny_input,
623+
):
604624
if hasattr(dafny_input, "_native_impl"):
605625
return dafny_input._native_impl
606626

@@ -686,7 +706,9 @@ def aws_cryptography_dbencryptionsdk_dynamodb_SearchConfig(dafny_input):
686706
)
687707

688708

689-
def aws_cryptography_dbencryptionsdk_dynamodb_DynamoDbTableEncryptionConfig(dafny_input):
709+
def aws_cryptography_dbencryptionsdk_dynamodb_DynamoDbTableEncryptionConfig(
710+
dafny_input,
711+
):
690712
return aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.models.DynamoDbTableEncryptionConfig(
691713
logical_table_name=b"".join(ord(c).to_bytes(2, "big") for c in dafny_input.logicalTableName).decode(
692714
"utf-16-be"
@@ -783,7 +805,9 @@ def aws_cryptography_dbencryptionsdk_dynamodb_DynamoDbTableEncryptionConfig(dafn
783805
)
784806

785807

786-
def aws_cryptography_dbencryptionsdk_dynamodb_DynamoDbTablesEncryptionConfig(dafny_input):
808+
def aws_cryptography_dbencryptionsdk_dynamodb_DynamoDbTablesEncryptionConfig(
809+
dafny_input,
810+
):
787811
return aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.models.DynamoDbTablesEncryptionConfig(
788812
table_encryption_configs={
789813
b"".join(ord(c).to_bytes(2, "big") for c in key).decode(

DynamoDbEncryption/runtimes/python/src/aws_dbesdk_dynamodb/smithygenerated/aws_cryptography_dbencryptionsdk_dynamodb/errors.py

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __init__(self, message: str):
4444

4545

4646
class UnknownApiError(ApiError[Literal["Unknown"]]):
47-
"""Error representing any unknown api errors"""
47+
"""Error representing any unknown api errors."""
4848

4949
code: Literal["Unknown"] = "Unknown"
5050

@@ -130,8 +130,8 @@ def __init__(self, *, message: str, list):
130130
def as_dict(self) -> Dict[str, Any]:
131131
"""Converts the CollectionOfErrors to a dictionary.
132132
133-
The dictionary uses the modeled shape names rather than the parameter names as
134-
keys to be mostly compatible with boto3.
133+
The dictionary uses the modeled shape names rather than the
134+
parameter names as keys to be mostly compatible with boto3.
135135
"""
136136
return {
137137
"message": self.message,
@@ -143,8 +143,9 @@ def as_dict(self) -> Dict[str, Any]:
143143
def from_dict(d: Dict[str, Any]) -> "CollectionOfErrors":
144144
"""Creates a CollectionOfErrors from a dictionary.
145145
146-
The dictionary is expected to use the modeled shape names rather than the
147-
parameter names as keys to be mostly compatible with boto3.
146+
The dictionary is expected to use the modeled shape names rather
147+
than the parameter names as keys to be mostly compatible with
148+
boto3.
148149
"""
149150
kwargs: Dict[str, Any] = {"message": d["message"], "list": d["list"]}
150151

@@ -179,8 +180,8 @@ def __init__(self, *, obj):
179180
def as_dict(self) -> Dict[str, Any]:
180181
"""Converts the OpaqueError to a dictionary.
181182
182-
The dictionary uses the modeled shape names rather than the parameter names as
183-
keys to be mostly compatible with boto3.
183+
The dictionary uses the modeled shape names rather than the
184+
parameter names as keys to be mostly compatible with boto3.
184185
"""
185186
return {
186187
"message": self.message,
@@ -192,8 +193,9 @@ def as_dict(self) -> Dict[str, Any]:
192193
def from_dict(d: Dict[str, Any]) -> "OpaqueError":
193194
"""Creates a OpaqueError from a dictionary.
194195
195-
The dictionary is expected to use the modeled shape names rather than the
196-
parameter names as keys to be mostly compatible with boto3.
196+
The dictionary is expected to use the modeled shape names rather
197+
than the parameter names as keys to be mostly compatible with
198+
boto3.
197199
"""
198200
kwargs: Dict[str, Any] = {"message": d["message"], "obj": d["obj"]}
199201

@@ -230,8 +232,8 @@ def __init__(self, *, obj, obj_message):
230232
def as_dict(self) -> Dict[str, Any]:
231233
"""Converts the OpaqueWithTextError to a dictionary.
232234
233-
The dictionary uses the modeled shape names rather than the parameter names as
234-
keys to be mostly compatible with boto3.
235+
The dictionary uses the modeled shape names rather than the
236+
parameter names as keys to be mostly compatible with boto3.
235237
"""
236238
return {
237239
"message": self.message,
@@ -244,10 +246,15 @@ def as_dict(self) -> Dict[str, Any]:
244246
def from_dict(d: Dict[str, Any]) -> "OpaqueWithTextError":
245247
"""Creates a OpaqueWithTextError from a dictionary.
246248
247-
The dictionary is expected to use the modeled shape names rather than the
248-
parameter names as keys to be mostly compatible with boto3.
249+
The dictionary is expected to use the modeled shape names rather
250+
than the parameter names as keys to be mostly compatible with
251+
boto3.
249252
"""
250-
kwargs: Dict[str, Any] = {"message": d["message"], "obj": d["obj"], "obj_message": d["obj_message"]}
253+
kwargs: Dict[str, Any] = {
254+
"message": d["message"],
255+
"obj": d["obj"],
256+
"obj_message": d["obj_message"],
257+
}
251258

252259
return OpaqueWithTextError(**kwargs)
253260

@@ -271,10 +278,8 @@ def __eq__(self, other: Any) -> bool:
271278

272279

273280
def _smithy_error_to_dafny_error(e: ServiceError):
274-
"""
275-
Converts the provided native Smithy-modeled error
276-
into the corresponding Dafny error.
277-
"""
281+
"""Converts the provided native Smithy-modeled error into the corresponding
282+
Dafny error."""
278283
if isinstance(
279284
e,
280285
aws_dbesdk_dynamodb.smithygenerated.aws_cryptography_dbencryptionsdk_dynamodb.errors.DynamoDbEncryptionException,

0 commit comments

Comments
 (0)