summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/rest/src/RestResourceConfigInterface.php
blob: 601bb0edc9ef37b7396e2eb6e0cbdad2665d4ae1 (plain) (blame)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php

namespace Drupal\rest;

use Drupal\Core\Config\Entity\ConfigEntityInterface;
use Drupal\Core\Entity\EntityWithPluginCollectionInterface;

/**
 * Defines a configuration entity to store enabled REST resources.
 */
interface RestResourceConfigInterface extends ConfigEntityInterface, EntityWithPluginCollectionInterface {

  /**
   * Granularity value for per-method configuration.
   */
  const METHOD_GRANULARITY = 'method';

  /**
   * Granularity value for per-resource configuration.
   */
  const RESOURCE_GRANULARITY = 'resource';

  /**
   * Retrieves the REST resource plugin.
   *
   * @return \Drupal\rest\Plugin\ResourceInterface
   *   The resource plugin
   */
  public function getResourcePlugin();

  /**
   * Retrieves a list of supported HTTP methods.
   *
   * @return string[]
   *   A list of supported HTTP methods.
   */
  public function getMethods();

  /**
   * Retrieves a list of supported authentication providers.
   *
   * @param string $method
   *   The request method e.g GET or POST.
   *
   * @return string[]
   *   A list of supported authentication provider IDs.
   */
  public function getAuthenticationProviders($method);

  /**
   * Retrieves a list of supported response formats.
   *
   * @param string $method
   *   The request method e.g GET or POST.
   *
   * @return string[]
   *   A list of supported format IDs.
   */
  public function getFormats($method);

}