3535Input = TypeVar ("Input" )
3636Output = TypeVar ("Output" )
3737
38-
3938class DynamoDbEncryption :
40- """Client for DynamoDbEncryption.
39+ """Client for DynamoDbEncryption
4140
4241 :param config: Configuration for the client.
4342 """
44-
4543 def __init__ (
4644 self ,
4745 config : DynamoDbEncryptionConfig | None = None ,
48- dafny_client : IDynamoDbEncryptionClient | None = None ,
46+ dafny_client : IDynamoDbEncryptionClient | None = None
4947 ):
5048 if config is None :
5149 self ._config = Config ()
@@ -62,15 +60,10 @@ def __init__(
6260 if dafny_client is not None :
6361 self ._config .dafnyImplInterface .impl = dafny_client
6462
65- def create_dynamo_db_encryption_branch_key_id_supplier (
66- self , input : CreateDynamoDbEncryptionBranchKeyIdSupplierInput
67- ) -> CreateDynamoDbEncryptionBranchKeyIdSupplierOutput :
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.
63+ def create_dynamo_db_encryption_branch_key_id_supplier (self , input : CreateDynamoDbEncryptionBranchKeyIdSupplierInput ) -> CreateDynamoDbEncryptionBranchKeyIdSupplierOutput :
64+ """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.
7165
72- :param input: Inputs for creating a Branch Key Supplier from a
73- DynamoDB Key Branch Key Id Supplier
66+ :param input: Inputs for creating a Branch Key Supplier from a DynamoDB Key Branch Key Id Supplier
7467 """
7568 return self ._execute_operation (
7669 input = input ,
@@ -81,9 +74,7 @@ def create_dynamo_db_encryption_branch_key_id_supplier(
8174 operation_name = "CreateDynamoDbEncryptionBranchKeyIdSupplier" ,
8275 )
8376
84- def get_encrypted_data_key_description (
85- self , input : GetEncryptedDataKeyDescriptionInput
86- ) -> GetEncryptedDataKeyDescriptionOutput :
77+ def get_encrypted_data_key_description (self , input : GetEncryptedDataKeyDescriptionInput ) -> GetEncryptedDataKeyDescriptionOutput :
8778 """Returns encrypted data key description.
8879
8980 :param input: Input for getting encrypted data key description.
@@ -107,7 +98,9 @@ def _execute_operation(
10798 operation_name : str ,
10899 ) -> Output :
109100 try :
110- return self ._handle_execution (input , plugins , serialize , deserialize , config , operation_name )
101+ return self ._handle_execution (
102+ input , plugins , serialize , deserialize , config , operation_name
103+ )
111104 except Exception as e :
112105 # Make sure every exception that we throw is an instance of ServiceError so
113106 # customers can reliably catch everything we throw.
@@ -131,13 +124,12 @@ def _handle_execution(
131124 transport_response = None ,
132125 )
133126 try :
134- _client_interceptors = config .interceptors
127+ _client_interceptors = config .interceptors
135128 except AttributeError :
136- config .interceptors = []
137- _client_interceptors = config .interceptors
129+ config .interceptors = []
130+ _client_interceptors = config .interceptors
138131 client_interceptors = cast (
139- list [Interceptor [Input , Output , DafnyRequest , DafnyResponse ]],
140- _client_interceptors ,
132+ list [Interceptor [Input , Output , DafnyRequest , DafnyResponse ]], _client_interceptors
141133 )
142134 interceptors = client_interceptors
143135
@@ -171,7 +163,9 @@ def _handle_execution(
171163 interceptor .read_before_serialization (context )
172164
173165 # Step 4: Serialize the request
174- context_with_transport_request = cast (InterceptorContext [Input , None , DafnyRequest , None ], context )
166+ context_with_transport_request = cast (
167+ InterceptorContext [Input , None , DafnyRequest , None ], context
168+ )
175169 context_with_transport_request ._transport_request = serialize (
176170 context_with_transport_request .request , config
177171 )
@@ -182,8 +176,8 @@ def _handle_execution(
182176
183177 # Step 6: Invoke modify_before_retry_loop
184178 for interceptor in interceptors :
185- context_with_transport_request ._transport_request = interceptor . modify_before_retry_loop (
186- context_with_transport_request
179+ context_with_transport_request ._transport_request = (
180+ interceptor . modify_before_retry_loop ( context_with_transport_request )
187181 )
188182
189183 # Step 7: Acquire the retry token.
@@ -218,7 +212,7 @@ def _handle_execution(
218212 error_info = RetryErrorInfo (
219213 # TODO: Determine the error type.
220214 error_type = RetryErrorType .CLIENT_ERROR ,
221- ),
215+ )
222216 )
223217 except SmithyRetryException :
224218 raise context_with_response .response
@@ -233,8 +227,7 @@ def _handle_execution(
233227 # The response will be set either with the modeled output or an exception. The
234228 # transport_request and transport_response may be set or None.
235229 execution_context = cast (
236- InterceptorContext [Input , Output , DafnyRequest | None , DafnyResponse | None ],
237- context ,
230+ InterceptorContext [Input , Output , DafnyRequest | None , DafnyResponse | None ], context
238231 )
239232 return self ._finalize_execution (interceptors , execution_context )
240233
@@ -255,7 +248,9 @@ def _handle_attempt(
255248 if config .dafnyImplInterface .impl is None :
256249 raise Exception ("No impl found on the operation config." )
257250
258- context_with_response = cast (InterceptorContext [Input , None , DafnyRequest , DafnyResponse ], context )
251+ context_with_response = cast (
252+ InterceptorContext [Input , None , DafnyRequest , DafnyResponse ], context
253+ )
259254
260255 context_with_response ._transport_response = config .dafnyImplInterface .handle_request (
261256 input = context_with_response .transport_request
@@ -267,8 +262,8 @@ def _handle_attempt(
267262
268263 # Step 7o: Invoke modify_before_deserialization
269264 for interceptor in interceptors :
270- context_with_response ._transport_response = interceptor . modify_before_deserialization (
271- context_with_response
265+ context_with_response ._transport_response = (
266+ interceptor . modify_before_deserialization ( context_with_response )
272267 )
273268
274269 # Step 7p: Invoke read_before_deserialization
@@ -280,7 +275,9 @@ def _handle_attempt(
280275 InterceptorContext [Input , Output , DafnyRequest , DafnyResponse ],
281276 context_with_response ,
282277 )
283- context_with_output ._response = deserialize (context_with_output ._transport_response , config )
278+ context_with_output ._response = deserialize (
279+ context_with_output ._transport_response , config
280+ )
284281
285282 # Step 7r: Invoke read_after_deserialization
286283 for interceptor in interceptors :
@@ -293,8 +290,7 @@ def _handle_attempt(
293290 # None. This will also be true after _finalize_attempt because there is no opportunity
294291 # there to set the transport_response.
295292 attempt_context = cast (
296- InterceptorContext [Input , Output , DafnyRequest , DafnyResponse | None ],
297- context ,
293+ InterceptorContext [Input , Output , DafnyRequest , DafnyResponse | None ], context
298294 )
299295 return self ._finalize_attempt (interceptors , attempt_context )
300296
@@ -306,7 +302,9 @@ def _finalize_attempt(
306302 # Step 7s: Invoke modify_before_attempt_completion
307303 try :
308304 for interceptor in interceptors :
309- context ._response = interceptor .modify_before_attempt_completion (context )
305+ context ._response = interceptor .modify_before_attempt_completion (
306+ context
307+ )
310308 except Exception as e :
311309 context ._response = e
312310
0 commit comments