mypy-boto3-pca-connector-scep Type Annotations

1.42.53 · active · verified Sat Apr 11

This library provides comprehensive type annotations for the `boto3 PrivateCAConnectorforSCEP` service, ensuring compatibility with popular IDEs (VSCode, PyCharm) and type checkers (mypy, pyright). It is automatically generated by the `mypy-boto3-builder` project, with version 1.42.53 currently supporting boto3's corresponding service version. The package is frequently updated to align with `boto3` and `botocore` releases, offering up-to-date type definitions for clients, paginators, literals, and TypeDefs.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to import and use the type-hinted `PrivateCAConnectorforSCEPClient` from `mypy-boto3-pca-connector-scep` with `boto3`. It includes conditional imports for `TYPE_CHECKING` to ensure the stubs are only used during type checking, avoiding runtime dependencies.

from typing import TYPE_CHECKING
import boto3
from boto3.session import Session

if TYPE_CHECKING:
    from mypy_boto3_pca_connector_scep.client import PrivateCAConnectorforSCEPClient

def get_pca_scep_client() -> PrivateCAConnectorforSCEPClient:
    """Initializes and returns a type-hinted AWS Private CA Connector for SCEP client."""
    session = Session(region_name="us-east-1")
    # In some IDEs or older configurations, explicit type annotation might be helpful:
    # client: PrivateCAConnectorforSCEPClient = session.client("pca-connector-scep")
    client = session.client("pca-connector-scep")
    return client

if __name__ == "__main__":
    client = get_pca_scep_client()
    try:
        # Example usage (replace with actual API call)
        response = client.list_connectors()
        print(f"Successfully listed {len(response.get('Connectors', []))} connectors.")
    except client.exceptions.ResourceNotFoundException as e:
        print(f"Resource not found: {e}")
    except Exception as e:
        print(f"An error occurred: {e}")

view raw JSON →