Skip to content

list_snapshots_in_recycle_bin async

list_snapshots_in_recycle_bin(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    max_results: Optional[ListSnapshotsInRecycleBinMaxResults] = None,
    next_token: Optional[String] = None,
    snapshot_ids: Optional[SnapshotIdStringList] = None,
    dry_run: Optional[Boolean] = None,
) -> ListSnapshotsInRecycleBinResult

Lists one or more snapshots that are currently in the Recycle Bin.

Parameters:

  • max_results (Optional[ListSnapshotsInRecycleBinMaxResults], default: None ) –

    The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination.

  • next_token (Optional[String], default: None ) –

    The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.

  • snapshot_ids (Optional[SnapshotIdStringList], default: None ) –

    The IDs of the snapshots to list. Omit this parameter to list all of the snapshots that are in the Recycle Bin.

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def list_snapshots_in_recycle_bin(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    max_results: Optional[
        "capo_ec2.types.list_snapshots_in_recycle_bin_max_results.ListSnapshotsInRecycleBinMaxResults"
    ] = None,
    next_token: Optional["capo_ec2.types.string.String"] = None,
    snapshot_ids: Optional[
        "capo_ec2.types.snapshot_id_string_list.SnapshotIdStringList"
    ] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> "capo_ec2.types.list_snapshots_in_recycle_bin_result.ListSnapshotsInRecycleBinResult":
    """<p>Lists one or more snapshots that are currently in the Recycle Bin.</p>

    Args:
        max_results: <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
        next_token: <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
        snapshot_ids: <p>The IDs of the snapshots to list. Omit this parameter to list all of the snapshots that are in the Recycle Bin.</p>
        dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ec2.types.list_snapshots_in_recycle_bin_request.ListSnapshotsInRecycleBinRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.list_snapshots_in_recycle_bin_result.ListSnapshotsInRecycleBinResult"
    ]:
        import capo_ec2._operations.amazon_ec2.list_snapshots_in_recycle_bin

        (
            output,
            http_response,
        ) = await capo_ec2._operations.amazon_ec2.list_snapshots_in_recycle_bin.async_list_snapshots_in_recycle_bin(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListSnapshotsInRecycleBin")
    )
    input_: capo_ec2.types.list_snapshots_in_recycle_bin_request.ListSnapshotsInRecycleBinRequest = {}
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if snapshot_ids is not None:
        input_["snapshot_ids"] = snapshot_ids
    if dry_run is not None:
        input_["dry_run"] = dry_run

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output