Examples#
Index > BackupSearch > Examples
Auto-generated documentation for BackupSearch type annotations stubs module mypy-boto3-backupsearch.
Client#
Implicit type annotations#
Can be used with boto3-stubs[backupsearch]
package installed.
Write your BackupSearch
code as usual,
type checking and code completion should work out of the box.
Client method usage example#
# BackupSearchClient usage example
from boto3.session import Session
session = Session()
client = session.client("backupsearch") # (1)
result = client.get_search_job() # (2)
- client: BackupSearchClient
- result: GetSearchJobOutputTypeDef
Paginator usage example#
# ListSearchJobBackupsPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("backupsearch") # (1)
paginator = client.get_paginator("list_search_job_backups") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: BackupSearchClient
- paginator: ListSearchJobBackupsPaginator
- item: ListSearchJobBackupsOutputTypeDef
Explicit type annotations#
With boto3-stubs-lite[backupsearch]
or a standalone mypy_boto3_backupsearch
package, you have to explicitly specify client: BackupSearchClient
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#
# BackupSearchClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_backupsearch.client import BackupSearchClient
from mypy_boto3_backupsearch.type_defs import GetSearchJobOutputTypeDef
from mypy_boto3_backupsearch.type_defs import GetSearchJobInputTypeDef
session = Session()
client: BackupSearchClient = session.client("backupsearch")
kwargs: GetSearchJobInputTypeDef = {...}
result: GetSearchJobOutputTypeDef = client.get_search_job(**kwargs)
Paginator usage example#
# ListSearchJobBackupsPaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_backupsearch.client import BackupSearchClient
from mypy_boto3_backupsearch.paginator import ListSearchJobBackupsPaginator
from mypy_boto3_backupsearch.type_defs import ListSearchJobBackupsOutputTypeDef
session = Session()
client: BackupSearchClient = session.client("backupsearch")
paginator: ListSearchJobBackupsPaginator = client.get_paginator("list_search_job_backups")
for item in paginator.paginate(...):
item: ListSearchJobBackupsOutputTypeDef
print(item)