Skip to content

Examples#

Index > BackupSearch > Examples

Auto-generated documentation for BackupSearch type annotations stubs module types-boto3-backupsearch.

Client#

Implicit type annotations#

Can be used with types-boto3[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)
  1. client: BackupSearchClient
  2. 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)
  1. client: BackupSearchClient
  2. paginator: ListSearchJobBackupsPaginator
  3. item: ListSearchJobBackupsOutputTypeDef

Explicit type annotations#

With types-boto3-lite[backupsearch] or a standalone types_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 types_boto3_backupsearch.client import BackupSearchClient
from types_boto3_backupsearch.type_defs import GetSearchJobOutputTypeDef
from types_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 types_boto3_backupsearch.client import BackupSearchClient
from types_boto3_backupsearch.paginator import ListSearchJobBackupsPaginator
from types_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)