Skip to content

Examples

Index > ComputeOptimizer > Examples

Auto-generated documentation for ComputeOptimizer type annotations stubs module mypy-boto3-compute-optimizer.

Client

Implicit type annotations

Can be used with boto3-stubs[compute-optimizer] package installed.

Write your ComputeOptimizer code as usual, type checking and code completion should work out of the box.

Client usage example
from boto3.session import Session


session = Session()

client = session.client("compute-optimizer")  # (1)
result = client.describe_recommendation_export_jobs()  # (2)
  1. client: ComputeOptimizerClient
  2. result: DescribeRecommendationExportJobsResponseTypeDef

Explicit type annotations

With boto3-stubs-lite[compute-optimizer] or a standalone mypy_boto3_compute_optimizer package, you have to explicitly specify client: ComputeOptimizerClient type annotation.

All other type annotations are optional, as types should be discovered automatically. However, these type annotations can be helpful in your functions and methods.

Client usage example
from boto3.session import Session

from mypy_boto3_compute_optimizer.client import ComputeOptimizerClient
from mypy_boto3_compute_optimizer.type_defs import DescribeRecommendationExportJobsResponseTypeDef
from mypy_boto3_compute_optimizer.type_defs import DescribeRecommendationExportJobsRequestRequestTypeDef


session = Session()

client: ComputeOptimizerClient = session.client("compute-optimizer")

kwargs: DescribeRecommendationExportJobsRequestRequestTypeDef = {...}
result: DescribeRecommendationExportJobsResponseTypeDef = client.describe_recommendation_export_jobs(**kwargs)