Skip to content

Examples#

Index > CodeGuruProfiler > Examples

Auto-generated documentation for CodeGuruProfiler type annotations stubs module types-aiobotocore-codeguruprofiler.

Client#

Implicit type annotations#

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

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

# CodeGuruProfilerClient usage example

from aioboto3.session import Session


session = Session()

async with session.client("codeguruprofiler") as client:  # (1)
    result = await client.add_notification_channels()  # (2)
  1. client: CodeGuruProfilerClient
  2. result: AddNotificationChannelsResponseTypeDef
# ListProfileTimesPaginator usage example

from aioboto3.session import Session


session = Session()

async with session.client("codeguruprofiler") as client:  # (1)
    paginator = client.get_paginator("list_profile_times")  # (2)
    async for item in paginator.paginate(...):
        print(item)  # (3)
  1. client: CodeGuruProfilerClient
  2. paginator: ListProfileTimesPaginator
  3. item: ListProfileTimesResponseTypeDef

Explicit type annotations#

With types-aioboto3-lite[codeguruprofiler] or a standalone types_aiobotocore_codeguruprofiler package, you have to explicitly specify client: CodeGuruProfilerClient 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.

# CodeGuruProfilerClient usage example with type annotations

from aioboto3.session import Session

from types_aiobotocore_codeguruprofiler.client import CodeGuruProfilerClient
from types_aiobotocore_codeguruprofiler.type_defs import AddNotificationChannelsResponseTypeDef
from types_aiobotocore_codeguruprofiler.type_defs import AddNotificationChannelsRequestRequestTypeDef


session = Session()

client: CodeGuruProfilerClient
async with session.client("codeguruprofiler") as client:  # (1)
    kwargs: AddNotificationChannelsRequestRequestTypeDef = {...}  # (2)
    result: AddNotificationChannelsResponseTypeDef = await client.add_notification_channels(**kwargs)  # (3)
  1. client: CodeGuruProfilerClient
  2. kwargs: AddNotificationChannelsRequestRequestTypeDef
  3. result: AddNotificationChannelsResponseTypeDef
# ListProfileTimesPaginator usage example with type annotations

from aioboto3.session import Session

from types_aiobotocore_codeguruprofiler.client import CodeGuruProfilerClient
from types_aiobotocore_codeguruprofiler.paginator import ListProfileTimesPaginator
from types_aiobotocore_codeguruprofiler.type_defs import ListProfileTimesResponseTypeDef


session = Session()

client: CodeGuruProfilerClient
async with session.client("codeguruprofiler") as client:  # (1)
    paginator: ListProfileTimesPaginator = client.get_paginator("list_profile_times")  # (2)
    async for item in paginator.paginate(...):
        item: ListProfileTimesResponseTypeDef
        print(item)  # (3)
  1. client: CodeGuruProfilerClient
  2. paginator: ListProfileTimesPaginator
  3. item: ListProfileTimesResponseTypeDef