. * */ namespace Friendica\Object\Api\Mastodon; use Friendica\BaseDataTransferObject; use Friendica\Util\DateTimeFormat; /** * Class Error * * @see https://docs.joinmastodon.org/entities/error */ class Token extends BaseDataTransferObject { /** @var string */ protected $access_token; /** @var string */ protected $token_type; /** @var string */ protected $scope; /** @var string (Datetime) */ protected $created_at; /** * Creates a token record * * @param string $access_token * @param string $token_type * @param string $scope * @param string $created_at */ public function __construct(string $access_token, string $token_type, string $scope, string $created_at) { $this->access_token = $access_token; $this->token_type = $token_type; $this->scope = $scope; $this->created_at = DateTimeFormat::utc($created_at, DateTimeFormat::ATOM); } }