1<?php
2
3declare(strict_types = 1);
4/**
5 * Class RegisteredNamespaceInterface
6 *
7 * @category Elasticsearch
8 * @package  Elasticsearch\Namespaces
9 * @author   Zachary Tong <zach@elastic.co>
10 * @license  http://www.apache.org/licenses/LICENSE-2.0 Apache2
11 * @link     http://elastic.co
12 */
13
14namespace Elasticsearch\Namespaces;
15
16use Elasticsearch\Serializers\SerializerInterface;
17use Elasticsearch\Transport;
18
19interface NamespaceBuilderInterface
20{
21    /**
22     * Returns the name of the namespace.  This is what users will call, e.g. the name
23     * "foo" will be invoked by the user as `$client->foo()`
24     */
25    public function getName(): string;
26
27    /**
28     * Returns the actual namespace object which contains your custom methods. The transport
29     * and serializer objects are provided so that your namespace may do whatever custom
30     * logic is required.
31     *
32     * @param  Transport           $transport
33     * @param  SerializerInterface $serializer
34     * @return Object
35     */
36    public function getObject(Transport $transport, SerializerInterface $serializer);
37}
38