aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Federation/ICloudIdResolver.php
blob: 79f9ed11dd75e1d1122b4784dd3cffd988f3d530 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php

declare(strict_types=1);

/**
 * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-only
 */
namespace OCP\Federation;

use OCP\AppFramework\Attribute\Consumable;
use OCP\AppFramework\Attribute\Implementable;

/**
 * Interface for resolving federated cloud ids
 *
 * @since 32.0.0
 */
#[Consumable(since: '32.0.0')]
#[Implementable(since: '32.0.0')]
interface ICloudIdResolver {
	/**
	 * @param string $cloudId
	 * @return ICloudId
	 * @throws \InvalidArgumentException
	 *
	 * @since 32.0.0
	 */
	public function resolveCloudId(string $cloudId): ICloudId;

	/**
	 * Check if the input is a correctly formatted cloud id
	 *
	 * @param string $cloudId
	 * @return bool
	 *
	 * @since 32.0.0
	 */
	public function isValidCloudId(string $cloudId): bool;
}