Examples
Auto-generated documentation for RDS type annotations stubs module types-aiobotocore-rds.
Client
Implicit type annotations
Can be used with types-aioboto3[rds]
package installed.
Write your RDS
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("rds") as client: # (1)
result = await client.add_role_to_db_cluster() # (2)
- client: RDSClient
- result: EmptyResponseMetadataTypeDef
Paginator usage example
from aioboto3.session import Session
session = Session()
async with session.client("rds") as client: # (1)
paginator = client.get_paginator("describe_certificates") # (2)
async for item in paginator.paginate(...):
print(item) # (3)
- client: RDSClient
- paginator: DescribeCertificatesPaginator
- item: CertificateMessageTypeDef
Waiter usage example
from aioboto3.session import Session
session = Session()
async with session.client("rds") as client: # (1)
waiter = client.get_waiter("db_cluster_available") # (2)
await waiter.wait()
- client: RDSClient
- waiter: DBClusterAvailableWaiter
Explicit type annotations
With types-aioboto3-lite[rds]
or a standalone types_aiobotocore_rds
package, you have to explicitly specify
client: RDSClient
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_rds.client import RDSClient
from types_aiobotocore_rds.type_defs import EmptyResponseMetadataTypeDef
from types_aiobotocore_rds.type_defs import AddRoleToDBClusterMessageRequestTypeDef
session = Session()
client: RDSClient
async with session.client("rds") as client: # (1)
kwargs: AddRoleToDBClusterMessageRequestTypeDef = {...} # (2)
result: EmptyResponseMetadataTypeDef = await client.add_role_to_db_cluster(**kwargs) # (3)
- client: RDSClient
- kwargs: AddRoleToDBClusterMessageRequestTypeDef
- result: EmptyResponseMetadataTypeDef
Paginator usage example
from aioboto3.session import Session
from types_aiobotocore_rds.client import RDSClient
from types_aiobotocore_rds.paginator import DescribeCertificatesPaginator
from types_aiobotocore_rds.type_defs import CertificateMessageTypeDef
session = Session()
client: RDSClient
async with session.client("rds") as client: # (1)
paginator: DescribeCertificatesPaginator = client.get_paginator("describe_certificates") # (2)
async for item in paginator.paginate(...):
item: CertificateMessageTypeDef
print(item) # (3)
- client: RDSClient
- paginator: DescribeCertificatesPaginator
- item: CertificateMessageTypeDef
Waiter usage example
from aioboto3.session import Session
from types_aiobotocore_rds.client import RDSClient
from types_aiobotocore_rds.waiter import DBClusterAvailableWaiter
session = Session()
async with session.client("rds") as client: # (1)
waiter = client.get_waiter("db_cluster_available") # (2)
await waiter.wait()
- client: RDSClient
- waiter: DBClusterAvailableWaiter