Skip to content

Examples#

Index > RePostPrivate > Examples

Auto-generated documentation for RePostPrivate type annotations stubs module mypy-boto3-repostspace.

Client#

Implicit type annotations#

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

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

# RePostPrivateClient usage example

from boto3.session import Session


session = Session()

client = session.client("repostspace")  # (1)
result = client.batch_add_role()  # (2)
  1. client: RePostPrivateClient
  2. result: BatchAddRoleOutputTypeDef
# ListSpacesPaginator usage example

from boto3.session import Session


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

paginator = client.get_paginator("list_spaces")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: RePostPrivateClient
  2. paginator: ListSpacesPaginator
  3. item: ListSpacesOutputTypeDef

Explicit type annotations#

With boto3-stubs-lite[repostspace] or a standalone mypy_boto3_repostspace package, you have to explicitly specify client: RePostPrivateClient 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.

# RePostPrivateClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_repostspace.client import RePostPrivateClient
from mypy_boto3_repostspace.type_defs import BatchAddRoleOutputTypeDef
from mypy_boto3_repostspace.type_defs import BatchAddRoleInputRequestTypeDef


session = Session()

client: RePostPrivateClient = session.client("repostspace")

kwargs: BatchAddRoleInputRequestTypeDef = {...}
result: BatchAddRoleOutputTypeDef = client.batch_add_role(**kwargs)
# ListSpacesPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_repostspace.client import RePostPrivateClient
from mypy_boto3_repostspace.paginator import ListSpacesPaginator
from mypy_boto3_repostspace.type_defs import ListSpacesOutputTypeDef


session = Session()
client: RePostPrivateClient = session.client("repostspace")

paginator: ListSpacesPaginator = client.get_paginator("list_spaces")
for item in paginator.paginate(...):
    item: ListSpacesOutputTypeDef
    print(item)