mypy-boto3-osis Type Annotations

1.42.3 · active · verified Sat Apr 11

Type annotations for the `boto3` OpenSearch Ingestion (OSIS) service (version 1.42.3), generated with `mypy-boto3-builder`. These stubs provide type hints for IDEs and static analyzers like Mypy and Pyright, enhancing the development experience for AWS SDK users by offering autocompletion and early error detection. The library maintains an active release cadence, typically syncing with `boto3` versions.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize a type-hinted `boto3` OpenSearch Ingestion client and call `list_pipelines`. The `OSISClient` and `ListPipelinesResponseTypeDef` provide static type checking and autocompletion for method calls and response structures.

import boto3
from mypy_boto3_osis.client import OSISClient
from mypy_boto3_osis.type_defs import ListPipelinesResponseTypeDef

# A boto3 session, typically configured via environment variables or AWS CLI
# For quickstart, we assume default configuration or minimal environment setup.
# Ensure AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION are set in env if not using default profile.

def get_osis_pipelines() -> ListPipelinesResponseTypeDef:
    # Initialize the boto3 client with type annotations
    client: OSISClient = boto3.client("osis")
    
    # Use a type-hinted client
    response: ListPipelinesResponseTypeDef = client.list_pipelines()
    
    print(f"Found {len(response.get('Pipelines', []))} OSIS pipelines.")
    for pipeline in response.get('Pipelines', []):
        print(f"  - {pipeline.get('PipelineName')}")
        
    return response

if __name__ == "__main__":
    try:
        get_osis_pipelines()
    except Exception as e:
        print(f"An error occurred: {e}")
        print("Ensure 'boto3' is installed and AWS credentials/region are configured.")

view raw JSON →