1<?php
2/**
3 * Elasticsearch PHP client
4 *
5 * @link      https://github.com/elastic/elasticsearch-php/
6 * @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
7 * @license   http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
8 * @license   https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1
9 *
10 * Licensed to Elasticsearch B.V under one or more agreements.
11 * Elasticsearch B.V licenses this file to you under the Apache 2.0 License or
12 * the GNU Lesser General Public License, Version 2.1, at your option.
13 * See the LICENSE file in the project root for more information.
14 */
15
16
17declare(strict_types = 1);
18
19namespace Elasticsearch\Namespaces;
20
21use Elasticsearch\Serializers\SerializerInterface;
22use Elasticsearch\Transport;
23
24interface NamespaceBuilderInterface
25{
26    /**
27     * Returns the name of the namespace.  This is what users will call, e.g. the name
28     * "foo" will be invoked by the user as `$client->foo()`
29     */
30    public function getName(): string;
31
32    /**
33     * Returns the actual namespace object which contains your custom methods. The transport
34     * and serializer objects are provided so that your namespace may do whatever custom
35     * logic is required.
36     *
37     * @param  Transport           $transport
38     * @param  SerializerInterface $serializer
39     * @return Object
40     */
41    public function getObject(Transport $transport, SerializerInterface $serializer);
42}
43