You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

79 lines
2.7 KiB

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Talk\Model;
use OCP\AppFramework\Db\Entity;
/**
* @method void setUserId(string $userId)
* @method string getUserId()
* @method void setState(int $state)
* @method int getState()
* @method void setLocalRoomId(int $localRoomId)
* @method int getLocalRoomId()
* @method void setAccessToken(string $accessToken)
* @method string getAccessToken()
* @method void setRemoteServerUrl(string $remoteServerUrl)
* @method string getRemoteServerUrl()
* @method void setRemoteToken(string $remoteToken)
* @method string getRemoteToken()
* @method void setRemoteAttendeeId(int $remoteAttendeeId)
* @method int getRemoteAttendeeId()
* @method void setInviterCloudId(string $inviterCloudId)
* @method string getInviterCloudId()
* @method void setInviterDisplayName(string $inviterDisplayName)
* @method string getInviterDisplayName()
* @method void setLocalCloudId(string $localCloudId)
* @method string getLocalCloudId()
*/
class Invitation extends Entity implements \JsonSerializable {
public const STATE_PENDING = 0;
public const STATE_ACCEPTED = 1;
protected string $userId = '';
protected int $state = self::STATE_PENDING;
protected int $localRoomId = 0;
protected string $accessToken = '';
protected string $remoteServerUrl = '';
protected string $remoteToken = '';
protected int $remoteAttendeeId = 0;
protected string $inviterCloudId = '';
protected string $inviterDisplayName = '';
protected string $localCloudId = '';
public function __construct() {
$this->addType('userId', 'string');
$this->addType('state', 'int');
$this->addType('localRoomId', 'int');
$this->addType('accessToken', 'string');
$this->addType('remoteServerUrl', 'string');
$this->addType('remoteToken', 'string');
$this->addType('remoteAttendeeId', 'int');
$this->addType('inviterCloudId', 'string');
$this->addType('inviterDisplayName', 'string');
$this->addType('localCloudId', 'string');
}
/**
* @return array{id: int, localCloudId: string, remoteAttendeeId: int, remoteServerUrl: string, remoteToken: string, state: int, userId: string, inviterCloudId: string, inviterDisplayName: string}
*/
public function jsonSerialize(): array {
return [
'id' => $this->getId(),
'userId' => $this->getUserId(),
'state' => $this->getState(),
'localCloudId' => $this->getLocalCloudId(),
'remoteServerUrl' => $this->getRemoteServerUrl(),
'remoteToken' => $this->getRemoteToken(),
'remoteAttendeeId' => $this->getRemoteAttendeeId(),
'inviterCloudId' => $this->getInviterCloudId(),
'inviterDisplayName' => $this->getInviterDisplayName() ?: $this->getInviterCloudId(),
];
}
}