{"id":3376,"library":"mypy-boto3-ssm-incidents","title":"Type Annotations for boto3 SSM Incidents","description":"mypy-boto3-ssm-incidents provides official type annotations (stubs) for the boto3 AWS SSM Incidents service client. It allows users to leverage static type checking with tools like MyPy, improving code quality and catching errors early. This library is automatically generated by the `mypy-boto3-builder` and its version typically aligns with the corresponding `boto3` service version. The current version is 1.42.3, reflecting the boto3 API version, and updates frequently alongside new boto3 releases.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hints","ssm-incidents","type-stubs"],"install":[{"cmd":"pip install mypy-boto3-ssm-incidents boto3","lang":"bash","label":"Install with boto3"}],"dependencies":[{"reason":"This package provides type stubs for boto3. boto3 itself must be installed to run the code.","package":"boto3"},{"reason":"mypy is required to perform static type checking on your code using these stubs.","package":"mypy","optional":true}],"imports":[{"symbol":"SSMIncidentsClient","correct":"from mypy_boto3_ssm_incidents import SSMIncidentsClient"},{"symbol":"GetIncidentRecordOutputTypeDef","correct":"from mypy_boto3_ssm_incidents.type_defs import GetIncidentRecordOutputTypeDef"}],"quickstart":{"code":"import os\nimport boto3\nfrom typing import TYPE_CHECKING\n\n# These imports are only for type checking purposes.\n# They are ignored at runtime if TYPE_CHECKING is False.\nif TYPE_CHECKING:\n    from mypy_boto3_ssm_incidents import SSMIncidentsClient\n    from mypy_boto3_ssm_incidents.type_defs import GetIncidentRecordOutputTypeDef\n\n# Initialize the boto3 client at runtime\n# Ensure AWS credentials are configured (e.g., via environment variables or ~/.aws/credentials)\nclient: 'SSMIncidentsClient' = boto3.client(\n    \"ssm-incidents\",\n    region_name=os.environ.get(\"AWS_REGION\", \"us-east-1\")\n)\n\n# Example API call with type hints\ntry:\n    # Use a dummy ARN for demonstration; replace with a valid one if you have it\n    incident_arn = \"arn:aws:ssm-incidents::123456789012:incident-record/example-incident\"\n    \n    response: 'GetIncidentRecordOutputTypeDef' = client.get_incident_record(\n        incidentRecordArn=incident_arn\n    )\n    print(f\"Incident found: {response['incidentRecord']['title']}\")\nexcept client.exceptions.ResourceNotFoundException:\n    print(f\"Incident record '{incident_arn}' not found (as expected for example ARN).\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n\nprint(\"Type checking setup successful!\")","lang":"python","description":"This quickstart demonstrates how to use `mypy-boto3-ssm-incidents` for type-hinting a boto3 SSM Incidents client. It shows the use of `TYPE_CHECKING` to guard stub imports and provides an example API call with inferred types."},"warnings":[{"fix":"Upgrade your Python environment to version 3.9 or newer.","message":"Python 3.8 is no longer supported by `mypy-boto3-builder` and consequently by `mypy-boto3` packages generated with it.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0 (and generated `mypy-boto3` packages like `mypy-boto3-ssm-incidents` >= 1.42.3)"},{"fix":"Ensure your `mypy` configuration is up-to-date and compatible with PEP 561 packages. Update MyPy if necessary.","message":"`mypy-boto3` packages migrated to PEP 561. This change affects how MyPy locates and uses the stubs.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0 (and generated `mypy-boto3` packages)"},{"fix":"Wrap all `mypy-boto3` specific imports within `if TYPE_CHECKING: ...` to prevent runtime import errors if the stub package is not installed as a direct runtime dependency.","message":"Type stub imports (`from mypy_boto3_ssm_incidents import ...`) should always be wrapped in an `if TYPE_CHECKING:` block.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always ensure `boto3` is included in your project's runtime dependencies (`pip install boto3`).","message":"`mypy-boto3-ssm-incidents` provides *only* type annotations. The actual `boto3` library must be installed separately for your code to run.","severity":"gotcha","affected_versions":"All versions"},{"fix":"When upgrading `mypy-boto3` packages across major builder versions, review your code for explicit `from ...type_defs import ...` imports and adjust TypeDef names if they no longer match the generated stubs.","message":"TypeDef naming conventions changed in earlier `mypy-boto3-builder` versions, impacting how some specific TypeDefs are named (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`).","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0 (and generated `mypy-boto3` packages)"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}