<?php

declare(strict_types=1);

/**
 * SPDX-License-Identifier: Apache-2.0
 *
 * The OpenSearch Contributors require contributions made to
 * this file be licensed under the Apache-2.0 license or a
 * compatible open source license.
 *
 * Modifications Copyright OpenSearch Contributors. See
 * GitHub history for details.
 */

namespace OpenSearch\Namespaces;

use OpenSearch\Endpoints\SearchRelevance\DeleteExperiments;
use OpenSearch\Endpoints\SearchRelevance\DeleteJudgments;
use OpenSearch\Endpoints\SearchRelevance\DeleteQuerySets;
use OpenSearch\Endpoints\SearchRelevance\DeleteScheduledExperiments;
use OpenSearch\Endpoints\SearchRelevance\DeleteSearchConfigurations;
use OpenSearch\Endpoints\SearchRelevance\GetExperiments;
use OpenSearch\Endpoints\SearchRelevance\GetJudgments;
use OpenSearch\Endpoints\SearchRelevance\GetNodeStats;
use OpenSearch\Endpoints\SearchRelevance\GetQuerySets;
use OpenSearch\Endpoints\SearchRelevance\GetScheduledExperiments;
use OpenSearch\Endpoints\SearchRelevance\GetSearchConfigurations;
use OpenSearch\Endpoints\SearchRelevance\GetStats;
use OpenSearch\Endpoints\SearchRelevance\PostQuerySets;
use OpenSearch\Endpoints\SearchRelevance\PostScheduledExperiments;
use OpenSearch\Endpoints\SearchRelevance\PutExperiments;
use OpenSearch\Endpoints\SearchRelevance\PutJudgments;
use OpenSearch\Endpoints\SearchRelevance\PutQuerySets;
use OpenSearch\Endpoints\SearchRelevance\PutSearchConfigurations;

/**
 * Class SearchRelevanceNamespace
 *
 * NOTE: This file is autogenerated using util/GenerateEndpoints.php
 */
class SearchRelevanceNamespace extends AbstractNamespace
{
    /**
     * Deletes a specified experiment.
     *
     * @param array{experiment_id?: string, pretty?: bool, human?: bool, error_trace?: bool, source?: string, filter_path?: mixed} $params
     * - experiment_id: The experiment id
     * - pretty: Whether to pretty-format the returned JSON response. (Default: false)
     * - human: Whether to return human-readable values for statistics. (Default: false)
     * - error_trace: Whether to include the stack trace of returned errors. (Default: false)
     * - source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
     * - filter_path: A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
     * @return array
     */
    public function deleteExperiments(array $params = [])
    {
        $experiment_id = $this->extractArgument($params, 'experiment_id');

        $endpoint = $this->endpointFactory->getEndpoint(DeleteExperiments::class);
        $endpoint->setParams($params);
        $endpoint->setExperimentId($experiment_id);

        return $this->performRequest($endpoint);
    }

    /**
     * Deletes a specified judgment.
     *
     * @param array{judgment_id?: string, pretty?: bool, human?: bool, error_trace?: bool, source?: string, filter_path?: mixed} $params
     * - judgment_id: The judgment id
     * - pretty: Whether to pretty-format the returned JSON response. (Default: false)
     * - human: Whether to return human-readable values for statistics. (Default: false)
     * - error_trace: Whether to include the stack trace of returned errors. (Default: false)
     * - source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
     * - filter_path: A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
     * @return array
     */
    public function deleteJudgments(array $params = [])
    {
        $judgment_id = $this->extractArgument($params, 'judgment_id');

        $endpoint = $this->endpointFactory->getEndpoint(DeleteJudgments::class);
        $endpoint->setParams($params);
        $endpoint->setJudgmentId($judgment_id);

        return $this->performRequest($endpoint);
    }

    /**
     * Deletes a query set.
     *
     * @param array{query_set_id?: string, pretty?: bool, human?: bool, error_trace?: bool, source?: string, filter_path?: mixed} $params
     * - query_set_id: The query set id
     * - pretty: Whether to pretty-format the returned JSON response. (Default: false)
     * - human: Whether to return human-readable values for statistics. (Default: false)
     * - error_trace: Whether to include the stack trace of returned errors. (Default: false)
     * - source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
     * - filter_path: A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
     * @return array
     */
    public function deleteQuerySets(array $params = [])
    {
        $query_set_id = $this->extractArgument($params, 'query_set_id');

        $endpoint = $this->endpointFactory->getEndpoint(DeleteQuerySets::class);
        $endpoint->setParams($params);
        $endpoint->setQuerySetId($query_set_id);

        return $this->performRequest($endpoint);
    }

