@@ -180,28 +180,31 @@ def _make_async_sub_resources(self) -> None:
180180 )
181181
182182 def _add_contextmanager_methods (self ) -> None :
183- aenter_method = Method (
184- name = "__aenter__" ,
185- arguments = (Argument .self (),),
186- return_type = InternalImport (self .package .client .name ),
187- is_async = True ,
188- docstring = self .package .client .docstring ,
189- )
190- aenter_method .set_boto3_doc_link (self .package .client .boto3_doc_link )
191- aexit_method = Method (
192- name = "__aexit__" ,
193- arguments = (
194- Argument .self (),
195- Argument ("exc_type" , Type .Any ),
196- Argument ("exc_val" , Type .Any ),
197- Argument ("exc_tb" , Type .Any ),
198- ),
199- return_type = Type .Any ,
200- is_async = True ,
201- docstring = self .package .client .docstring ,
183+ self .package .client .methods .extend (
184+ (
185+ Method (
186+ name = "__aenter__" ,
187+ arguments = (Argument .self (),),
188+ return_type = InternalImport (self .package .client .name ),
189+ is_async = True ,
190+ docstring = self .package .client .docstring ,
191+ boto3_doc_link = self .package .client .boto3_doc_link ,
192+ ),
193+ Method (
194+ name = "__aexit__" ,
195+ arguments = (
196+ Argument .self (),
197+ Argument ("exc_type" , Type .Any ),
198+ Argument ("exc_val" , Type .Any ),
199+ Argument ("exc_tb" , Type .Any ),
200+ ),
201+ return_type = Type .Any ,
202+ is_async = True ,
203+ docstring = self .package .client .docstring ,
204+ boto3_doc_link = self .package .client .boto3_doc_link ,
205+ ),
206+ )
202207 )
203- aexit_method .set_boto3_doc_link (self .package .client .boto3_doc_link )
204- self .package .client .methods .extend ((aenter_method , aexit_method ))
205208
206209 def _iterate_types_shallow (self ) -> Iterator [FakeAnnotation ]:
207210 yield from self .package .client .iterate_types ()
0 commit comments