Skip to content

Examples#

Index > QBusiness > Examples

Auto-generated documentation for QBusiness type annotations stubs module mypy-boto3-qbusiness.

Client#

Implicit type annotations#

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

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

# QBusinessClient usage example

from boto3.session import Session


session = Session()

client = session.client("qbusiness")  # (1)
result = client.batch_delete_document()  # (2)
  1. client: QBusinessClient
  2. result: BatchDeleteDocumentResponseTypeDef
# GetChatControlsConfigurationPaginator usage example

from boto3.session import Session


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

paginator = client.get_paginator("get_chat_controls_configuration")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: QBusinessClient
  2. paginator: GetChatControlsConfigurationPaginator
  3. item: GetChatControlsConfigurationResponseTypeDef

Explicit type annotations#

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

# QBusinessClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_qbusiness.client import QBusinessClient
from mypy_boto3_qbusiness.type_defs import BatchDeleteDocumentResponseTypeDef
from mypy_boto3_qbusiness.type_defs import BatchDeleteDocumentRequestRequestTypeDef


session = Session()

client: QBusinessClient = session.client("qbusiness")

kwargs: BatchDeleteDocumentRequestRequestTypeDef = {...}
result: BatchDeleteDocumentResponseTypeDef = client.batch_delete_document(**kwargs)
# GetChatControlsConfigurationPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_qbusiness.client import QBusinessClient
from mypy_boto3_qbusiness.paginator import GetChatControlsConfigurationPaginator
from mypy_boto3_qbusiness.type_defs import GetChatControlsConfigurationResponseTypeDef


session = Session()
client: QBusinessClient = session.client("qbusiness")

paginator: GetChatControlsConfigurationPaginator = client.get_paginator("get_chat_controls_configuration")
for item in paginator.paginate(...):
    item: GetChatControlsConfigurationResponseTypeDef
    print(item)