Skip to content

Examples#

Index > KeyspacesStreams > Examples

Auto-generated documentation for KeyspacesStreams type annotations stubs module types-boto3-keyspacesstreams.

Client#

Implicit type annotations#

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

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

Client method usage example#

# KeyspacesStreamsClient usage example

from boto3.session import Session


session = Session()

client = session.client("keyspacesstreams")  # (1)
result = client.get_records()  # (2)
  1. client: KeyspacesStreamsClient
  2. result: GetRecordsOutputTypeDef

Paginator usage example#

# GetStreamPaginator usage example

from boto3.session import Session


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

paginator = client.get_paginator("get_stream")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: KeyspacesStreamsClient
  2. paginator: GetStreamPaginator
  3. item: GetStreamOutputTypeDef

Explicit type annotations#

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

# KeyspacesStreamsClient usage example with type annotations

from boto3.session import Session

from types_boto3_keyspacesstreams.client import KeyspacesStreamsClient
from types_boto3_keyspacesstreams.type_defs import GetRecordsOutputTypeDef
from types_boto3_keyspacesstreams.type_defs import GetRecordsInputTypeDef


session = Session()

client: KeyspacesStreamsClient = session.client("keyspacesstreams")

kwargs: GetRecordsInputTypeDef = {...}
result: GetRecordsOutputTypeDef = client.get_records(**kwargs)

Paginator usage example#

# GetStreamPaginator usage example with type annotations

from boto3.session import Session

from types_boto3_keyspacesstreams.client import KeyspacesStreamsClient
from types_boto3_keyspacesstreams.paginator import GetStreamPaginator
from types_boto3_keyspacesstreams.type_defs import GetStreamOutputTypeDef


session = Session()
client: KeyspacesStreamsClient = session.client("keyspacesstreams")

paginator: GetStreamPaginator = client.get_paginator("get_stream")
for item in paginator.paginate(...):
    item: GetStreamOutputTypeDef
    print(item)