Skip to content

BackupClient#

Index > Backup > BackupClient

Auto-generated documentation for Backup type annotations stubs module mypy-boto3-backup.

BackupClient#

Type annotations and code completion for boto3.client("backup"). boto3 documentation

# BackupClient usage example

from boto3.session import Session
from mypy_boto3_backup.client import BackupClient

def get_backup_client() -> BackupClient:
    return Session().client("backup")

Exceptions#

boto3 client exceptions are generated in runtime. This class provides code completion for boto3.client("backup").exceptions structure.

# Exceptions.exceptions usage example

client = boto3.client("backup")

try:
    do_something(client)
except (
    client.exceptions.AlreadyExistsException,
    client.exceptions.ClientError,
    client.exceptions.ConflictException,
    client.exceptions.DependencyFailureException,
    client.exceptions.InvalidParameterValueException,
    client.exceptions.InvalidRequestException,
    client.exceptions.InvalidResourceStateException,
    client.exceptions.LimitExceededException,
    client.exceptions.MissingParameterValueException,
    client.exceptions.ResourceNotFoundException,
    client.exceptions.ServiceUnavailableException,
) as e:
    print(e)
# Exceptions.exceptions type checking example

from mypy_boto3_backup.client import Exceptions

def handle_error(exc: Exceptions.AlreadyExistsException) -> None:
    ...

Methods#

can_paginate#

Check if an operation can be paginated.

Type annotations and code completion for boto3.client("backup").can_paginate method. boto3 documentation

# can_paginate method definition

def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

Removes the specified legal hold on a recovery point.

Type annotations and code completion for boto3.client("backup").cancel_legal_hold method. boto3 documentation

# cancel_legal_hold method definition

def cancel_legal_hold(
    self,
    *,
    LegalHoldId: str,
    CancelDescription: str,
    RetainRecordInDays: int = ...,
) -> Dict[str, Any]:
    ...
# cancel_legal_hold method usage example with argument unpacking

kwargs: CancelLegalHoldInputRequestTypeDef = {  # (1)
    "LegalHoldId": ...,
    "CancelDescription": ...,
}

parent.cancel_legal_hold(**kwargs)
  1. See CancelLegalHoldInputRequestTypeDef