Skip to content

Commit 2e7aae7

Browse files
committed
Merge branch 'morosi-feat' into 'master'
Add better secretsmanager|cloudfront|pricing typings See merge request it/e3-aws!141
2 parents 411d02b + 3ba58cb commit 2e7aae7

3 files changed

Lines changed: 26 additions & 4 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ check = [
5050
"types-requests",
5151
"types-setuptools",
5252
"python-on-whales",
53-
"types-boto3[essential,ec2,ecr,iam,lambda,sts]",
53+
"types-boto3[essential,cloudfront,ec2,ecr,iam,lambda,pricing,secretsmanager,sts]",
5454
]
5555

5656
[tool.setuptools.dynamic]

src/e3/aws/__init__.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,15 @@
3333
from types import TracebackType
3434

3535
from types_boto3_cloudformation import CloudFormationClient
36+
from types_boto3_cloudfront import CloudFrontClient
3637
from types_boto3_dynamodb import DynamoDBClient
3738
from types_boto3_ec2 import EC2Client
3839
from types_boto3_ecr import ECRClient
3940
from types_boto3_iam import IAMClient
4041
from types_boto3_lambda import LambdaClient
42+
from types_boto3_pricing import PricingClient
4143
from types_boto3_s3 import S3Client
44+
from types_boto3_secretsmanager import SecretsManagerClient
4245
from types_boto3_sts import STSClient
4346
from types_boto3_sts.type_defs import AssumeRoleRequestTypeDef
4447

@@ -282,6 +285,11 @@ def to_boto3(self) -> boto3.Session:
282285
@overload
283286
def client(self, name: Literal["s3"], region: str | None = ...) -> S3Client: ...
284287

288+
@overload
289+
def client(
290+
self, name: Literal["secretsmanager"], region: str | None = ...
291+
) -> SecretsManagerClient: ...
292+
285293
@overload
286294
def client(self, name: Literal["sts"], region: str | None = ...) -> STSClient: ...
287295

@@ -290,6 +298,11 @@ def client(
290298
self, name: Literal["cloudformation"], region: str | None = ...
291299
) -> CloudFormationClient: ...
292300

301+
@overload
302+
def client(
303+
self, name: Literal["cloudfront"], region: str | None = ...
304+
) -> CloudFrontClient: ...
305+
293306
@overload
294307
def client(
295308
self, name: Literal["dynamodb"], region: str | None = ...
@@ -309,6 +322,11 @@ def client(
309322
self, name: Literal["lambda"], region: str | None = ...
310323
) -> LambdaClient: ...
311324

325+
@overload
326+
def client(
327+
self, name: Literal["pricing"], region: str | None = ...
328+
) -> PricingClient: ...
329+
312330
@overload
313331
def client(
314332
self, name: str, region: str | None = ...
@@ -318,13 +336,16 @@ def client(
318336
self, name: str, region: str | None = None
319337
) -> (
320338
S3Client
339+
| SecretsManagerClient
321340
| STSClient
322341
| CloudFormationClient
342+
| CloudFrontClient
323343
| DynamoDBClient
324344
| EC2Client
325345
| ECRClient
326346
| IAMClient
327347
| LambdaClient
348+
| PricingClient
328349
| botocore.client.BaseClient
329350
):
330351
"""Get a client.

src/e3/aws/pricing/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
from typing import TYPE_CHECKING
1010

1111
if TYPE_CHECKING:
12-
import botocore
12+
from types_boto3_pricing import PricingClient
13+
from types_boto3_pricing.type_defs import FilterTypeDef
1314

1415
from typing import Any
1516

@@ -22,7 +23,7 @@
2223
class Pricing:
2324
"""Pricing abstraction."""
2425

25-
def __init__(self, client: botocore.client.BaseClient) -> None:
26+
def __init__(self, client: PricingClient) -> None:
2627
"""Initialize Pricing.
2728
2829
:param client: a client for the Pricing API
@@ -51,7 +52,7 @@ def ec2_price_information(
5152
instance_type: str | None = None,
5253
os: str | None = None,
5354
region: str | None = None,
54-
filters: list[dict[str, Any]] | None = None,
55+
filters: list[FilterTypeDef] | None = None,
5556
) -> list[PriceInformation]:
5657
"""Get pricing informations for EC2 instances.
5758

0 commit comments

Comments
 (0)