Examples#
Index > SecurityLake > Examples
Auto-generated documentation for SecurityLake type annotations stubs module types-aiobotocore-securitylake.
Client#
Implicit type annotations#
Can be used with types-aiobotocore[securitylake]
package installed.
Write your SecurityLake
code as usual,
type checking and code completion should work out of the box.
# SecurityLakeClient usage example
from aiobotocore.session import get_session
session = get_session()
async with session.create_client("securitylake") as client: # (1)
result = await client.create_aws_log_source() # (2)
- client: SecurityLakeClient
- result: CreateAwsLogSourceResponseTypeDef
# GetDataLakeSourcesPaginator usage example
from aiobotocore.session import get_session
session = get_session()
async with session.create_client("securitylake") as client: # (1)
paginator = client.get_paginator("get_data_lake_sources") # (2)
async for item in paginator.paginate(...):
print(item) # (3)
- client: SecurityLakeClient
- paginator: GetDataLakeSourcesPaginator
- item: GetDataLakeSourcesResponseTypeDef
Explicit type annotations#
With types-aiobotocore-lite[securitylake]
or a standalone types_aiobotocore_securitylake
package, you have to explicitly specify
client: SecurityLakeClient
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.
# SecurityLakeClient usage example with type annotations
from aiobotocore.session import get_session
from types_aiobotocore_securitylake.client import SecurityLakeClient
from types_aiobotocore_securitylake.type_defs import CreateAwsLogSourceResponseTypeDef
from types_aiobotocore_securitylake.type_defs import CreateAwsLogSourceRequestRequestTypeDef
session = get_session()
async with session.create_client("securitylake") as client:
client: SecurityLakeClient
kwargs: CreateAwsLogSourceRequestRequestTypeDef = {...}
result: CreateAwsLogSourceResponseTypeDef = await client.create_aws_log_source(**kwargs)
# GetDataLakeSourcesPaginator usage example with type annotations
from aiobotocore.session import get_session
from types_aiobotocore_securitylake.client import SecurityLakeClient
from types_aiobotocore_securitylake.paginator import GetDataLakeSourcesPaginator
from types_aiobotocore_securitylake.type_defs import GetDataLakeSourcesResponseTypeDef
session = get_session()
async with session.create_client("securitylake") as client:
client: SecurityLakeClient
paginator: GetDataLakeSourcesPaginator = client.get_paginator("get_data_lake_sources")
async for item in paginator.paginate(...):
item: GetDataLakeSourcesResponseTypeDef
print(item)