Skip to content

Examples#

Index > CloudWatchObservabilityAdminService > Examples

Auto-generated documentation for CloudWatchObservabilityAdminService type annotations stubs module types-boto3-observabilityadmin.

Client#

Implicit type annotations#

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

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

# CloudWatchObservabilityAdminServiceClient usage example

from boto3.session import Session


session = Session()

client = session.client("observabilityadmin")  # (1)
result = client.list_resource_telemetry()  # (2)
  1. client: CloudWatchObservabilityAdminServiceClient
  2. result: ListResourceTelemetryOutputTypeDef
# ListResourceTelemetryForOrganizationPaginator usage example

from boto3.session import Session


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

paginator = client.get_paginator("list_resource_telemetry_for_organization")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: CloudWatchObservabilityAdminServiceClient
  2. paginator: ListResourceTelemetryForOrganizationPaginator
  3. item: ListResourceTelemetryForOrganizationOutputTypeDef

Explicit type annotations#

With types-boto3-lite[observabilityadmin] or a standalone types_boto3_observabilityadmin package, you have to explicitly specify client: CloudWatchObservabilityAdminServiceClient 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.

# CloudWatchObservabilityAdminServiceClient usage example with type annotations

from boto3.session import Session

from types_boto3_observabilityadmin.client import CloudWatchObservabilityAdminServiceClient
from types_boto3_observabilityadmin.type_defs import ListResourceTelemetryOutputTypeDef
from types_boto3_observabilityadmin.type_defs import ListResourceTelemetryInputRequestTypeDef


session = Session()

client: CloudWatchObservabilityAdminServiceClient = session.client("observabilityadmin")

kwargs: ListResourceTelemetryInputRequestTypeDef = {...}
result: ListResourceTelemetryOutputTypeDef = client.list_resource_telemetry(**kwargs)
# ListResourceTelemetryForOrganizationPaginator usage example with type annotations

from boto3.session import Session

from types_boto3_observabilityadmin.client import CloudWatchObservabilityAdminServiceClient
from types_boto3_observabilityadmin.paginator import ListResourceTelemetryForOrganizationPaginator
from types_boto3_observabilityadmin.type_defs import ListResourceTelemetryForOrganizationOutputTypeDef


session = Session()
client: CloudWatchObservabilityAdminServiceClient = session.client("observabilityadmin")

paginator: ListResourceTelemetryForOrganizationPaginator = client.get_paginator("list_resource_telemetry_for_organization")
for item in paginator.paginate(...):
    item: ListResourceTelemetryForOrganizationOutputTypeDef
    print(item)