7
7
namespace k8s;
8
8
9
9
public partial class AbstractKubernetes : I{{name}}Operations
10
- {
10
+ {
11
11
{{#apis}}
12
12
/// <inheritdoc/>
13
13
async Task<HttpOperationResponse{{GetReturnType operation "<>"}}> I{{name}}Operations.{{GetMethodName operation "WithHttpMessagesAsync"}}(
@@ -17,7 +17,7 @@ public partial class AbstractKubernetes : I{{name}}Operations
17
17
IReadOnlyDictionary<string, IReadOnlyList<string>> customHeaders,
18
18
CancellationToken cancellationToken)
19
19
{
20
- var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
20
+ using var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
21
21
cts.CancelAfter(HttpClientTimeout);
22
22
{{#IfParamContains operation "watch"}}
23
23
if (watch == true)
@@ -58,13 +58,13 @@ public partial class AbstractKubernetes : I{{name}}Operations
58
58
{{#IfParamDoesNotContain operation "body"}}
59
59
var httpResponse = await SendRequest<object>(url, HttpMethods.{{Method}}, customHeaders, null, cancellationToken);
60
60
{{/IfParamDoesNotContain operation "body"}}
61
- // Create Result
61
+ // Create Result
62
62
var httpRequest = httpResponse.RequestMessage;
63
63
{{#IfReturnType operation "void"}}
64
64
HttpOperationResponse result = new HttpOperationResponse() { Request = httpRequest, Response = httpResponse };
65
65
{{/IfReturnType operation "void"}}
66
66
{{#IfReturnType operation "obj"}}
67
- var result = await CreateResultAsync{{GetReturnType operation "<>"}}(
67
+ var result = await CreateResultAsync{{GetReturnType operation "<>"}}(
68
68
httpRequest,
69
69
httpResponse,
70
70
{{#IfParamContains operation "watch"}}
0 commit comments