{"id":3657,"library":"mypy-boto3-opensearchserverless","title":"mypy-boto3-opensearchserverless Type Stubs","description":"mypy-boto3-opensearchserverless provides type annotations for the `boto3` OpenSearchServiceServerless client, generated with `mypy-boto3-builder`. It enhances static type checking for your AWS `boto3` code. The current version is 1.42.75, with new releases frequently (typically aligning with `boto3` and `botocore` updates) due to its auto-generated nature.","status":"active","version":"1.42.75","language":"python","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["boto3","aws","opensearchserverless","typing","mypy","stubs","type-hinting"],"install":[{"cmd":"pip install boto3 mypy mypy-boto3-opensearchserverless","lang":"bash","label":"Install Boto3, Mypy, and Type Stubs"}],"dependencies":[{"reason":"This package provides type stubs for boto3; boto3 itself must be installed to run your code.","package":"boto3","optional":false},{"reason":"mypy is the static type checker that utilizes these stubs for analysis.","package":"mypy","optional":true}],"imports":[{"note":"Type stubs are imported from the 'mypy_boto3_servicename' package, not directly from 'boto3'.","wrong":"from boto3.opensearchserverless import OpenSearchServiceServerlessClient","symbol":"OpenSearchServiceServerlessClient","correct":"from mypy_boto3_opensearchserverless.client import OpenSearchServiceServerlessClient"},{"note":"All generated type definitions (for request/response bodies, etc.) reside in the `type_defs` submodule of the stub package.","wrong":"from boto3.opensearchserverless.type_defs import CreateCollectionRequestTypeDef","symbol":"TypeDefs","correct":"from mypy_boto3_opensearchserverless.type_defs import CreateCollectionRequestTypeDef"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\n\n# Import the specific client stub for type annotation\nfrom mypy_boto3_opensearchserverless.client import OpenSearchServiceServerlessClient\n\n# To make mypy aware of the typed client, use TYPE_CHECKING\nif TYPE_CHECKING:\n    client: OpenSearchServiceServerlessClient = boto3.client(\"opensearchserverless\")\nelse:\n    client = boto3.client(\"opensearchserverless\")\n\n# Example usage: listing collections\ntry:\n    # This call will be type-checked based on the stub annotations\n    response = client.list_collections(maxResults=1)\n    print(f\"First collection details: {response.get('collectionDetails', [])}\")\nexcept Exception as e:\n    print(f\"Error listing collections (expected if no auth/resources configured): {e}\")\n\n# Example of using a TypeDef (e.g., for creating a collection)\n# from mypy_boto3_opensearchserverless.type_defs import CreateCollectionRequestTypeDef\n# \n# # mypy will validate the structure of this dictionary\n# collection_config: CreateCollectionRequestTypeDef = {\n#     \"name\": \"my-typed-collection\",\n#     \"type\": \"SEARCH\",\n#     \"description\": \"A collection created with type-checked parameters\"\n# }\n# print(f\"Collection configuration: {collection_config}\")","lang":"python","description":"This quickstart demonstrates how to instantiate a type-hinted OpenSearchServiceServerless client using `boto3` and its corresponding `mypy-boto3` stub. It includes an example API call (`list_collections`) and illustrates how to use `TYPE_CHECKING` for optimal type inference. Remember to configure your AWS credentials for actual execution."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer. Ensure your `requires_python` matches.","message":"Python 3.8 is no longer supported. `mypy-boto3-builder` (which generates these stubs) removed support for Python 3.8 across all packages, migrating to PEP 561.","severity":"breaking","affected_versions":">=8.12.0 (builder version, corresponds to stub versions 1.42.x and higher)"},{"fix":"Review your code for `TypeDef` imports and usage, updating names to reflect the simplified structure.","message":"Type Definition names for method arguments may have changed, becoming shorter. For example, `CreateDistributionRequestRequestTypeDef` might become `CreateDistributionRequestTypeDef`.","severity":"breaking","affected_versions":">=8.9.0 (builder version, check specific stub versions for impact)"},{"fix":"Ensure you `pip install boto3` alongside `mypy-boto3-opensearchserverless`.","message":"This package provides only type stubs. The actual `boto3` library must be installed separately for your code to run.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Install `mypy` (`pip install mypy`) and run `mypy your_script.py` to leverage the type annotations.","message":"While the stubs provide type hints, `mypy` itself is required to perform static type checking. Simply installing the stubs does not automatically enable type checks.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'1.42.75':39 'align':45 'annot':13 'auto':55 'auto-gener':54 'aw':32,59 'boto3':3,9,16,23,33,47,58 'botocor':49 'builder':24 'check':29 'client':18 'code':34 'current':36 'due':51 'enhanc':26 'frequent':43 'generat':19,56 'hint':66 'mypi':2,8,22,62 'mypy-boto3-builder':21 'mypy-boto3-opensearchserverless':1,7 'natur':57 'new':41 'opensearchserverless':4,10,60 'opensearchserviceserverless':17 'provid':11 'releas':42 'static':27 'stub':6,63 'type':5,12,28,61,65 'type-hint':64 'typic':44 'updat':50 'version':37","created_at":"2026-04-11T17:39:01.706280+00:00","updated_at":"2026-04-16T17:07:04.321974+00:00","problems":{"verify_error":"error: Failed to parse: `boto3 mypy mypy-boto3-opensearchserverless`\n  Caused by: Expected one of `@`, `(`, `<`, `=`, `>`, `~`, `!`, `;`, found `m`\nboto3 mypy mypy-boto3-opensearchserverless\n      ^"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.43.17","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_opensearchserverless/","changelog":null,"pypi":"https://pypi.org/project/mypy-boto3-opensearchserverless/","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-29","next_check":"2026-07-05","install_tag":null}}