    /**
     * Deletes a specified scheduled experiment.
     *
     * @param array{experiment_id?: string, pretty?: bool, human?: bool, error_trace?: bool, source?: string, filter_path?: mixed} $params
     * - experiment_id: The experiment id
     * - pretty: Whether to pretty-format the returned JSON response. (Default: false)
     * - human: Whether to return human-readable values for statistics. (Default: false)
     * - error_trace: Whether to include the stack trace of returned errors. (Default: false)
     * - source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
     * - filter_path: A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
     * @return array
     */
    public function deleteScheduledExperiments(array $params = [])
    {
        $experiment_id = $this->extractArgument($params, 'experiment_id');

        $endpoint = $this->endpointFactory->getEndpoint(DeleteScheduledExperiments::class);
        $endpoint->setParams($params);
        $endpoint->setExperimentId($experiment_id);

        return $this->performRequest($endpoint);
    }

    /**
     * Deletes a specified search configuration.
     *
     * @param array{search_configuration_id?: string, pretty?: bool, human?: bool, error_trace?: bool, source?: string, filter_path?: mixed} $params
     * - search_configuration_id: The search configuration id
     * - pretty: Whether to pretty-format the returned JSON response. (Default: false)
     * - human: Whether to return human-readable values for statistics. (Default: false)
     * - error_trace: Whether to include the stack trace of returned errors. (Default: false)
     * - source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
     * - filter_path: A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
     * @return array
     */
    public function deleteSearchConfigurations(array $params = [])
    {
        $search_configuration_id = $this->extractArgument($params, 'search_configuration_id');

        $endpoint = $this->endpointFactory->getEndpoint(DeleteSearchConfigurations::class);
        $endpoint->setParams($params);
        $endpoint->setSearchConfigurationId($search_configuration_id);

        return $this->performRequest($endpoint);
    }

    /**
     * Gets experiments.
     *
     * @param array{experiment_id?: string, pretty?: bool, human?: bool, error_trace?: bool, source?: string, filter_path?: mixed} $params
     * - experiment_id: The experiment id
     * - pretty: Whether to pretty-format the returned JSON response. (Default: false)
     * - human: Whether to return human-readable values for statistics. (Default: false)
     * - error_trace: Whether to include the stack trace of returned errors. (Default: false)
     * - source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
     * - filter_path: A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
     * @return array
     */
    public function getExperiments(array $params = [])
    {
        $experiment_id = $this->extractArgument($params, 'experiment_id');

        $endpoint = $this->endpointFactory->getEndpoint(GetExperiments::class);
        $endpoint->setParams($params);
        $endpoint->setExperimentId($experiment_id);

        return $this->performRequest($endpoint);
    }

    /**
     * Gets judgments.
     *
     * @param array{judgment_id?: string, pretty?: bool, human?: bool, error_trace?: bool, source?: string, filter_path?: mixed} $params
     * - judgment_id: The judgment id
     * - pretty: Whether to pretty-format the returned JSON response. (Default: false)
     * - human: Whether to return human-readable values for statistics. (Default: false)
     * - error_trace: Whether to include the stack trace of returned errors. (Default: false)
     * - source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
     * - filter_path: A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
     * @return array
     */
    public function getJudgments(array $params = [])
    {
        $judgment_id = $this->extractArgument($params, 'judgment_id');

        $endpoint = $this->endpointFactory->getEndpoint(GetJudgments::class);
        $endpoint->setParams($params);
        $endpoint->setJudgmentId($judgment_id);

        return $this->performRequest($endpoint);
    }

    /**
     * Gets stats by node.
     *
     * @param array{node_id?: string, stat?: string, flat_stat_paths?: string, include_all_nodes?: string, include_individual_nodes?: string, include_info?: string, include_metadata?: string, pretty?: bool, human?: bool, error_trace?: bool, source?: string, filter_path?: mixed} $params
     * - node_id: The node id
     * - stat: The statistic to return
     * - flat_stat_paths: Requests flattened stat paths as keys
     * - include_all_nodes: Whether to include all nodes
     * - include_individual_nodes: Whether to include individual nodes
     * - include_info: Whether to include info
     * - include_metadata: Whether to include metadata
     * - pretty: Whether to pretty-format the returned JSON response. (Default: false)
     * - human: Whether to return human-readable values for statistics. (Default: false)
     * - error_trace: Whether to include the stack trace of returned errors. (Default: false)
     * - source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
     * - filter_path: A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
     * @return array
     */
    public function getNodeStats(array $params = [])
    {
        $node_id = $this->extractArgument($params, 'node_id');
        $stat = $this->extractArgument($params, 'stat');

        $endpoint = $this->endpointFactory->getEndpoint(GetNodeStats::class);
        $endpoint->setParams($params);
        $endpoint->setNodeId($node_id);
        $endpoint->setStat($stat);

        return $this->performRequest($endpoint);
    }

