Examples#
Index > EventBridgePipes > Examples
Auto-generated documentation for EventBridgePipes type annotations stubs module mypy-boto3-pipes.
Client#
Implicit type annotations#
Can be used with boto3-stubs[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)
- client: EventBridgePipesClient
- 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)
- client: EventBridgePipesClient
- paginator: ListPipesPaginator
- item: ListPipesResponseTypeDef
Explicit type annotations#
With boto3-stubs-lite[pipes]
or a standalone mypy_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 mypy_boto3_pipes.client import EventBridgePipesClient
from mypy_boto3_pipes.type_defs import CreatePipeResponseTypeDef
from mypy_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 mypy_boto3_pipes.client import EventBridgePipesClient
from mypy_boto3_pipes.paginator import ListPipesPaginator
from mypy_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)