Examples#
Index > SSMIncidents > Examples
Auto-generated documentation for SSMIncidents type annotations stubs module mypy-boto3-ssm-incidents.
Client#
Implicit type annotations#
Can be used with boto3-stubs[ssm-incidents]
package installed.
Write your SSMIncidents
code as usual,
type checking and code completion should work out of the box.
# SSMIncidentsClient usage example
from boto3.session import Session
session = Session()
client = session.client("ssm-incidents") # (1)
result = client.batch_get_incident_findings() # (2)
- client: SSMIncidentsClient
- result: BatchGetIncidentFindingsOutputTypeDef
# GetResourcePoliciesPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("ssm-incidents") # (1)
paginator = client.get_paginator("get_resource_policies") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: SSMIncidentsClient
- paginator: GetResourcePoliciesPaginator
- item: GetResourcePoliciesOutputTypeDef
# WaitForReplicationSetActiveWaiter usage example
from boto3.session import Session
session = Session()
client = session.client("ssm-incidents") # (1)
waiter = client.get_waiter("wait_for_replication_set_active") # (2)
waiter.wait()
- client: SSMIncidentsClient
- waiter: WaitForReplicationSetActiveWaiter
Explicit type annotations#
With boto3-stubs-lite[ssm-incidents]
or a standalone mypy_boto3_ssm_incidents
package, you have to explicitly specify client: SSMIncidentsClient
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.
# SSMIncidentsClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_ssm_incidents.client import SSMIncidentsClient
from mypy_boto3_ssm_incidents.type_defs import BatchGetIncidentFindingsOutputTypeDef
from mypy_boto3_ssm_incidents.type_defs import BatchGetIncidentFindingsInputRequestTypeDef
session = Session()
client: SSMIncidentsClient = session.client("ssm-incidents")
kwargs: BatchGetIncidentFindingsInputRequestTypeDef = {...}
result: BatchGetIncidentFindingsOutputTypeDef = client.batch_get_incident_findings(**kwargs)
# GetResourcePoliciesPaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_ssm_incidents.client import SSMIncidentsClient
from mypy_boto3_ssm_incidents.paginator import GetResourcePoliciesPaginator
from mypy_boto3_ssm_incidents.type_defs import GetResourcePoliciesOutputTypeDef
session = Session()
client: SSMIncidentsClient = session.client("ssm-incidents")
paginator: GetResourcePoliciesPaginator = client.get_paginator("get_resource_policies")
for item in paginator.paginate(...):
item: GetResourcePoliciesOutputTypeDef
print(item)
# WaitForReplicationSetActiveWaiter usage example with type annotations
from boto3.session import Session
from mypy_boto3_ssm_incidents.client import SSMIncidentsClient
from mypy_boto3_ssm_incidents.waiter import WaitForReplicationSetActiveWaiter
session = Session()
client: SSMIncidentsClient = session.client("ssm-incidents")
waiter: WaitForReplicationSetActiveWaiter = client.get_waiter("wait_for_replication_set_active")
waiter.wait()