mypy-boto3-appintegrations
mypy-boto3-appintegrations provides comprehensive type annotations for the AWS AppIntegrations Service, designed for use with the `boto3` library. It ensures strong static type checking for AppIntegrations client and related operations. The current version is 1.42.63, with updates released frequently in sync with `boto3` and AWS API changes, driven by the `mypy-boto3-builder` project.
Warnings
- breaking Python 3.8 is no longer supported for any `mypy-boto3` stub packages, including `mypy-boto3-appintegrations`, starting with `mypy-boto3-builder` version 8.12.0.
- breaking TypeDef naming conventions changed in `mypy-boto3-builder` 8.9.0. Names like `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`, and `Extra` postfixes were re-ordered. This may cause type checker errors if you import specific `TypedDict` names.
- gotcha The `mypy-boto3-appintegrations` package provides type hints for `boto3` but is not a runtime library itself. Do not attempt to import it directly for runtime execution or instantiate objects from it.
- gotcha For optimal type checking, ensure that the version of `mypy-boto3-appintegrations` aligns with the major.minor version of your installed `boto3` library. Mismatched versions can lead to incorrect type hints or missing definitions.
Install
-
pip install mypy-boto3-appintegrations
Imports
- AppIntegrationsClient
from mypy_boto3_appintegrations.client import AppIntegrationsClient
- ListApplicationsResponseTypeDef
from mypy_boto3_appintegrations.type_defs import ListApplicationsResponseTypeDef
- mypy_boto3_appintegrations
import boto3; from typing import TYPE_CHECKING; if TYPE_CHECKING: import mypy_boto3_appintegrations
Quickstart
import boto3
import os
from typing import TYPE_CHECKING
# These imports are only for type checking, not for runtime execution
if TYPE_CHECKING:
from mypy_boto3_appintegrations.client import AppIntegrationsClient
from mypy_boto3_appintegrations.type_defs import ListApplicationsResponseTypeDef
def list_app_integrations_applications(
client: 'AppIntegrationsClient'
) -> 'ListApplicationsResponseTypeDef':
"""Lists existing Amazon AppIntegrations applications."""
response = client.list_applications()
return response
# Initialize boto3 client (runtime code)
region = os.environ.get('AWS_REGION_NAME', 'us-east-1')
appintegrations_client: 'AppIntegrationsClient' = boto3.client(
"appintegrations",
region_name=region
)
# Call the function with type-hinted client
try:
applications_data = list_app_integrations_applications(appintegrations_client)
print(f"Successfully listed applications in region {region}.")
for app in applications_data.get('Applications', []):
print(f" - Application ARN: {app.get('ApplicationArn')}")
if applications_data.get('NextToken'):
print(f" (More applications available. Next Token: {applications_data['NextToken']})")
except Exception as e:
print(f"Error listing applications: {e}")