Skip to content

Examples#

Index > inspectorscan > Examples

Auto-generated documentation for inspectorscan type annotations stubs module mypy-boto3-inspector-scan.

Client#

Implicit type annotations#

Can be used with boto3-stubs[inspector-scan] package installed.

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

# inspectorscanClient usage example

from boto3.session import Session


session = Session()

client = session.client("inspector-scan")  # (1)
result = client.scan_sbom()  # (2)
  1. client: inspectorscanClient
  2. result: ScanSbomResponseTypeDef

Explicit type annotations#

With boto3-stubs-lite[inspector-scan] or a standalone mypy_boto3_inspector_scan package, you have to explicitly specify client: inspectorscanClient 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.

# inspectorscanClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_inspector_scan.client import inspectorscanClient
from mypy_boto3_inspector_scan.type_defs import ScanSbomResponseTypeDef
from mypy_boto3_inspector_scan.type_defs import ScanSbomRequestRequestTypeDef


session = Session()

client: inspectorscanClient = session.client("inspector-scan")

kwargs: ScanSbomRequestRequestTypeDef = {...}
result: ScanSbomResponseTypeDef = client.scan_sbom(**kwargs)