<?php

declare(strict_types=1);

namespace PhpWA\Storage;

use PhpWA\Auth\AuthenticationCredentials;

interface CredentialStoreInterface
{
    public function load(string $accountId): ?CredentialRecord;

    /**
     * Saves only when the current revision equals $expectedRevision.
     * New records use expected revision 0.
     */
    public function save(string $accountId, AuthenticationCredentials $credentials, int $expectedRevision): CredentialRecord;

    public function delete(string $accountId, int $expectedRevision): void;
}
