Skip to content

delete_snapshot_copy_grant async

delete_snapshot_copy_grant(
    *,
    config_overrides: Optional[AsyncRedshiftClientConfig] = None,
    snapshot_copy_grant_name: Optional[String] = None,
) -> None

Deletes the specified snapshot copy grant.

Parameters:

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

    The name of the snapshot copy grant to delete.

Raises:

Source code in docs_src/capo_redshift/_services/async_redshift.py
async def delete_snapshot_copy_grant(
    self,
    *,
    config_overrides: Optional[AsyncRedshiftClientConfig] = None,
    snapshot_copy_grant_name: Optional["capo_redshift.types.string.String"] = None,
) -> None:
    """<p>Deletes the specified snapshot copy grant.</p>

    Args:
        snapshot_copy_grant_name: <p>The name of the snapshot copy grant to delete.</p>

    Raises:
        capo_redshift.errors.invalid_snapshot_copy_grant_state_fault.InvalidSnapshotCopyGrantStateFault: <p>The snapshot copy grant can't be deleted because it is used by one or more clusters.</p>
        capo_redshift.errors.snapshot_copy_grant_not_found_fault.SnapshotCopyGrantNotFoundFault: <p>The specified snapshot copy grant can't be found. Make sure that the name is typed correctly and that the grant exists in the destination region.</p>
        capo_redshift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_redshift.types.delete_snapshot_copy_grant_message.DeleteSnapshotCopyGrantMessage]",
    ) -> AsyncOperationResponse[None]:
        import capo_redshift._operations.redshift_service_version20121201.delete_snapshot_copy_grant

        (
            output,
            http_response,
        ) = await capo_redshift._operations.redshift_service_version20121201.delete_snapshot_copy_grant.async_delete_snapshot_copy_grant(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteSnapshotCopyGrant")
    )
    input_: capo_redshift.types.delete_snapshot_copy_grant_message.DeleteSnapshotCopyGrantMessage = {}
    if snapshot_copy_grant_name is not None:
        input_["snapshot_copy_grant_name"] = snapshot_copy_grant_name

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