Skip to content

Examples#

Index > CodeGuruProfiler > Examples

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

Client#

Implicit type annotations#

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

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

# CodeGuruProfilerClient usage example

from boto3.session import Session


session = Session()

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

from boto3.session import Session


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

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

Explicit type annotations#

With types-boto3-lite[codeguruprofiler] or a standalone types_boto3_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 boto3.session import Session

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


session = Session()

client: CodeGuruProfilerClient = session.client("codeguruprofiler")

kwargs: AddNotificationChannelsRequestRequestTypeDef = {...}
result: AddNotificationChannelsResponseTypeDef = client.add_notification_channels(**kwargs)
# ListProfileTimesPaginator usage example with type annotations

from boto3.session import Session

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


session = Session()
client: CodeGuruProfilerClient = session.client("codeguruprofiler")

paginator: ListProfileTimesPaginator = client.get_paginator("list_profile_times")
for item in paginator.paginate(...):
    item: ListProfileTimesResponseTypeDef
    print(item)