{"id":3165,"library":"mypy-boto3-waf-regional","title":"Mypy Boto3 WAFRegional Stubs","description":"Provides static type annotations for the 'waf-regional' service of `boto3`, enabling robust type checking for AWS WAFRegional client interactions with tools like Mypy. This package is part of the `mypy-boto3` ecosystem, currently at version 1.42.3, and updates in sync with `boto3` releases via the `mypy-boto3-builder`.","status":"active","version":"1.42.3","language":"python","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["AWS","Boto3","WAFRegional","Type Hinting","Mypy","Stubs","Static Analysis"],"install":[{"cmd":"pip install mypy-boto3-waf-regional boto3","lang":"bash","label":"Install library and its runtime dependency"}],"dependencies":[{"reason":"Runtime dependency for the AWS SDK for Python, which these stubs type-check.","package":"boto3"}],"imports":[{"note":"Type for the 'waf-regional' client returned by boto3.client().","symbol":"WAFRegionalClient","correct":"from mypy_boto3_waf_regional import WAFRegionalClient"},{"note":"Example of importing a specific TypeDef for AWS WAFRegional API responses.","symbol":"ListRulesResponseTypeDef","correct":"from mypy_boto3_waf_regional.type_defs import ListRulesResponseTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_waf_regional import WAFRegionalClient\nfrom typing import TYPE_CHECKING\nimport os\n\n# Ensure AWS region is set for boto3, e.g., via environment variable or ~/.aws/config\nos.environ.setdefault('AWS_REGION', os.environ.get('AWS_REGION', 'us-east-1'))\n\nif TYPE_CHECKING:\n    # This block is for static type checking only, not executed at runtime.\n    # 'client' will be type-checked as WAFRegionalClient.\n    client: WAFRegionalClient = boto3.client(\"waf-regional\")\n    # Example of a type-checked API call; type checkers will validate arguments and response.\n    response = client.list_rules()\n    print(response.get('Rules')) # Type checker knows 'Rules' is a key here\nelse:\n    # This block runs at runtime. The type hint helps IDEs and linters.\n    client: WAFRegionalClient = boto3.client(\"waf-regional\")\n    try:\n        # Attempt a non-destructive API call to demonstrate functionality.\n        response = client.list_rules()\n        print(f\"Successfully listed WAFRegional rules: {len(response.get('Rules', []))} rules found.\")\n    except Exception as e:\n        print(f\"Error listing WAFRegional rules (check AWS credentials and region): {e}\")\n        print(\"To run this code, ensure AWS credentials are configured (e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION environment variables).\")","lang":"python","description":"Demonstrates how to initialize a `boto3` WAFRegional client with type annotations and perform a simple API call. The `TYPE_CHECKING` block ensures type hints are only processed by static analyzers, while the `else` block provides runnable runtime code with basic error handling and region setup for `boto3`."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or a later version to use newer stub versions.","message":"Python 3.8 support was removed from `mypy-boto3-builder` (and thus all generated stub packages) starting from version 8.12.0. Users on Python 3.8 must upgrade to Python 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0 (affecting all mypy-boto3-* stub packages)"},{"fix":"Review your code for direct `TypeDef` imports and adjust names according to the updated stub definitions found in the `mypy_boto3_waf_regional.type_defs` module.","message":"Breaking changes to `TypeDef` naming conventions occurred in `mypy-boto3-builder` 8.9.0. If you directly imported and used generated `TypeDef`s, their names might have been shortened or rearranged (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`).","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0 (affecting all mypy-boto3-* stub packages)"},{"fix":"Ensure `pip install boto3` is part of your project's dependencies alongside the stub package.","message":"These `mypy-boto3-*` packages provide only type annotations for static analysis; they do not include the runtime functionality. You must also install the corresponding `boto3` (or `aioboto3` for async stubs) package for your application to run.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your `mypy` and Python environment are up to date. If issues arise, verify `mypy`'s `follow_imports` configuration or clear any cached environments.","message":"The `mypy-boto3` ecosystem migrated to PEP 561 compliant packages in `mypy-boto3-builder` 8.12.0. While this is primarily an internal change for package distribution, it might affect how some older build tools or specific `mypy` configurations locate and utilize type stubs.","severity":"gotcha","affected_versions":"mypy-boto3-builder >= 8.12.0 (affecting all mypy-boto3-* stub packages)"}],"env_vars":null,"search_vec":"'1.42.3':43 'analysi':65 'annot':8 'aw':22,57 'boto3':2,16,38,49,55,58 'builder':56 'check':20 'client':24 'current':40 'ecosystem':39 'enabl':17 'hint':61 'interact':25 'like':28 'mypi':1,29,37,54,62 'mypy-boto3':36 'mypy-boto3-builder':53 'packag':31 'part':33 'provid':5 'region':13 'releas':50 'robust':18 'servic':14 'static':6,64 'stub':4,63 'sync':47 'tool':27 'type':7,19,60 'updat':45 'version':42 'via':51 'waf':12 'waf-region':11 'wafregion':3,23,59","created_at":"2026-04-11T09:23:49.112315+00:00","updated_at":"2026-04-16T17:16:54.404264+00:00","problems":{"verify_error":"error: Failed to parse: `mypy-boto3-waf-regional boto3`\n  Caused by: Expected one of `@`, `(`, `<`, `=`, `>`, `~`, `!`, `;`, found `b`\nmypy-boto3-waf-regional boto3\n                        ^"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.43.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/youtype/mypy_boto3_builder","docs":"https://youtype.github.io/boto3_stubs_docs/mypy_boto3_waf_regional/","changelog":null,"pypi":"https://pypi.org/project/mypy-boto3-waf-regional/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["type-stubs","aws"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-28","next_check":"2026-07-05","install_tag":null}}