Skip to content

Examples

Index > SecurityLake > Examples

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

Client

Implicit type annotations

Can be used with boto3-stubs[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
# GetDatalakeStatusPaginator usage example

from boto3.session import Session


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

paginator = client.get_paginator("get_datalake_status")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: SecurityLakeClient
  2. paginator: GetDatalakeStatusPaginator
  3. item: GetDatalakeStatusResponseTypeDef

Explicit type annotations

With boto3-stubs-lite[securitylake] or a standalone mypy_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 mypy_boto3_securitylake.client import SecurityLakeClient
from mypy_boto3_securitylake.type_defs import CreateAwsLogSourceResponseTypeDef
from mypy_boto3_securitylake.type_defs import CreateAwsLogSourceRequestRequestTypeDef


session = Session()

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

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

from boto3.session import Session

from mypy_boto3_securitylake.client import SecurityLakeClient
from mypy_boto3_securitylake.paginator import GetDatalakeStatusPaginator
from mypy_boto3_securitylake.type_defs import GetDatalakeStatusResponseTypeDef


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

paginator: GetDatalakeStatusPaginator = client.get_paginator("get_datalake_status")
for item in paginator.paginate(...):
    item: GetDatalakeStatusResponseTypeDef
    print(item)