Examples#
Index > SecurityAgent > Examples
Auto-generated documentation for SecurityAgent type annotations stubs module mypy-boto3-securityagent.
Client#
Implicit type annotations#
Can be used with boto3-stubs[securityagent] package installed.
Write your SecurityAgent code as usual,
type checking and code completion should work out of the box.
Client method usage example#
# SecurityAgentClient usage example
from boto3.session import Session
session = Session()
client = session.client("securityagent") # (1)
result = client.add_artifact() # (2)
- client: SecurityAgentClient
- result: AddArtifactOutputTypeDef
Paginator usage example#
# ListAgentSpacesPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("securityagent") # (1)
paginator = client.get_paginator("list_agent_spaces") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: SecurityAgentClient
- paginator: ListAgentSpacesPaginator
- item: ListAgentSpacesOutputTypeDef
Explicit type annotations#
With boto3-stubs-lite[securityagent]
or a standalone mypy_boto3_securityagent package, you have to explicitly specify client: SecurityAgentClient 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.
Client method usage example#
# SecurityAgentClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_securityagent.client import SecurityAgentClient
from mypy_boto3_securityagent.type_defs import AddArtifactOutputTypeDef
from mypy_boto3_securityagent.type_defs import AddArtifactInputTypeDef
session = Session()
client: SecurityAgentClient = session.client("securityagent")
kwargs: AddArtifactInputTypeDef = {...}
result: AddArtifactOutputTypeDef = client.add_artifact(**kwargs)
Paginator usage example#
# ListAgentSpacesPaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_securityagent.client import SecurityAgentClient
from mypy_boto3_securityagent.paginator import ListAgentSpacesPaginator
from mypy_boto3_securityagent.type_defs import ListAgentSpacesOutputTypeDef
session = Session()
client: SecurityAgentClient = session.client("securityagent")
paginator: ListAgentSpacesPaginator = client.get_paginator("list_agent_spaces")
for item in paginator.paginate(...):
item: ListAgentSpacesOutputTypeDef
print(item)