Skip to content

Examples

Index > ApplicationInsights > Examples

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

Client

Implicit type annotations

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

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

Client usage example
from aioboto3.session import Session


session = Session()

async with session.client("application-insights") as client:  # (1)
    result = await client.create_application()  # (2)
  1. client: ApplicationInsightsClient
  2. result: CreateApplicationResponseTypeDef

Explicit type annotations

With types-aioboto3-lite[application-insights] or a standalone types_aiobotocore_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.

Client usage example
from aioboto3.session import Session

from types_aiobotocore_application_insights.client import ApplicationInsightsClient
from types_aiobotocore_application_insights.type_defs import CreateApplicationResponseTypeDef
from types_aiobotocore_application_insights.type_defs import CreateApplicationRequestRequestTypeDef


session = Session()

client: ApplicationInsightsClient
async with session.client("application-insights") as client:  # (1)
    kwargs: CreateApplicationRequestRequestTypeDef = {...}  # (2)
    result: CreateApplicationResponseTypeDef = await client.create_application(**kwargs)  # (3)
  1. client: ApplicationInsightsClient
  2. kwargs: CreateApplicationRequestRequestTypeDef
  3. result: CreateApplicationResponseTypeDef