/* 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.
*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
// -----------------------------------------------
//
// This file is automatically generated
// Please do not edit these files manually
// Run the following in the root of the repos:
//
// *NIX : ./build.sh codegen
// Windows : build.bat codegen
//
// -----------------------------------------------
// ReSharper disable RedundantUsingDirective
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using OpenSearch.Net;
using OpenSearch.Net.Utf8Json;
using OpenSearch.Net.Specification.TasksApi;
// ReSharper disable RedundantBaseConstructorCall
// ReSharper disable UnusedTypeParameter
// ReSharper disable PartialMethodWithSinglePart
// ReSharper disable RedundantNameQualifier
namespace OpenSearch.Client.Specification.TasksApi
{
///Descriptor for Cancel https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/
public partial class CancelTasksDescriptor : RequestDescriptorBase, ICancelTasksRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.TasksCancel;
////_tasks/_cancel
public CancelTasksDescriptor(): base()
{
}
////_tasks/{task_id}/_cancel
///Optional, accepts null
public CancelTasksDescriptor(TaskId taskId): base(r => r.Optional("task_id", taskId))
{
}
// values part of the url path
TaskId ICancelTasksRequest.TaskId => Self.RouteValues.Get("task_id");
///Cancel the task with specified task id (node_id:task_number)
public CancelTasksDescriptor TaskId(TaskId taskId) => Assign(taskId, (a, v) => a.RouteValues.Optional("task_id", v));
// Request parameters
///A comma-separated list of actions that should be cancelled. Leave empty to cancel all.
public CancelTasksDescriptor Actions(params string[] actions) => Qs("actions", actions);
///A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
public CancelTasksDescriptor Nodes(params string[] nodes) => Qs("nodes", nodes);
///Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all.
public CancelTasksDescriptor ParentTaskId(string parenttaskid) => Qs("parent_task_id", parenttaskid);
///Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false
public CancelTasksDescriptor WaitForCompletion(bool? waitforcompletion = true) => Qs("wait_for_completion", waitforcompletion);
}
///Descriptor for GetTask https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/
public partial class GetTaskDescriptor : RequestDescriptorBase, IGetTaskRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.TasksGetTask;
////_tasks/{task_id}
///this parameter is required
public GetTaskDescriptor(TaskId taskId): base(r => r.Required("task_id", taskId))
{
}
///Used for serialization purposes, making sure we have a parameterless constructor
[SerializationConstructor]
protected GetTaskDescriptor(): base()
{
}
// values part of the url path
TaskId IGetTaskRequest.TaskId => Self.RouteValues.Get("task_id");
// Request parameters
///Explicit operation timeout
public GetTaskDescriptor Timeout(Time timeout) => Qs("timeout", timeout);
///Wait for the matching tasks to complete (default: false)
public GetTaskDescriptor WaitForCompletion(bool? waitforcompletion = true) => Qs("wait_for_completion", waitforcompletion);
}
///Descriptor for List https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-tasks/
public partial class ListTasksDescriptor : RequestDescriptorBase, IListTasksRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.TasksList;
// values part of the url path
// Request parameters
///A comma-separated list of actions that should be returned. Leave empty to return all.
public ListTasksDescriptor Actions(params string[] actions) => Qs("actions", actions);
///Return detailed task information (default: false)
public ListTasksDescriptor Detailed(bool? detailed = true) => Qs("detailed", detailed);
///Group tasks by nodes or parent/child relationships
public ListTasksDescriptor GroupBy(GroupBy? groupby) => Qs("group_by", groupby);
///A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes
public ListTasksDescriptor Nodes(params string[] nodes) => Qs("nodes", nodes);
///Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all.
public ListTasksDescriptor ParentTaskId(string parenttaskid) => Qs("parent_task_id", parenttaskid);
///Explicit operation timeout
public ListTasksDescriptor Timeout(Time timeout) => Qs("timeout", timeout);
///Wait for the matching tasks to complete (default: false)
public ListTasksDescriptor WaitForCompletion(bool? waitforcompletion = true) => Qs("wait_for_completion", waitforcompletion);
}
}