<?php

/*
 * This file is part of the AuthStack project.
 *
 * (c) Buckhill Ltd <development@buckhill.co.uk>
 *
 * This source file is subject to the Buckhill license that is bundled
 * with this source code in the file LICENSE.
 */

namespace AuthStack\Driver\User;

use AuthStack\Driver\Model\User;
use AuthStack\Driver\Errors\NoProvisionedUserError;
use AuthStack\TwoFactor\Collection\KeyCollectionInterface;

interface UserInterface
{
    /**
     * @param $id
     *
     * @return UserInterface
     */
    public function setAuthstackID($id);

    /**
     * @return int
     */
    public function getAuthstackID();

    /**
     * @param $id
     *
     * @return UserInterface
     */
    public function setAuthsourceID($id);

    /**
     * @return int
     */
    public function getAuthsourceID();

    /**
     * @param User $provisioned
     *
     * @return UserInterface
     */
    public function setProvisionedUser(User $provisioned);

    /**
     * @return User
     *
     * @throws NoProvisionedUserError
     */
    public function getProvisionedUser();

    /**
     * @return string
     */
    public function getPrimaryKeyValue();

    /**
     * @param KeyCollectionInterface $collection
     *
     * @return UserInterface
     */
    public function setKeyCollection(KeyCollectionInterface $collection);

    /**
     * @return KeyCollectionInterface
     */
    public function getKeyCollection();

    /**
     * @return bool
     */
    public function hasTwoFactorKeys();

    /**
     * @return bool
     */
    public function hasU2FKeys();

    /**
     * @return array
     */
    public function getU2FKeyIds();

    /**
     * @return string
     */
    public function getUsername();

    /**
     * @return string
     */
    public function getFullName();

    /**
     * @return string
     */
    public function getEmail();

    /**
     * @param bool $object
     *
     * @return string|\DateTimeZone
     */
    public function getTimeZone($object = false);


    /**
     * @return mixed
     */
    public function getDateTimeFormat();


    /**
     * @return string
     */
    public function getProfileImage();


    /**
     * @return bool
     */
    public function twoFactorEnabled();

    /**
     * @return bool
     */
    public function isAdmin();

    /**
     * @return UserInterface
     */
    public function setAdmin();

    /**
     * @param string $key
     * @param null   $default
     *
     * @return mixed
     */
    public function getAttribute($key = '', $default = null);

    /**
     * @param $key_id
     *
     * @return bool
     */
    public function removeSecurityKey($key_id);

    /**
     * @return array
     */
    public function toArray();
}
