Skip to content

Examples#

Index > SecurityLake > Examples

Auto-generated documentation for SecurityLake type annotations stubs module types-boto3-securitylake.

Client#

Implicit type annotations#

Can be used with types-boto3[securitylake] package installed.

Write your SecurityLake code as usual, type checking and code completion should work out of the box.

# SecurityLakeClient usage example

from boto3.session import Session


session = Session()

client = session.client("securitylake")  # (1)
result = client.create_aws_log_source()  # (2)
  1. client: SecurityLakeClient
  2. result: CreateAwsLogSourceResponseTypeDef
# GetDataLakeSourcesPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("securitylake")  # (1)

paginator = client.get_paginator("get_data_lake_sources")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: SecurityLakeClient
  2. paginator: GetDataLakeSourcesPaginator
  3. item: GetDataLakeSourcesResponseTypeDef

Explicit type annotations#

With types-boto3-lite[securitylake] or a standalone types_boto3_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 boto3.session import Session

from types_boto3_securitylake.client import SecurityLakeClient
from types_boto3_securitylake.type_defs import CreateAwsLogSourceResponseTypeDef
from types_boto3_securitylake.type_defs import CreateAwsLogSourceRequestRequestTypeDef


session = Session()

client: SecurityLakeClient = session.client("securitylake")

kwargs: CreateAwsLogSourceRequestRequestTypeDef = {...}
result: CreateAwsLogSourceResponseTypeDef = client.create_aws_log_source(**kwargs)
# GetDataLakeSourcesPaginator usage example with type annotations

from boto3.session import Session

from types_boto3_securitylake.client import SecurityLakeClient
from types_boto3_securitylake.paginator import GetDataLakeSourcesPaginator
from types_boto3_securitylake.type_defs import GetDataLakeSourcesResponseTypeDef


session = Session()
client: SecurityLakeClient = session.client("securitylake")

paginator: GetDataLakeSourcesPaginator = client.get_paginator("get_data_lake_sources")
for item in paginator.paginate(...):
    item: GetDataLakeSourcesResponseTypeDef
    print(item)