Examples
Auto-generated documentation for EFS type annotations stubs module types-aiobotocore-efs.
Client
Implicit type annotations
Can be used with types-aioboto3[efs]
package installed.
Write your EFS
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("efs") as client: # (1)
result = await client.create_access_point() # (2)
- client: EFSClient
- result: AccessPointDescriptionResponseMetadataTypeDef
Paginator usage example
from aioboto3.session import Session
session = Session()
async with session.client("efs") as client: # (1)
paginator = client.get_paginator("describe_file_systems") # (2)
async for item in paginator.paginate(...):
print(item) # (3)
- client: EFSClient
- paginator: DescribeFileSystemsPaginator
- item: DescribeFileSystemsResponseTypeDef
Explicit type annotations
With types-aioboto3-lite[efs]
or a standalone types_aiobotocore_efs
package, you have to explicitly specify
client: EFSClient
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_efs.client import EFSClient
from types_aiobotocore_efs.type_defs import AccessPointDescriptionResponseMetadataTypeDef
from types_aiobotocore_efs.type_defs import CreateAccessPointRequestRequestTypeDef
session = Session()
client: EFSClient
async with session.client("efs") as client: # (1)
kwargs: CreateAccessPointRequestRequestTypeDef = {...} # (2)
result: AccessPointDescriptionResponseMetadataTypeDef = await client.create_access_point(**kwargs) # (3)
- client: EFSClient
- kwargs: CreateAccessPointRequestRequestTypeDef
- result: AccessPointDescriptionResponseMetadataTypeDef
Paginator usage example
from aioboto3.session import Session
from types_aiobotocore_efs.client import EFSClient
from types_aiobotocore_efs.paginator import DescribeFileSystemsPaginator
from types_aiobotocore_efs.type_defs import DescribeFileSystemsResponseTypeDef
session = Session()
client: EFSClient
async with session.client("efs") as client: # (1)
paginator: DescribeFileSystemsPaginator = client.get_paginator("describe_file_systems") # (2)
async for item in paginator.paginate(...):
item: DescribeFileSystemsResponseTypeDef
print(item) # (3)
- client: EFSClient
- paginator: DescribeFileSystemsPaginator
- item: DescribeFileSystemsResponseTypeDef