Skip to content

Examples#

Index > ApplicationInsights > Examples

Auto-generated documentation for ApplicationInsights type annotations stubs module types-boto3-application-insights.

Client#

Implicit type annotations#

Can be used with types-boto3[application-insights] package installed.

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

# ApplicationInsightsClient usage example

from boto3.session import Session


session = Session()

client = session.client("application-insights")  # (1)
result = client.add_workload()  # (2)
  1. client: ApplicationInsightsClient
  2. result: AddWorkloadResponseTypeDef

Explicit type annotations#

With types-boto3-lite[application-insights] or a standalone types_boto3_application_insights package, you have to explicitly specify client: ApplicationInsightsClient 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.

# ApplicationInsightsClient usage example with type annotations

from boto3.session import Session

from types_boto3_application_insights.client import ApplicationInsightsClient
from types_boto3_application_insights.type_defs import AddWorkloadResponseTypeDef
from types_boto3_application_insights.type_defs import AddWorkloadRequestRequestTypeDef


session = Session()

client: ApplicationInsightsClient = session.client("application-insights")

kwargs: AddWorkloadRequestRequestTypeDef = {...}
result: AddWorkloadResponseTypeDef = client.add_workload(**kwargs)