Skip to content

update_archive

update_archive(
    archive_id: ArchiveIdString,
    *,
    config_overrides: Optional[MailManagerClientConfig] = None,
    archive_name: Optional[ArchiveNameString] = None,
    retention: Optional[ArchiveRetention] = None,
) -> UpdateArchiveResponse

Updates the attributes of an existing email archive.

Parameters:

Raises:

Source code in docs_src/capo_mailmanager/_services/mail_manager.py
def update_archive(
    self,
    archive_id: "capo_mailmanager.types.archive_id_string.ArchiveIdString",
    *,
    config_overrides: Optional[MailManagerClientConfig] = None,
    archive_name: Optional[
        "capo_mailmanager.types.archive_name_string.ArchiveNameString"
    ] = None,
    retention: Optional[
        "capo_mailmanager.types.archive_retention.ArchiveRetention"
    ] = None,
) -> "capo_mailmanager.types.update_archive_response.UpdateArchiveResponse":
    """<p>Updates the attributes of an existing email archive.</p>

    Args:
        archive_id: <p>The identifier of the archive to update.</p>
        archive_name: <p>A new, unique name for the archive.</p>
        retention: <p>A new retention period for emails in the archive.</p>

    Raises:
        capo_mailmanager.errors.access_denied_exception.AccessDeniedException: <p>Occurs when a user is denied access to a specific resource or action.</p>
        capo_mailmanager.errors.conflict_exception.ConflictException: <p>The request configuration has conflicts. For details, see the accompanying error message.</p>
        capo_mailmanager.errors.resource_not_found_exception.ResourceNotFoundException: <p>Occurs when a requested resource is not found.</p>
        capo_mailmanager.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Occurs when an operation exceeds a predefined service quota or limit.</p>
        capo_mailmanager.errors.throttling_exception.ThrottlingException: <p>Occurs when a service's request rate limit is exceeded, resulting in throttling of further requests.</p>
        capo_mailmanager.errors.validation_exception.ValidationException: <p>The request validation has failed. For details, see the accompanying error message.</p>
        capo_mailmanager.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_mailmanager.types.update_archive_request.UpdateArchiveRequest]",
    ) -> OperationResponse[
        "capo_mailmanager.types.update_archive_response.UpdateArchiveResponse"
    ]:
        import capo_mailmanager._operations.mail_manager_svc.update_archive

        output, http_response = (
            capo_mailmanager._operations.mail_manager_svc.update_archive.update_archive(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateArchive")
    )
    input_: capo_mailmanager.types.update_archive_request.UpdateArchiveRequest = {
        "archive_id": archive_id
    }
    if archive_name is not None:
        input_["archive_name"] = archive_name
    if retention is not None:
        input_["retention"] = retention

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output