    /**
     * Lists the current query sets available.
     *
     * @param array{query_set_id?: string, pretty?: bool, human?: bool, error_trace?: bool, source?: string, filter_path?: mixed} $params
     * - query_set_id: The query set id
     * - pretty: Whether to pretty-format the returned JSON response. (Default: false)
     * - human: Whether to return human-readable values for statistics. (Default: false)
     * - error_trace: Whether to include the stack trace of returned errors. (Default: false)
     * - source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
     * - filter_path: A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
     * @return array
     */
    public function getQuerySets(array $params = [])
    {
        $query_set_id = $this->extractArgument($params, 'query_set_id');

        $endpoint = $this->endpointFactory->getEndpoint(GetQuerySets::class);
        $endpoint->setParams($params);
        $endpoint->setQuerySetId($query_set_id);

        return $this->performRequest($endpoint);
    }

    /**
     * Gets the scheduled experiments.
     *
     * @param array{experiment_id?: string, pretty?: bool, human?: bool, error_trace?: bool, source?: string, filter_path?: mixed} $params
     * - experiment_id: The experiment id
     * - pretty: Whether to pretty-format the returned JSON response. (Default: false)
     * - human: Whether to return human-readable values for statistics. (Default: false)
     * - error_trace: Whether to include the stack trace of returned errors. (Default: false)
     * - source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
     * - filter_path: A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
     * @return array
     */
    public function getScheduledExperiments(array $params = [])
    {
        $experiment_id = $this->extractArgument($params, 'experiment_id');

        $endpoint = $this->endpointFactory->getEndpoint(GetScheduledExperiments::class);
        $endpoint->setParams($params);
        $endpoint->setExperimentId($experiment_id);

        return $this->performRequest($endpoint);
    }

    /**
     * Gets the search configurations.
     *
     * @param array{search_configuration_id?: string, pretty?: bool, human?: bool, error_trace?: bool, source?: string, filter_path?: mixed} $params
     * - search_configuration_id: The search configuration id
     * - pretty: Whether to pretty-format the returned JSON response. (Default: false)
     * - human: Whether to return human-readable values for statistics. (Default: false)
     * - error_trace: Whether to include the stack trace of returned errors. (Default: false)
     * - source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
     * - filter_path: A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
     * @return array
     */
    public function getSearchConfigurations(array $params = [])
    {
        $search_configuration_id = $this->extractArgument($params, 'search_configuration_id');

        $endpoint = $this->endpointFactory->getEndpoint(GetSearchConfigurations::class);
        $endpoint->setParams($params);
        $endpoint->setSearchConfigurationId($search_configuration_id);

        return $this->performRequest($endpoint);
    }

    /**
     * Gets stats.
     *
     * @param array{stat?: string, flat_stat_paths?: string, include_all_nodes?: string, include_individual_nodes?: string, include_info?: string, include_metadata?: string, pretty?: bool, human?: bool, error_trace?: bool, source?: string, filter_path?: mixed} $params
     * - stat: The statistic to return
     * - flat_stat_paths: Requests flattened stat paths as keys
     * - include_all_nodes: Whether to include all nodes
     * - include_individual_nodes: Whether to include individual nodes
     * - include_info: Whether to include info
     * - include_metadata: Whether to include metadata
     * - pretty: Whether to pretty-format the returned JSON response. (Default: false)
     * - human: Whether to return human-readable values for statistics. (Default: false)
     * - error_trace: Whether to include the stack trace of returned errors. (Default: false)
     * - source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
     * - filter_path: A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
     * @return array
     */
    public function getStats(array $params = [])
    {
        $stat = $this->extractArgument($params, 'stat');

        $endpoint = $this->endpointFactory->getEndpoint(GetStats::class);
        $endpoint->setParams($params);
        $endpoint->setStat($stat);

        return $this->performRequest($endpoint);
    }

