Skip to content

restore_managed_prefix_list_version async

restore_managed_prefix_list_version(
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    prefix_list_id: Optional[PrefixListResourceId] = None,
    previous_version: Optional[Long] = None,
    current_version: Optional[Long] = None,
) -> RestoreManagedPrefixListVersionResult

Restores the entries from a previous version of a managed prefix list to a new version of the prefix list.

Parameters:

  • 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.

  • prefix_list_id (Optional[PrefixListResourceId], default: None ) –

    The ID of the prefix list.

  • previous_version (Optional[Long], default: None ) –

    The version to restore.

  • current_version (Optional[Long], default: None ) –

    The current version number for the prefix list.

Raises:

Source code in docs_src/capo_ec2/_services/async_ec2.py
async def restore_managed_prefix_list_version(
    self,
    *,
    config_overrides: Optional[AsyncEC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    prefix_list_id: Optional[
        "capo_ec2.types.prefix_list_resource_id.PrefixListResourceId"
    ] = None,
    previous_version: Optional["capo_ec2.types.long.Long"] = None,
    current_version: Optional["capo_ec2.types.long.Long"] = None,
) -> "capo_ec2.types.restore_managed_prefix_list_version_result.RestoreManagedPrefixListVersionResult":
    """<p>Restores the entries from a previous version of a managed prefix list to a new version of the prefix list.</p>

    Args:
        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>
        prefix_list_id: <p>The ID of the prefix list.</p>
        previous_version: <p>The version to restore.</p>
        current_version: <p>The current version number for the prefix list.</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.restore_managed_prefix_list_version_request.RestoreManagedPrefixListVersionRequest]",
    ) -> AsyncOperationResponse[
        "capo_ec2.types.restore_managed_prefix_list_version_result.RestoreManagedPrefixListVersionResult"
    ]:
        import capo_ec2._operations.amazon_ec2.restore_managed_prefix_list_version

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("RestoreManagedPrefixListVersion")
    )
    input_: capo_ec2.types.restore_managed_prefix_list_version_request.RestoreManagedPrefixListVersionRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if prefix_list_id is not None:
        input_["prefix_list_id"] = prefix_list_id
    if previous_version is not None:
        input_["previous_version"] = previous_version
    if current_version is not None:
        input_["current_version"] = current_version

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