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-aioboto3[securitylake]
package installed.
Write your SecurityLake
code as usual,
type checking and code completion should work out of the box.
# SecurityLakeClient usage example
from aioboto3.session import Session
session = Session()
async with session.client("securitylake") as client: # (1)
result = await client.create_aws_log_source() # (2)
- client: SecurityLakeClient
- result: CreateAwsLogSourceResponseTypeDef
# GetDataLakeSourcesPaginator usage example
from aioboto3.session import Session
session = Session()
async with session.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-aioboto3-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 aioboto3.session import 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 = Session()
client: SecurityLakeClient
async with session.client("securitylake") as client: # (1)
kwargs: CreateAwsLogSourceRequestRequestTypeDef = {...} # (2)
result: CreateAwsLogSourceResponseTypeDef = await client.create_aws_log_source(**kwargs) # (3)
- client: SecurityLakeClient
- kwargs: CreateAwsLogSourceRequestRequestTypeDef
- result: CreateAwsLogSourceResponseTypeDef
# GetDataLakeSourcesPaginator usage example with type annotations
from aioboto3.session import Session
from types_aiobotocore_securitylake.client import SecurityLakeClient
from types_aiobotocore_securitylake.paginator import GetDataLakeSourcesPaginator
from types_aiobotocore_securitylake.type_defs import GetDataLakeSourcesResponseTypeDef
session = Session()
client: SecurityLakeClient
async with session.client("securitylake") as client: # (1)
paginator: GetDataLakeSourcesPaginator = client.get_paginator("get_data_lake_sources") # (2)
async for item in paginator.paginate(...):
item: GetDataLakeSourcesResponseTypeDef
print(item) # (3)
- client: SecurityLakeClient
- paginator: GetDataLakeSourcesPaginator
- item: GetDataLakeSourcesResponseTypeDef