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