Skip to content

Examples

Index > FMS > Examples

Auto-generated documentation for FMS type annotations stubs module mypy-boto3-fms.

Client

Implicit type annotations

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

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

Client usage example
from boto3.session import Session


session = Session()

client = session.client("fms")  # (1)
result = client.associate_admin_account()  # (2)
  1. client: FMSClient
  2. result: EmptyResponseMetadataTypeDef
Paginator usage example
from boto3.session import Session


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

paginator = client.get_paginator("list_apps_lists")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: FMSClient
  2. paginator: ListAppsListsPaginator
  3. item: ListAppsListsResponseTypeDef

Explicit type annotations

With boto3-stubs-lite[fms] or a standalone mypy_boto3_fms package, you have to explicitly specify client: FMSClient 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 usage example
from boto3.session import Session

from mypy_boto3_fms.client import FMSClient
from mypy_boto3_fms.type_defs import EmptyResponseMetadataTypeDef
from mypy_boto3_fms.type_defs import AssociateAdminAccountRequestRequestTypeDef


session = Session()

client: FMSClient = session.client("fms")

kwargs: AssociateAdminAccountRequestRequestTypeDef = {...}
result: EmptyResponseMetadataTypeDef = client.associate_admin_account(**kwargs)
Paginator usage example
from boto3.session import Session

from mypy_boto3_fms.client import FMSClient
from mypy_boto3_fms.paginator import ListAppsListsPaginator
from mypy_boto3_fms.type_defs import ListAppsListsResponseTypeDef


session = Session()
client: FMSClient = session.client("fms")

paginator: ListAppsListsPaginator = client.get_paginator("list_apps_lists")
for item in paginator.paginate(...):
    item: ListAppsListsResponseTypeDef
    print(item)