Examples
Index > ConfigService > Examples
Auto-generated documentation for ConfigService type annotations stubs module types-aiobotocore-config.
Client
Implicit type annotations
Can be used with types-aioboto3[config]
package installed.
Write your ConfigService
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("config") as client: # (1)
result = await client.batch_get_aggregate_resource_config() # (2)
- client: ConfigServiceClient
- result: BatchGetAggregateResourceConfigResponseTypeDef
Explicit type annotations
With types-aioboto3-lite[config]
or a standalone types_aiobotocore_config
package, you have to explicitly specify
client: ConfigServiceClient
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_config.client import ConfigServiceClient
from types_aiobotocore_config.type_defs import BatchGetAggregateResourceConfigResponseTypeDef
from types_aiobotocore_config.type_defs import BatchGetAggregateResourceConfigRequestRequestTypeDef
session = Session()
client: ConfigServiceClient
async with session.client("config") as client: # (1)
kwargs: BatchGetAggregateResourceConfigRequestRequestTypeDef = {...} # (2)
result: BatchGetAggregateResourceConfigResponseTypeDef = await client.batch_get_aggregate_resource_config(**kwargs) # (3)
Paginator usage example
from aioboto3.session import Session
from types_aiobotocore_config.client import ConfigServiceClient
from types_aiobotocore_config.paginator import DescribeAggregateComplianceByConfigRulesPaginator
from types_aiobotocore_config.type_defs import DescribeAggregateComplianceByConfigRulesResponseTypeDef
session = Session()
client: ConfigServiceClient
async with session.client("config") as client: # (1)
paginator: DescribeAggregateComplianceByConfigRulesPaginator = client.get_paginator("describe_aggregate_compliance_by_config_rules") # (2)
async for item in paginator.paginate(...):
item: DescribeAggregateComplianceByConfigRulesResponseTypeDef
print(item) # (3)