Skip to content

Examples#

Index > ApplicationDiscoveryService > Examples

Auto-generated documentation for ApplicationDiscoveryService type annotations stubs module mypy-boto3-discovery.

Client#

Implicit type annotations#

Can be used with boto3-stubs[discovery] package installed.

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

# ApplicationDiscoveryServiceClient usage example

from boto3.session import Session


session = Session()

client = session.client("discovery")  # (1)
result = client.batch_delete_agents()  # (2)
  1. client: ApplicationDiscoveryServiceClient
  2. result: BatchDeleteAgentsResponseTypeDef
# DescribeAgentsPaginator usage example

from boto3.session import Session


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

paginator = client.get_paginator("describe_agents")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: ApplicationDiscoveryServiceClient
  2. paginator: DescribeAgentsPaginator
  3. item: DescribeAgentsResponseTypeDef

Explicit type annotations#

With boto3-stubs-lite[discovery] or a standalone mypy_boto3_discovery package, you have to explicitly specify client: ApplicationDiscoveryServiceClient 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.

# ApplicationDiscoveryServiceClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_discovery.client import ApplicationDiscoveryServiceClient
from mypy_boto3_discovery.type_defs import BatchDeleteAgentsResponseTypeDef
from mypy_boto3_discovery.type_defs import BatchDeleteAgentsRequestRequestTypeDef


session = Session()

client: ApplicationDiscoveryServiceClient = session.client("discovery")

kwargs: BatchDeleteAgentsRequestRequestTypeDef = {...}
result: BatchDeleteAgentsResponseTypeDef = client.batch_delete_agents(**kwargs)
# DescribeAgentsPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_discovery.client import ApplicationDiscoveryServiceClient
from mypy_boto3_discovery.paginator import DescribeAgentsPaginator
from mypy_boto3_discovery.type_defs import DescribeAgentsResponseTypeDef


session = Session()
client: ApplicationDiscoveryServiceClient = session.client("discovery")

paginator: DescribeAgentsPaginator = client.get_paginator("describe_agents")
for item in paginator.paginate(...):
    item: DescribeAgentsResponseTypeDef
    print(item)