1+ // Licensed to Elasticsearch B.V under one or more agreements.
2+ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+ // See the LICENSE file in the project root for more information.
4+ //
5+ // ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
6+ // ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
7+ // ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
8+ // ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
9+ // ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
10+ // ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
11+ // ------------------------------------------------
12+ //
13+ // This file is automatically generated.
14+ // Please do not edit these files manually.
15+ //
16+ // ------------------------------------------------
17+
18+ #nullable restore
19+
20+ using Elastic . Clients . Elasticsearch . Fluent ;
21+ using Elastic . Clients . Elasticsearch . Requests ;
22+ using Elastic . Clients . Elasticsearch . Serialization ;
23+ using Elastic . Transport ;
24+ using System ;
25+ using System . Collections . Generic ;
26+ using System . Linq . Expressions ;
27+ using System . Text . Json ;
28+ using System . Text . Json . Serialization ;
29+
30+ namespace Elastic . Clients . Elasticsearch . Tasks ;
31+
32+ public sealed class CancelRequestParameters : RequestParameters
33+ {
34+ /// <summary>
35+ /// <para>A comma-separated list of actions that should be cancelled. Leave empty to cancel all.</para>
36+ /// </summary>
37+ public ICollection < string > ? Actions { get => Q < ICollection < string > ? > ( "actions" ) ; set => Q ( "actions" , value ) ; }
38+
39+ /// <summary>
40+ /// <para>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</para>
41+ /// </summary>
42+ public ICollection < string > ? Nodes { get => Q < ICollection < string > ? > ( "nodes" ) ; set => Q ( "nodes" , value ) ; }
43+
44+ /// <summary>
45+ /// <para>Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all.</para>
46+ /// </summary>
47+ public string ? ParentTaskId { get => Q < string ? > ( "parent_task_id" ) ; set => Q ( "parent_task_id" , value ) ; }
48+
49+ /// <summary>
50+ /// <para>Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false</para>
51+ /// </summary>
52+ public bool ? WaitForCompletion { get => Q < bool ? > ( "wait_for_completion" ) ; set => Q ( "wait_for_completion" , value ) ; }
53+ }
54+
55+ /// <summary>
56+ /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely.
57+ /// <para>Cancels a task, if it can be cancelled through an API.</para>
58+ /// </summary>
59+ public sealed partial class CancelRequest : PlainRequest < CancelRequestParameters >
60+ {
61+ public CancelRequest ( )
62+ {
63+ }
64+
65+ public CancelRequest ( Elastic . Clients . Elasticsearch . TaskId ? task_id ) : base ( r => r . Optional ( "task_id" , task_id ) )
66+ {
67+ }
68+
69+ internal override ApiUrls ApiUrls => ApiUrlLookup . TasksCancel ;
70+
71+ protected override HttpMethod StaticHttpMethod => HttpMethod . POST ;
72+
73+ internal override bool SupportsBody => false ;
74+
75+ /// <summary>
76+ /// <para>A comma-separated list of actions that should be cancelled. Leave empty to cancel all.</para>
77+ /// </summary>
78+ [ JsonIgnore ]
79+ public ICollection < string > ? Actions { get => Q < ICollection < string > ? > ( "actions" ) ; set => Q ( "actions" , value ) ; }
80+
81+ /// <summary>
82+ /// <para>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</para>
83+ /// </summary>
84+ [ JsonIgnore ]
85+ public ICollection < string > ? Nodes { get => Q < ICollection < string > ? > ( "nodes" ) ; set => Q ( "nodes" , value ) ; }
86+
87+ /// <summary>
88+ /// <para>Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all.</para>
89+ /// </summary>
90+ [ JsonIgnore ]
91+ public string ? ParentTaskId { get => Q < string ? > ( "parent_task_id" ) ; set => Q ( "parent_task_id" , value ) ; }
92+
93+ /// <summary>
94+ /// <para>Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false</para>
95+ /// </summary>
96+ [ JsonIgnore ]
97+ public bool ? WaitForCompletion { get => Q < bool ? > ( "wait_for_completion" ) ; set => Q ( "wait_for_completion" , value ) ; }
98+ }
99+
100+ /// <summary>
101+ /// EXPERIMENTAL! May change in ways that are not backwards compatible or be removed entirely.
102+ /// <para>Cancels a task, if it can be cancelled through an API.</para>
103+ /// </summary>
104+ public sealed partial class CancelRequestDescriptor : RequestDescriptor < CancelRequestDescriptor , CancelRequestParameters >
105+ {
106+ internal CancelRequestDescriptor ( Action < CancelRequestDescriptor > configure ) => configure . Invoke ( this ) ;
107+
108+ public CancelRequestDescriptor ( )
109+ {
110+ }
111+
112+ internal override ApiUrls ApiUrls => ApiUrlLookup . TasksCancel ;
113+
114+ protected override HttpMethod StaticHttpMethod => HttpMethod . POST ;
115+
116+ internal override bool SupportsBody => false ;
117+
118+ public CancelRequestDescriptor Actions ( ICollection < string > ? actions ) => Qs ( "actions" , actions ) ;
119+ public CancelRequestDescriptor Nodes ( ICollection < string > ? nodes ) => Qs ( "nodes" , nodes ) ;
120+ public CancelRequestDescriptor ParentTaskId ( string ? parentTaskId ) => Qs ( "parent_task_id" , parentTaskId ) ;
121+ public CancelRequestDescriptor WaitForCompletion ( bool ? waitForCompletion = true ) => Qs ( "wait_for_completion" , waitForCompletion ) ;
122+
123+ public CancelRequestDescriptor TaskId ( Elastic . Clients . Elasticsearch . TaskId ? task_id )
124+ {
125+ RouteValues . Optional ( "task_id" , task_id ) ;
126+ return Self ;
127+ }
128+
129+ protected override void Serialize ( Utf8JsonWriter writer , JsonSerializerOptions options , IElasticsearchClientSettings settings )
130+ {
131+ }
132+ }
0 commit comments