Skip to content

Examples#

Index > OpenSearchIngestion > Examples

Auto-generated documentation for OpenSearchIngestion type annotations stubs module mypy-boto3-osis.

Client#

Implicit type annotations#

Can be used with boto3-stubs[osis] package installed.

Write your OpenSearchIngestion code as usual, type checking and code completion should work out of the box.

# OpenSearchIngestionClient usage example

from boto3.session import Session


session = Session()

client = session.client("osis")  # (1)
result = client.create_pipeline()  # (2)
  1. client: OpenSearchIngestionClient
  2. result: CreatePipelineResponseTypeDef

Explicit type annotations#

With boto3-stubs-lite[osis] or a standalone mypy_boto3_osis package, you have to explicitly specify client: OpenSearchIngestionClient type annotation.

All other type annotations are optional, as types should be discovered automatically. However, these type annotations can be helpful in your functions and methods.

# OpenSearchIngestionClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_osis.client import OpenSearchIngestionClient
from mypy_boto3_osis.type_defs import CreatePipelineResponseTypeDef
from mypy_boto3_osis.type_defs import CreatePipelineRequestRequestTypeDef


session = Session()

client: OpenSearchIngestionClient = session.client("osis")

kwargs: CreatePipelineRequestRequestTypeDef = {...}
result: CreatePipelineResponseTypeDef = client.create_pipeline(**kwargs)