    /**
     * Creates a new query set by sampling queries from the user behavior data.
     *
     * @param array{pretty?: bool, human?: bool, error_trace?: bool, source?: string, filter_path?: mixed, body?: mixed} $params
     * - pretty: Whether to pretty-format the returned JSON response. (Default: false)
     * - human: Whether to return human-readable values for statistics. (Default: false)
     * - error_trace: Whether to include the stack trace of returned errors. (Default: false)
     * - source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
     * - filter_path: A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
     * - body:
     * @return array
     */
    public function postQuerySets(array $params = [])
    {
        $body = $this->extractArgument($params, 'body');

        $endpoint = $this->endpointFactory->getEndpoint(PostQuerySets::class);
        $endpoint->setParams($params);
        $endpoint->setBody($body);

        return $this->performRequest($endpoint);
    }

    /**
     * Creates a scheduled experiment.
     *
     * @param array{pretty?: bool, human?: bool, error_trace?: bool, source?: string, filter_path?: mixed, body?: mixed} $params
     * - pretty: Whether to pretty-format the returned JSON response. (Default: false)
     * - human: Whether to return human-readable values for statistics. (Default: false)
     * - error_trace: Whether to include the stack trace of returned errors. (Default: false)
     * - source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
     * - filter_path: A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
     * - body:
     * @return array
     */
    public function postScheduledExperiments(array $params = [])
    {
        $body = $this->extractArgument($params, 'body');

        $endpoint = $this->endpointFactory->getEndpoint(PostScheduledExperiments::class);
        $endpoint->setParams($params);
        $endpoint->setBody($body);

        return $this->performRequest($endpoint);
    }

    /**
     * Creates an experiment.
     *
     * @param array{pretty?: bool, human?: bool, error_trace?: bool, source?: string, filter_path?: mixed, body?: mixed} $params
     * - pretty: Whether to pretty-format the returned JSON response. (Default: false)
     * - human: Whether to return human-readable values for statistics. (Default: false)
     * - error_trace: Whether to include the stack trace of returned errors. (Default: false)
     * - source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
     * - filter_path: A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
     * - body:
     * @return array
     */
    public function putExperiments(array $params = [])
    {
        $body = $this->extractArgument($params, 'body');

        $endpoint = $this->endpointFactory->getEndpoint(PutExperiments::class);
        $endpoint->setParams($params);
        $endpoint->setBody($body);

        return $this->performRequest($endpoint);
    }

    /**
     * Creates a judgment.
     *
     * @param array{pretty?: bool, human?: bool, error_trace?: bool, source?: string, filter_path?: mixed, body?: mixed} $params
     * - pretty: Whether to pretty-format the returned JSON response. (Default: false)
     * - human: Whether to return human-readable values for statistics. (Default: false)
     * - error_trace: Whether to include the stack trace of returned errors. (Default: false)
     * - source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
     * - filter_path: A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
     * - body:
     * @return array
     */
    public function putJudgments(array $params = [])
    {
        $body = $this->extractArgument($params, 'body');

        $endpoint = $this->endpointFactory->getEndpoint(PutJudgments::class);
        $endpoint->setParams($params);
        $endpoint->setBody($body);

        return $this->performRequest($endpoint);
    }

    /**
     * Creates a new query set by uploading manually.
     *
     * @param array{pretty?: bool, human?: bool, error_trace?: bool, source?: string, filter_path?: mixed, body?: mixed} $params
     * - pretty: Whether to pretty-format the returned JSON response. (Default: false)
     * - human: Whether to return human-readable values for statistics. (Default: false)
     * - error_trace: Whether to include the stack trace of returned errors. (Default: false)
     * - source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
     * - filter_path: A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
     * - body:
     * @return array
     */
    public function putQuerySets(array $params = [])
    {
        $body = $this->extractArgument($params, 'body');

        $endpoint = $this->endpointFactory->getEndpoint(PutQuerySets::class);
        $endpoint->setParams($params);
        $endpoint->setBody($body);

        return $this->performRequest($endpoint);
    }

    /**
     * Creates a search configuration.
     *
     * @param array{pretty?: bool, human?: bool, error_trace?: bool, source?: string, filter_path?: mixed, body?: mixed} $params
     * - pretty: Whether to pretty-format the returned JSON response. (Default: false)
     * - human: Whether to return human-readable values for statistics. (Default: false)
     * - error_trace: Whether to include the stack trace of returned errors. (Default: false)
     * - source: The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.
     * - filter_path: A comma-separated list of filters used to filter the response. Use wildcards to match any field or part of a field's name. To exclude fields, use `-`.
     * - body:
     * @return array
     */
    public function putSearchConfigurations(array $params = [])
    {
        $body = $this->extractArgument($params, 'body');

        $endpoint = $this->endpointFactory->getEndpoint(PutSearchConfigurations::class);
        $endpoint->setParams($params);
        $endpoint->setBody($body);

        return $this->performRequest($endpoint);
    }

}
