Skip to content

update_export async

update_export(
    export_id: Id,
    *,
    config_overrides: Optional[AsyncLexModelsV2ClientConfig] = None,
    file_password: Optional[ImportExportFilePassword] = None,
) -> UpdateExportResponse

Updates the password used to protect an export zip archive.

The password is not required. If you don't supply a password, Amazon Lex generates a zip file that is not protected by a password. This is the archive that is available at the pre-signed S3 URL provided by the DescribeExport operation.

Parameters:

  • export_id (Id) –

    The unique identifier Amazon Lex assigned to the export.

  • file_password (Optional[ImportExportFilePassword], default: None ) –

    The new password to use to encrypt the export zip archive.

Raises:

  • ConflictException –

    The action that you tried to perform couldn't be completed because the resource is in a conflicting state. For example, deleting a bot that is in the CREATING state. Try your request again.

  • InternalServerException –

    The service encountered an unexpected condition. Try your request again.

  • ResourceNotFoundException –

    You asked to describe a resource that doesn't exist. Check the resource that you are requesting and try again.

  • ServiceQuotaExceededException –

    You have reached a quota for your bot.

  • ThrottlingException –

    Your request rate is too high. Reduce the frequency of requests.

  • ValidationException –

    One of the input parameters in your request isn't valid. Check the parameters and try your request again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_lex_models_v2/_services/async_lex_models_v2.py
async def update_export(
    self,
    export_id: "capo_lex_models_v2.types.id.Id",
    *,
    config_overrides: Optional[AsyncLexModelsV2ClientConfig] = None,
    file_password: Optional[
        "capo_lex_models_v2.types.import_export_file_password.ImportExportFilePassword"
    ] = None,
) -> "capo_lex_models_v2.types.update_export_response.UpdateExportResponse":
    """<p>Updates the password used to protect an export zip archive.</p> <p>The password is not required. If you don't supply a password, Amazon Lex generates a zip file that is not protected by a password. This is the archive that is available at the pre-signed S3 URL provided by the <a href="https://docs.aws.amazon.com/lexv2/latest/APIReference/API_DescribeExport.html">DescribeExport</a> operation.</p>

    Args:
        export_id: <p>The unique identifier Amazon Lex assigned to the export.</p>
        file_password: <p>The new password to use to encrypt the export zip archive.</p>

    Raises:
        capo_lex_models_v2.errors.conflict_exception.ConflictException: <p>The action that you tried to perform couldn't be completed because the resource is in a conflicting state. For example, deleting a bot that is in the CREATING state. Try your request again. </p>
        capo_lex_models_v2.errors.internal_server_exception.InternalServerException: <p>The service encountered an unexpected condition. Try your request again.</p>
        capo_lex_models_v2.errors.resource_not_found_exception.ResourceNotFoundException: <p>You asked to describe a resource that doesn't exist. Check the resource that you are requesting and try again.</p>
        capo_lex_models_v2.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>You have reached a quota for your bot. </p>
        capo_lex_models_v2.errors.throttling_exception.ThrottlingException: <p>Your request rate is too high. Reduce the frequency of requests.</p>
        capo_lex_models_v2.errors.validation_exception.ValidationException: <p>One of the input parameters in your request isn't valid. Check the parameters and try your request again.</p>
        capo_lex_models_v2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_lex_models_v2.types.update_export_request.UpdateExportRequest]",
    ) -> AsyncOperationResponse[
        "capo_lex_models_v2.types.update_export_response.UpdateExportResponse"
    ]:
        import capo_lex_models_v2._operations.lex_model_building_service_v2.update_export

        (
            output,
            http_response,
        ) = await capo_lex_models_v2._operations.lex_model_building_service_v2.update_export.async_update_export(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_lex_models_v2.types.update_export_request.UpdateExportRequest",
    ) -> dict[str, Any]:
        import capo_lex_models_v2.types.update_export_request

        return capo_lex_models_v2.types.update_export_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("UpdateExport", redact_input=_redact_input),
    )
    input_: capo_lex_models_v2.types.update_export_request.UpdateExportRequest = {
        "export_id": export_id
    }
    if file_password is not None:
        input_["file_password"] = file_password

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