{"id":3057,"library":"mypy-boto3-codestar-notifications","title":"mypy-boto3-codestar-notifications Type Stubs","description":"mypy-boto3-codestar-notifications provides comprehensive type annotations for the `boto3` client for AWS CodeStar Notifications service. It helps developers leverage static analysis tools like Mypy to catch type-related errors in their AWS SDK code. The library's current version is 1.42.3, and it is released frequently, tracking updates to `boto3` and the `mypy-boto3-builder`.","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","stubs","codestar-notifications","type-checking"],"install":[{"cmd":"pip install boto3 mypy-boto3-codestar-notifications","lang":"bash","label":"Install `boto3` and type stubs"}],"dependencies":[{"reason":"Provides the runtime functionality that these stubs type-check.","package":"boto3","optional":false}],"imports":[{"note":"The `boto3` library itself does not provide granular type hints for its clients directly; `mypy-boto3-*` packages provide these.","wrong":"from boto3.client import CodeStarNotificationsClient","symbol":"CodeStarNotificationsClient","correct":"from mypy_boto3_codestar_notifications import CodeStarNotificationsClient"},{"note":"TypeDefs for input/output shapes are provided by the `mypy-boto3-*` stub package, not directly by `boto3`.","wrong":"from boto3.codestarnotifications.type_defs import ListNotificationRulesResultTypeDef","symbol":"ListNotificationRulesResultTypeDef","correct":"from mypy_boto3_codestar_notifications.type_defs import ListNotificationRulesResultTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_codestar_notifications import CodeStarNotificationsClient\nfrom mypy_boto3_codestar_notifications.type_defs import ListNotificationRulesResultTypeDef\n\n# A boto3 session for runtime (not type-checked)\nsession = boto3.Session(region_name=\"us-east-1\")\n\n# Get a type-hinted CodeStarNotifications client\nclient: CodeStarNotificationsClient = session.client(\"codestar-notifications\")\n\n# Example API call with type-checked result\ntry:\n    result: ListNotificationRulesResultTypeDef = client.list_notification_rules()\n    print(f\"Found {len(result.get('NotificationRules', []))} notification rules.\")\n\n    # For demonstration, typically you'd iterate or check the rules\n    if result.get('NotificationRules'):\n        first_rule_name = result['NotificationRules'][0]['Name']\n        print(f\"First rule name: {first_rule_name}\")\nexcept Exception as e:\n    print(f\"Error listing notification rules: {e}\")","lang":"python","description":"This quickstart demonstrates how to obtain a type-hinted CodeStar Notifications client and make a simple API call (`list_notification_rules`) with type-checked results. Remember to configure your AWS credentials for `boto3` to function at runtime."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Python 3.8 is no longer supported for any `mypy-boto3` packages generated by `mypy-boto3-builder` version 8.12.0 and later.","severity":"breaking","affected_versions":"mypy-boto3-codestar-notifications versions generated by mypy-boto3-builder >= 8.12.0 (i.e., this package's 1.42.x and newer)."},{"fix":"Ensure `pip install boto3 mypy-boto3-codestar-notifications` is run.","message":"`mypy-boto3-*` stub packages provide type annotations *only*. You must also install `boto3` (or `aiobotocore`/`aioboto3`) for the runtime functionality. Without `boto3`, your code will fail at runtime.","severity":"gotcha","affected_versions":"All versions."},{"fix":"Regularly update both `boto3` and its corresponding `mypy-boto3-*` stub packages in tandem.","message":"For optimal type accuracy and to avoid potential mismatches, the version of `mypy-boto3-codestar-notifications` should ideally match the minor version of your `boto3` installation (e.g., `mypy-boto3-codestar-notifications==1.42.x` for `boto3==1.42.x`).","severity":"gotcha","affected_versions":"All versions."},{"fix":"Update your code to reflect the new TypeDef naming conventions, as seen in the generated `.pyi` files. This typically affects advanced usage where TypeDefs are explicitly imported and referenced.","message":"Internal TypeDef names for method arguments may have changed in `mypy-boto3-builder` 8.9.0. If you were directly importing and referencing these generated TypeDefs (e.g., `CreateDistributionRequestRequestTypeDef`), their names might have been shortened or suffixes reordered.","severity":"breaking","affected_versions":"mypy-boto3-codestar-notifications versions generated by mypy-boto3-builder >= 8.9.0."}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}