Skip to content

Examples#

Index > BillingandCostManagementDashboards > Examples

Auto-generated documentation for BillingandCostManagementDashboards type annotations stubs module types-boto3-bcm-dashboards.

Client#

Implicit type annotations#

Can be used with types-boto3[bcm-dashboards] package installed.

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

Client method usage example#

# BillingandCostManagementDashboardsClient usage example

from boto3.session import Session


session = Session()

client = session.client("bcm-dashboards")  # (1)
result = client.create_dashboard()  # (2)
  1. client: BillingandCostManagementDashboardsClient
  2. result: CreateDashboardResponseTypeDef

Paginator usage example#

# ListDashboardsPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("bcm-dashboards")  # (1)

paginator = client.get_paginator("list_dashboards")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: BillingandCostManagementDashboardsClient
  2. paginator: ListDashboardsPaginator
  3. item: ListDashboardsResponseTypeDef

Explicit type annotations#

With types-boto3-lite[bcm-dashboards] or a standalone types_boto3_bcm_dashboards package, you have to explicitly specify client: BillingandCostManagementDashboardsClient 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#

# BillingandCostManagementDashboardsClient usage example with type annotations

from boto3.session import Session

from types_boto3_bcm_dashboards.client import BillingandCostManagementDashboardsClient
from types_boto3_bcm_dashboards.type_defs import CreateDashboardResponseTypeDef
from types_boto3_bcm_dashboards.type_defs import CreateDashboardRequestTypeDef


session = Session()

client: BillingandCostManagementDashboardsClient = session.client("bcm-dashboards")

kwargs: CreateDashboardRequestTypeDef = {...}
result: CreateDashboardResponseTypeDef = client.create_dashboard(**kwargs)

Paginator usage example#

# ListDashboardsPaginator usage example with type annotations

from boto3.session import Session

from types_boto3_bcm_dashboards.client import BillingandCostManagementDashboardsClient
from types_boto3_bcm_dashboards.paginator import ListDashboardsPaginator
from types_boto3_bcm_dashboards.type_defs import ListDashboardsResponseTypeDef


session = Session()
client: BillingandCostManagementDashboardsClient = session.client("bcm-dashboards")

paginator: ListDashboardsPaginator = client.get_paginator("list_dashboards")
for item in paginator.paginate(...):
    item: ListDashboardsResponseTypeDef
    print(item)