nextcloud/apps/cloud_federation_api/lib/Db/FederatedInvite.php
Micke Nordin 623f2f0240
feat(OCM-invites): Implementation of invitation flow
This patchset:
* implements the /invite-accepted endpoint
* adds capabilities and inviteAceptDialog to the discovery
* adds a FederatedInviteAcceptedEvent

https://cs3org.github.io/OCM-API/docs.html?branch=v1.1.0&repo=OCM-API&user=cs3org#/paths/~1invite-accepted/post

Co-authored-by: Anna <anna@nextcloud.com>
Co-authored-by: Côme Chilliet <come.chilliet@nextcloud.com>
Co-authored-by: Joas Schilling <213943+nickvergessen@users.noreply.github.com>
Co-authored-by: Navid Shokri <navid.pdp11@gmail.com>
Signed-off-by: Micke Nordin <kano@sunet.se>
2025-06-12 11:20:26 +02:00

62 lines
2 KiB
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\CloudFederationAPI\Db;
use OCP\AppFramework\Db\Entity;
use OCP\DB\Types;
/**
* @method bool isAccepted()
* @method void setAccepted(bool $accepted)
* @method int|null getAcceptedAt()
* @method void setAcceptedAt(int $acceptedAt)
* @method int|null getCreatedAt()
* @method void setCreatedAt(int $createdAt)
* @method int|null getExpiredAt()
* @method void setExpiredAt(int $expiredAt)
* @method string|null getRecipientEmail()
* @method void setRecipientEmail(string $recipientEmail)
* @method string|null getRecipientName()
* @method void setRecipientName(string $recipientName)
* @method string|null getRecipientProvider()
* @method void setRecipientProvider(string $recipientProvider)
* @method string|null getRecipientUserId()
* @method void setRecipientUserId(string $recipientUserId)
* @method string getToken()
* @method void setToken(string $token)
* @method string|null getUserId()
* @method void setUserId(string $userId)
*/
class FederatedInvite extends Entity {
protected bool $accepted = false;
protected ?int $acceptedAt = 0;
protected int $createdAt = 0;
protected ?int $expiredAt = 0;
protected ?string $recipientEmail = null;
protected ?string $recipientName = null;
protected ?string $recipientProvider = null;
protected ?string $recipientUserId = null;
protected string $token = '';
protected string $userId = '';
public function __construct() {
$this->addType('accepted', Types::BOOLEAN);
$this->addType('acceptedAt', Types::BIGINT);
$this->addType('createdAt', Types::BIGINT);
$this->addType('expiredAt', Types::BIGINT);
$this->addType('recipientEmail', Types::STRING);
$this->addType('recipientName', Types::STRING);
$this->addType('recipientProvider', Types::STRING);
$this->addType('recipientUserId', Types::STRING);
$this->addType('token', Types::STRING);
$this->addType('userId', Types::STRING);
}
}