Skip to content

Examples#

Index > EventBridgePipes > Examples

Auto-generated documentation for EventBridgePipes type annotations stubs module types-boto3-pipes.

Client#

Implicit type annotations#

Can be used with types-boto3[pipes] package installed.

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

Client method usage example#

# EventBridgePipesClient usage example

from boto3.session import Session


session = Session()

client = session.client("pipes")  # (1)
result = client.create_pipe()  # (2)
  1. client: EventBridgePipesClient
  2. result: CreatePipeResponseTypeDef

Paginator usage example#

# ListPipesPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("pipes")  # (1)

paginator = client.get_paginator("list_pipes")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: EventBridgePipesClient
  2. paginator: ListPipesPaginator
  3. item: ListPipesResponseTypeDef

Explicit type annotations#

With types-boto3-lite[pipes] or a standalone types_boto3_pipes package, you have to explicitly specify client: EventBridgePipesClient 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#

# EventBridgePipesClient usage example with type annotations

from boto3.session import Session

from types_boto3_pipes.client import EventBridgePipesClient
from types_boto3_pipes.type_defs import CreatePipeResponseTypeDef
from types_boto3_pipes.type_defs import CreatePipeRequestTypeDef


session = Session()

client: EventBridgePipesClient = session.client("pipes")

kwargs: CreatePipeRequestTypeDef = {...}
result: CreatePipeResponseTypeDef = client.create_pipe(**kwargs)

Paginator usage example#

# ListPipesPaginator usage example with type annotations

from boto3.session import Session

from types_boto3_pipes.client import EventBridgePipesClient
from types_boto3_pipes.paginator import ListPipesPaginator
from types_boto3_pipes.type_defs import ListPipesResponseTypeDef


session = Session()
client: EventBridgePipesClient = session.client("pipes")

paginator: ListPipesPaginator = client.get_paginator("list_pipes")
for item in paginator.paginate(...):
    item: ListPipesResponseTypeDef
    print(item)