Type Annotations for Boto3 SsmSap

1.42.13 · active · verified Sat Apr 11

mypy-boto3-ssm-sap provides type annotations for the AWS Boto3 SsmSap (Systems Manager for SAP) service. It allows static type checkers like Mypy and IDEs to provide accurate auto-completion, error detection, and type hints for Boto3 calls related to SsmSap. This library is generated by mypy-boto3-builder and is updated regularly to reflect the latest Boto3 versions, currently at 1.42.13.

Warnings

Install

Imports

Quickstart

This example demonstrates how to get a type-hinted `SsmSapClient` and use a paginator for `list_applications`, leveraging the type annotations provided by `mypy-boto3-ssm-sap`. The `TYPE_CHECKING` block ensures that the code runs without issues even if `mypy-boto3-ssm-sap` is not installed at runtime, while still providing type hints for static analysis.

import boto3
from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from mypy_boto3_ssm_sap.client import SsmSapClient
    from mypy_boto3_ssm_sap.paginator import ListApplicationsPaginator

def get_ssm_sap_client() -> 'SsmSapClient':
    """Returns a type-hinted Boto3 SsmSap client."""
    # Boto3 client is implicitly typed by mypy-boto3-ssm-sap
    return boto3.client("ssm-sap")

def list_all_applications(client: 'SsmSapClient'):
    """Lists all SsmSap applications using a paginator."""
    paginator: 'ListApplicationsPaginator' = client.get_paginator("list_applications")
    for page in paginator.paginate():
        for app in page.get("Applications", []):
            print(f"Application ID: {app.get('ApplicationId')}, Status: {app.get('Status')}")

# Example usage (requires AWS credentials configured for boto3)
if __name__ == "__main__":
    ssm_sap_client = get_ssm_sap_client()
    list_all_applications(ssm_sap_client)

view raw JSON →