Skip to content

Examples#

Index > ApplicationCostProfiler > Examples

Auto-generated documentation for ApplicationCostProfiler type annotations stubs module mypy-boto3-applicationcostprofiler.

Client#

Implicit type annotations#

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

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

Client method usage example#

# ApplicationCostProfilerClient usage example

from boto3.session import Session


session = Session()

client = session.client("applicationcostprofiler")  # (1)
result = client.delete_report_definition()  # (2)
  1. client: ApplicationCostProfilerClient
  2. result: DeleteReportDefinitionResultTypeDef

Paginator usage example#

# ListReportDefinitionsPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("applicationcostprofiler")  # (1)

paginator = client.get_paginator("list_report_definitions")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: ApplicationCostProfilerClient
  2. paginator: ListReportDefinitionsPaginator
  3. item: ListReportDefinitionsResultTypeDef

Explicit type annotations#

With boto3-stubs-lite[applicationcostprofiler] or a standalone mypy_boto3_applicationcostprofiler package, you have to explicitly specify client: ApplicationCostProfilerClient 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 method usage example#

# ApplicationCostProfilerClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_applicationcostprofiler.client import ApplicationCostProfilerClient
from mypy_boto3_applicationcostprofiler.type_defs import DeleteReportDefinitionResultTypeDef
from mypy_boto3_applicationcostprofiler.type_defs import DeleteReportDefinitionRequestTypeDef


session = Session()

client: ApplicationCostProfilerClient = session.client("applicationcostprofiler")

kwargs: DeleteReportDefinitionRequestTypeDef = {...}
result: DeleteReportDefinitionResultTypeDef = client.delete_report_definition(**kwargs)

Paginator usage example#

# ListReportDefinitionsPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_applicationcostprofiler.client import ApplicationCostProfilerClient
from mypy_boto3_applicationcostprofiler.paginator import ListReportDefinitionsPaginator
from mypy_boto3_applicationcostprofiler.type_defs import ListReportDefinitionsResultTypeDef


session = Session()
client: ApplicationCostProfilerClient = session.client("applicationcostprofiler")

paginator: ListReportDefinitionsPaginator = client.get_paginator("list_report_definitions")
for item in paginator.paginate(...):
    item: ListReportDefinitionsResultTypeDef
    print(item)