Examples#
Index > OpenSearchIngestion > Examples
Auto-generated documentation for OpenSearchIngestion type annotations stubs module types-boto3-osis.
Client#
Implicit type annotations#
Can be used with types-boto3[osis]
package installed.
Write your OpenSearchIngestion
code as usual,
type checking and code completion should work out of the box.
Client method usage example#
# OpenSearchIngestionClient usage example
from boto3.session import Session
session = Session()
client = session.client("osis") # (1)
result = client.create_pipeline() # (2)
- client: OpenSearchIngestionClient
- result: CreatePipelineResponseTypeDef
Paginator usage example#
# ListPipelineEndpointConnectionsPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("osis") # (1)
paginator = client.get_paginator("list_pipeline_endpoint_connections") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: OpenSearchIngestionClient
- paginator: ListPipelineEndpointConnectionsPaginator
- item: ListPipelineEndpointConnectionsResponseTypeDef
Explicit type annotations#
With types-boto3-lite[osis]
or a standalone types_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.
Client method usage example#
# OpenSearchIngestionClient usage example with type annotations
from boto3.session import Session
from types_boto3_osis.client import OpenSearchIngestionClient
from types_boto3_osis.type_defs import CreatePipelineResponseTypeDef
from types_boto3_osis.type_defs import CreatePipelineRequestTypeDef
session = Session()
client: OpenSearchIngestionClient = session.client("osis")
kwargs: CreatePipelineRequestTypeDef = {...}
result: CreatePipelineResponseTypeDef = client.create_pipeline(**kwargs)
Paginator usage example#
# ListPipelineEndpointConnectionsPaginator usage example with type annotations
from boto3.session import Session
from types_boto3_osis.client import OpenSearchIngestionClient
from types_boto3_osis.paginator import ListPipelineEndpointConnectionsPaginator
from types_boto3_osis.type_defs import ListPipelineEndpointConnectionsResponseTypeDef
session = Session()
client: OpenSearchIngestionClient = session.client("osis")
paginator: ListPipelineEndpointConnectionsPaginator = client.get_paginator("list_pipeline_endpoint_connections")
for item in paginator.paginate(...):
item: ListPipelineEndpointConnectionsResponseTypeDef
print(item)