mypy-boto3-connectcases
mypy-boto3-connectcases provides comprehensive type annotations for the `boto3` AWS ConnectCases service, ensuring type safety and improved developer experience when working with AWS SDK for Python. It is generated by `mypy-boto3-builder` and currently stands at version 1.42.74, with a frequent release cadence tied to upstream `boto3` updates and `mypy-boto3-builder` enhancements.
Warnings
- breaking Python 3.8 support has been removed across all `mypy-boto3-*` packages, including `mypy-boto3-connectcases`.
- breaking All `mypy-boto3-*` packages have migrated to PEP 561, potentially affecting how type checkers discover packages if custom `mypy` configurations were relying on older mechanisms.
- gotcha This package provides *only* type stubs. It does not contain any runtime code or functionality. Always use `import boto3` for actual AWS SDK operations.
- breaking TypeDef names have undergone changes in recent versions (e.g., `CreateDistributionRequestRequestTypeDef` to `CreateDistributionRequestTypeDef`), which can break code explicitly importing and using these `TypedDict` definitions.
- gotcha AWS service names used in `boto3.client()` calls are case-sensitive and may change or be deprecated (e.g., `sms-voice` was replaced by `pinpoint-sms-voice`). Ensure you use the correct, current service name string.
Install
-
pip install mypy-boto3-connectcases -
pip install boto3
Imports
- ConnectCasesClient
from mypy_boto3_connectcases.client import ConnectCasesClient
- ListDomainsResponseTypeDef
from mypy_boto3_connectcases.type_defs import ListDomainsResponseTypeDef
- boto3
import boto3
Quickstart
import boto3
from typing import TYPE_CHECKING
# These imports are only for type checking, they won't be used at runtime
if TYPE_CHECKING:
from mypy_boto3_connectcases.client import ConnectCasesClient
from mypy_boto3_connectcases.type_defs import ListDomainsResponseTypeDef
def get_connect_cases_domains() -> 'ListDomainsResponseTypeDef':
# boto3 client creation is type-hinted by mypy-boto3-connectcases
client: ConnectCasesClient = boto3.client("connectcases")
# Example operation with type-hinted methods and response
response = client.list_domains()
print("Connect Cases Domains found:")
for domain in response.get("domains", []):
print(f"- Domain ARN: {domain.get('domainArn')}, Domain ID: {domain.get('domainId')}")
return response
if __name__ == "__main__":
try:
# Ensure AWS credentials are configured (e.g., via ~/.aws/credentials or env vars)
result = get_connect_cases_domains()
except Exception as e:
print(f"Error interacting with AWS Connect Cases: {e}")
print("Please ensure AWS credentials are set up and the 'connectcases' service is available in your region.")