//
// Code generated by https://github.com/kubernetes-client/csharp/tree/master/gen/KubernetesGenerator
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
//
namespace k8s
{
using Models;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
///
/// Extension methods for Kubernetes.
///
public static partial class KubernetesExtensions
{
{{#.}}
///
/// {{ToXmlDoc operation.description}}
///
///
/// The operations group for this extension method.
///
{{#operation.parameters}}
///
/// {{ToXmlDoc description}}
///
{{/operation.parameters}}
public static {{GetReturnType operation "void"}} {{GetMethodName operation ""}}(
this IKubernetes operations
{{#operation.parameters}}
,{{GetDotNetType .}} {{GetDotNetName . "true"}}
{{/operation.parameters}}
)
{
{{GetReturnType operation "return"}} operations.{{GetMethodName operation "Async"}}(
{{#operation.parameters}}
{{GetDotNetName .}},
{{/operation.parameters}}
CancellationToken.None
).GetAwaiter().GetResult();
}
///
/// {{ToXmlDoc operation.description}}
///
///
/// The operations group for this extension method.
///
{{#operation.parameters}}
///
/// {{ToXmlDoc description}}
///
{{/operation.parameters}}
///
/// A which can be used to cancel the asynchronous operation.
///
public static async Task{{GetReturnType operation "<>"}} {{GetMethodName operation "Async"}}(
this IKubernetes operations,
{{#operation.parameters}}
{{GetDotNetType .}} {{GetDotNetName . "true"}},
{{/operation.parameters}}
CancellationToken cancellationToken = default(CancellationToken))
{
{{#IfReturnType operation "stream"}}
var _result = await operations.{{GetMethodName operation "WithHttpMessagesAsync"}}(
{{#operation.parameters}}
{{GetDotNetName .}},
{{/operation.parameters}}
null,
cancellationToken);
_result.Request.Dispose();
{{GetReturnType operation "_result.Body"}};
{{/IfReturnType operation "stream"}}
{{#IfReturnType operation "obj"}}
using (var _result = await operations.{{GetMethodName operation "WithHttpMessagesAsync"}}(
{{#operation.parameters}}
{{GetDotNetName .}},
{{/operation.parameters}}
null,
cancellationToken).ConfigureAwait(false))
{
{{GetReturnType operation "_result.Body"}};
}
{{/IfReturnType operation "obj"}}
{{#IfReturnType operation "void"}}
using (var _result = await operations.{{GetMethodName operation "WithHttpMessagesAsync"}}(
{{#operation.parameters}}
{{GetDotNetName .}},
{{/operation.parameters}}
null,
cancellationToken).ConfigureAwait(false))
{
}
{{/IfReturnType operation "void"}}
}
{{/.}}
}
}