port autorest2 template to local generate tools (#669)
* port autorest to watch generator * rename KubernetesWatchGenerator -> KubernetesGenerator * add validate * fix format * fix generate code warnings * fix line ending * fix missing property found by comp check * do not new http method
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// <auto-generated>
|
||||
// Code generated by gen/KubernetesWatchGenerator
|
||||
// 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.
|
||||
// </auto-generated>
|
||||
@@ -19,14 +19,14 @@ namespace k8s
|
||||
/// </summary>
|
||||
{{#operation.actualParameters}}
|
||||
{{#isRequired}}
|
||||
/// <param name="{{name}}">
|
||||
/// <param name="{{GetDotNetName name}}">
|
||||
/// {{ToXmlDoc description}}
|
||||
/// </param>
|
||||
{{/isRequired}}
|
||||
{{/operation.actualParameters}}
|
||||
{{#operation.actualParameters}}
|
||||
{{^isRequired}}
|
||||
/// <param name="{{name}}">
|
||||
/// <param name="{{GetDotNetName name}}">
|
||||
/// {{ToXmlDoc description}}
|
||||
/// </param>
|
||||
{{/isRequired}}
|
||||
@@ -52,7 +52,7 @@ namespace k8s
|
||||
Task<Watcher<{{GetClassName operation}}>> {{GetMethodName operation}}(
|
||||
{{#operation.actualParameters}}
|
||||
{{#isRequired}}
|
||||
{{GetDotNetType type name isRequired}} {{GetDotNetName name}},
|
||||
{{GetDotNetType type name isRequired format}} {{GetDotNetName name}},
|
||||
{{/isRequired}}
|
||||
{{/operation.actualParameters}}
|
||||
{{#operation.actualParameters}}
|
||||
67
gen/KubernetesGenerator/IKubernetes.cs.template
Normal file
67
gen/KubernetesGenerator/IKubernetes.cs.template
Normal file
@@ -0,0 +1,67 @@
|
||||
// <auto-generated>
|
||||
// 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.
|
||||
// </auto-generated>
|
||||
|
||||
namespace k8s
|
||||
{
|
||||
using Microsoft.Rest;
|
||||
using Models;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public partial interface IKubernetes : System.IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// The base URI of the service.
|
||||
/// </summary>
|
||||
System.Uri BaseUri { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets json serialization settings.
|
||||
/// </summary>
|
||||
JsonSerializerSettings SerializationSettings { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets json deserialization settings.
|
||||
/// </summary>
|
||||
JsonSerializerSettings DeserializationSettings { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Subscription credentials which uniquely identify client
|
||||
/// subscription.
|
||||
/// </summary>
|
||||
ServiceClientCredentials Credentials { get; }
|
||||
|
||||
{{#.}}
|
||||
/// <summary>
|
||||
/// {{ToXmlDoc operation.description}}
|
||||
/// </summary>
|
||||
{{#operation.parameters}}
|
||||
/// <param name="{{GetDotNetName .}}">
|
||||
/// {{ToXmlDoc description}}
|
||||
/// </param>
|
||||
{{/operation.parameters}}
|
||||
/// <param name="customHeaders">
|
||||
/// The headers that will be added to request.
|
||||
/// </param>
|
||||
/// <param name="cancellationToken">
|
||||
/// A <see cref="CancellationToken"/> which can be used to cancel the asynchronous operation.
|
||||
/// </param>
|
||||
Task<HttpOperationResponse{{GetReturnType operation "<>"}}> {{GetMethodName operation "WithHttpMessagesAsync"}}(
|
||||
{{#operation.parameters}}
|
||||
{{GetDotNetType .}} {{GetDotNetName . "true"}},
|
||||
{{/operation.parameters}}
|
||||
Dictionary<string, List<string>> customHeaders = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken));
|
||||
|
||||
{{/.}}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// <auto-generated>
|
||||
// Code generated by gen/KubernetesWatchGenerator
|
||||
// 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.
|
||||
// </auto-generated>
|
||||
@@ -18,7 +18,7 @@ namespace k8s
|
||||
public Task<Watcher<{{GetClassName operation}}>> {{GetMethodName operation}}(
|
||||
{{#operation.actualParameters}}
|
||||
{{#isRequired}}
|
||||
{{GetDotNetType type name isRequired}} {{GetDotNetName name}},
|
||||
{{GetDotNetType type name isRequired format}} {{GetDotNetName name}},
|
||||
{{/isRequired}}
|
||||
{{/operation.actualParameters}}
|
||||
{{#operation.actualParameters}}
|
||||
@@ -33,7 +33,7 @@ namespace k8s
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
string path = $"{{GetPathExpression .}}";
|
||||
return WatchObjectAsync<{{GetClassName operation}}>(path: path, @continue: @continue, fieldSelector: fieldSelector, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken);
|
||||
return WatchObjectAsync<{{GetClassName operation}}>(path: path, @continue: continueParameter, fieldSelector: fieldSelector, labelSelector: labelSelector, limit: limit, pretty: pretty, timeoutSeconds: timeoutSeconds, resourceVersion: resourceVersion, customHeaders: customHeaders, onEvent: onEvent, onError: onError, onClosed: onClosed, cancellationToken: cancellationToken);
|
||||
}
|
||||
|
||||
{{/.}}
|
||||
475
gen/KubernetesGenerator/Kubernetes.cs.template
Normal file
475
gen/KubernetesGenerator/Kubernetes.cs.template
Normal file
@@ -0,0 +1,475 @@
|
||||
// <auto-generated>
|
||||
// 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.
|
||||
// </auto-generated>
|
||||
|
||||
namespace k8s
|
||||
{
|
||||
using Microsoft.Rest;
|
||||
using Microsoft.Rest.Serialization;
|
||||
using Models;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public partial class Kubernetes : ServiceClient<Kubernetes>, IKubernetes
|
||||
{
|
||||
/// <summary>
|
||||
/// The base URI of the service.
|
||||
/// </summary>
|
||||
public System.Uri BaseUri { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets json serialization settings.
|
||||
/// </summary>
|
||||
public JsonSerializerSettings SerializationSettings { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets json deserialization settings.
|
||||
/// </summary>
|
||||
public JsonSerializerSettings DeserializationSettings { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Subscription credentials which uniquely identify client subscription.
|
||||
/// </summary>
|
||||
public ServiceClientCredentials Credentials { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Kubernetes class.
|
||||
/// </summary>
|
||||
/// <param name='httpClient'>
|
||||
/// HttpClient to be used
|
||||
/// </param>
|
||||
/// <param name='disposeHttpClient'>
|
||||
/// True: will dispose the provided httpClient on calling Kubernetes.Dispose(). False: will not dispose provided httpClient</param>
|
||||
protected Kubernetes(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Kubernetes class.
|
||||
/// </summary>
|
||||
/// <param name='handlers'>
|
||||
/// Optional. The delegating handlers to add to the http client pipeline.
|
||||
/// </param>
|
||||
protected Kubernetes(params DelegatingHandler[] handlers) : base(handlers)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Kubernetes class.
|
||||
/// </summary>
|
||||
/// <param name='rootHandler'>
|
||||
/// Optional. The http client handler used to handle http transport.
|
||||
/// </param>
|
||||
/// <param name='handlers'>
|
||||
/// Optional. The delegating handlers to add to the http client pipeline.
|
||||
/// </param>
|
||||
protected Kubernetes(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Kubernetes class.
|
||||
/// </summary>
|
||||
/// <param name='baseUri'>
|
||||
/// Optional. The base URI of the service.
|
||||
/// </param>
|
||||
/// <param name='handlers'>
|
||||
/// Optional. The delegating handlers to add to the http client pipeline.
|
||||
/// </param>
|
||||
/// <exception cref="System.ArgumentNullException">
|
||||
/// Thrown when a required parameter is null
|
||||
/// </exception>
|
||||
protected Kubernetes(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers)
|
||||
{
|
||||
if (baseUri == null)
|
||||
{
|
||||
throw new System.ArgumentNullException("baseUri");
|
||||
}
|
||||
BaseUri = baseUri;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Kubernetes class.
|
||||
/// </summary>
|
||||
/// <param name='baseUri'>
|
||||
/// Optional. The base URI of the service.
|
||||
/// </param>
|
||||
/// <param name='rootHandler'>
|
||||
/// Optional. The http client handler used to handle http transport.
|
||||
/// </param>
|
||||
/// <param name='handlers'>
|
||||
/// Optional. The delegating handlers to add to the http client pipeline.
|
||||
/// </param>
|
||||
/// <exception cref="System.ArgumentNullException">
|
||||
/// Thrown when a required parameter is null
|
||||
/// </exception>
|
||||
protected Kubernetes(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
|
||||
{
|
||||
if (baseUri == null)
|
||||
{
|
||||
throw new System.ArgumentNullException("baseUri");
|
||||
}
|
||||
BaseUri = baseUri;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Kubernetes class.
|
||||
/// </summary>
|
||||
/// <param name='credentials'>
|
||||
/// Required. Subscription credentials which uniquely identify client subscription.
|
||||
/// </param>
|
||||
/// <param name='handlers'>
|
||||
/// Optional. The delegating handlers to add to the http client pipeline.
|
||||
/// </param>
|
||||
/// <exception cref="System.ArgumentNullException">
|
||||
/// Thrown when a required parameter is null
|
||||
/// </exception>
|
||||
public Kubernetes(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
|
||||
{
|
||||
if (credentials == null)
|
||||
{
|
||||
throw new System.ArgumentNullException("credentials");
|
||||
}
|
||||
Credentials = credentials;
|
||||
if (Credentials != null)
|
||||
{
|
||||
Credentials.InitializeServiceClient(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Kubernetes class.
|
||||
/// </summary>
|
||||
/// <param name='credentials'>
|
||||
/// Required. Subscription credentials which uniquely identify client subscription.
|
||||
/// </param>
|
||||
/// <param name='httpClient'>
|
||||
/// HttpClient to be used
|
||||
/// </param>
|
||||
/// <param name='disposeHttpClient'>
|
||||
/// True: will dispose the provided httpClient on calling Kubernetes.Dispose(). False: will not dispose provided httpClient</param>
|
||||
/// <exception cref="System.ArgumentNullException">
|
||||
/// Thrown when a required parameter is null
|
||||
/// </exception>
|
||||
public Kubernetes(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient)
|
||||
{
|
||||
if (credentials == null)
|
||||
{
|
||||
throw new System.ArgumentNullException("credentials");
|
||||
}
|
||||
Credentials = credentials;
|
||||
if (Credentials != null)
|
||||
{
|
||||
Credentials.InitializeServiceClient(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Kubernetes class.
|
||||
/// </summary>
|
||||
/// <param name='credentials'>
|
||||
/// Required. Subscription credentials which uniquely identify client subscription.
|
||||
/// </param>
|
||||
/// <param name='rootHandler'>
|
||||
/// Optional. The http client handler used to handle http transport.
|
||||
/// </param>
|
||||
/// <param name='handlers'>
|
||||
/// Optional. The delegating handlers to add to the http client pipeline.
|
||||
/// </param>
|
||||
/// <exception cref="System.ArgumentNullException">
|
||||
/// Thrown when a required parameter is null
|
||||
/// </exception>
|
||||
public Kubernetes(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
|
||||
{
|
||||
if (credentials == null)
|
||||
{
|
||||
throw new System.ArgumentNullException("credentials");
|
||||
}
|
||||
Credentials = credentials;
|
||||
if (Credentials != null)
|
||||
{
|
||||
Credentials.InitializeServiceClient(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Kubernetes class.
|
||||
/// </summary>
|
||||
/// <param name='baseUri'>
|
||||
/// Optional. The base URI of the service.
|
||||
/// </param>
|
||||
/// <param name='credentials'>
|
||||
/// Required. Subscription credentials which uniquely identify client subscription.
|
||||
/// </param>
|
||||
/// <param name='handlers'>
|
||||
/// Optional. The delegating handlers to add to the http client pipeline.
|
||||
/// </param>
|
||||
/// <exception cref="System.ArgumentNullException">
|
||||
/// Thrown when a required parameter is null
|
||||
/// </exception>
|
||||
public Kubernetes(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
|
||||
{
|
||||
if (baseUri == null)
|
||||
{
|
||||
throw new System.ArgumentNullException("baseUri");
|
||||
}
|
||||
if (credentials == null)
|
||||
{
|
||||
throw new System.ArgumentNullException("credentials");
|
||||
}
|
||||
BaseUri = baseUri;
|
||||
Credentials = credentials;
|
||||
if (Credentials != null)
|
||||
{
|
||||
Credentials.InitializeServiceClient(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the Kubernetes class.
|
||||
/// </summary>
|
||||
/// <param name='baseUri'>
|
||||
/// Optional. The base URI of the service.
|
||||
/// </param>
|
||||
/// <param name='credentials'>
|
||||
/// Required. Subscription credentials which uniquely identify client subscription.
|
||||
/// </param>
|
||||
/// <param name='rootHandler'>
|
||||
/// Optional. The http client handler used to handle http transport.
|
||||
/// </param>
|
||||
/// <param name='handlers'>
|
||||
/// Optional. The delegating handlers to add to the http client pipeline.
|
||||
/// </param>
|
||||
/// <exception cref="System.ArgumentNullException">
|
||||
/// Thrown when a required parameter is null
|
||||
/// </exception>
|
||||
public Kubernetes(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
|
||||
{
|
||||
if (baseUri == null)
|
||||
{
|
||||
throw new System.ArgumentNullException("baseUri");
|
||||
}
|
||||
if (credentials == null)
|
||||
{
|
||||
throw new System.ArgumentNullException("credentials");
|
||||
}
|
||||
BaseUri = baseUri;
|
||||
Credentials = credentials;
|
||||
if (Credentials != null)
|
||||
{
|
||||
Credentials.InitializeServiceClient(this);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An optional partial-method to perform custom initialization.
|
||||
///</summary>
|
||||
partial void CustomInitialize();
|
||||
/// <summary>
|
||||
/// Initializes client properties.
|
||||
/// </summary>
|
||||
private void Initialize()
|
||||
{
|
||||
BaseUri = new System.Uri("http://localhost");
|
||||
SerializationSettings = new JsonSerializerSettings
|
||||
{
|
||||
Formatting = Newtonsoft.Json.Formatting.Indented,
|
||||
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
|
||||
DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
|
||||
NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
|
||||
ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
|
||||
ContractResolver = new ReadOnlyJsonContractResolver(),
|
||||
Converters = new List<JsonConverter>
|
||||
{
|
||||
new Iso8601TimeSpanConverter()
|
||||
}
|
||||
};
|
||||
DeserializationSettings = new JsonSerializerSettings
|
||||
{
|
||||
DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
|
||||
DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc,
|
||||
NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore,
|
||||
ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
|
||||
ContractResolver = new ReadOnlyJsonContractResolver(),
|
||||
Converters = new List<JsonConverter>
|
||||
{
|
||||
new Iso8601TimeSpanConverter()
|
||||
}
|
||||
};
|
||||
CustomInitialize();
|
||||
}
|
||||
|
||||
{{#.}}
|
||||
/// <inheritdoc/>
|
||||
public async Task<HttpOperationResponse{{GetReturnType operation "<>"}}> {{GetMethodName operation "WithHttpMessagesAsync"}}(
|
||||
{{#operation.parameters}}
|
||||
{{GetDotNetType .}} {{GetDotNetName . "true"}},
|
||||
{{/operation.parameters}}
|
||||
Dictionary<string, List<string>> customHeaders = null,
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
{{#operation.parameters}}
|
||||
{{#isRequired}}
|
||||
if ({{GetDotNetName name}} == null)
|
||||
{
|
||||
throw new ValidationException(ValidationRules.CannotBeNull, "{{GetDotNetName name}}");
|
||||
}
|
||||
{{/isRequired}}
|
||||
{{/operation.parameters}}
|
||||
// Tracing
|
||||
bool _shouldTrace = ServiceClientTracing.IsEnabled;
|
||||
string _invocationId = null;
|
||||
if (_shouldTrace)
|
||||
{
|
||||
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
|
||||
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
|
||||
{{#operation.parameters}}
|
||||
tracingParameters.Add("{{GetDotNetName name}}", {{GetDotNetName name}});
|
||||
{{/operation.parameters}}
|
||||
tracingParameters.Add("cancellationToken", cancellationToken);
|
||||
ServiceClientTracing.Enter(_invocationId, this, "{{GetMethodName operation ""}}", tracingParameters);
|
||||
}
|
||||
// Construct URL
|
||||
var _baseUrl = BaseUri.AbsoluteUri;
|
||||
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{{path}}").ToString();
|
||||
{{#operation.parameters}}
|
||||
{{#IfKindIs . "path"}}
|
||||
_url = _url.Replace("{{AddCurly name}}", {{GetDotNetName name}});
|
||||
{{/IfKindIs . "path"}}
|
||||
{{/operation.parameters}}
|
||||
List<string> _queryParameters = new List<string>();
|
||||
{{#operation.parameters}}
|
||||
{{#IfKindIs . "query"}}
|
||||
if ({{GetDotNetName name}} != null)
|
||||
{
|
||||
_queryParameters.Add(string.Format("{{name}}={0}", {{EscapeDataString name type}}));
|
||||
}
|
||||
{{/IfKindIs . "query"}}
|
||||
{{/operation.parameters}}
|
||||
if (_queryParameters.Count > 0)
|
||||
{
|
||||
_url += "?" + string.Join("&", _queryParameters);
|
||||
}
|
||||
// Create HTTP transport
|
||||
var _httpRequest = new HttpRequestMessage();
|
||||
HttpResponseMessage _httpResponse = null;
|
||||
_httpRequest.Method = HttpMethod.{{Method}};
|
||||
_httpRequest.RequestUri = new System.Uri(_url);
|
||||
// Set Headers
|
||||
|
||||
|
||||
if (customHeaders != null)
|
||||
{
|
||||
foreach(var _header in customHeaders)
|
||||
{
|
||||
if (_httpRequest.Headers.Contains(_header.Key))
|
||||
{
|
||||
_httpRequest.Headers.Remove(_header.Key);
|
||||
}
|
||||
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
|
||||
}
|
||||
}
|
||||
|
||||
// Serialize Request
|
||||
string _requestContent = null;
|
||||
{{#operation.requestBody.isRequired}}
|
||||
if(body != null)
|
||||
{
|
||||
_requestContent = SafeJsonConvert.SerializeObject(body, SerializationSettings);
|
||||
_httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
|
||||
_httpRequest.Content.Headers.ContentType = GetHeader(body);
|
||||
}
|
||||
{{/operation.requestBody.isRequired}}
|
||||
// Set Credentials
|
||||
if (Credentials != null)
|
||||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
// Send Request
|
||||
if (_shouldTrace)
|
||||
{
|
||||
ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
|
||||
}
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
_httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
|
||||
if (_shouldTrace)
|
||||
{
|
||||
ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
|
||||
}
|
||||
HttpStatusCode _statusCode = _httpResponse.StatusCode;
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
string _responseContent = null;
|
||||
if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202)
|
||||
{
|
||||
var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
|
||||
if (_httpResponse.Content != null) {
|
||||
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||
}
|
||||
else {
|
||||
_responseContent = string.Empty;
|
||||
}
|
||||
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
|
||||
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
|
||||
if (_shouldTrace)
|
||||
{
|
||||
ServiceClientTracing.Error(_invocationId, ex);
|
||||
}
|
||||
_httpRequest.Dispose();
|
||||
if (_httpResponse != null)
|
||||
{
|
||||
_httpResponse.Dispose();
|
||||
}
|
||||
throw ex;
|
||||
}
|
||||
// Create Result
|
||||
var _result = new HttpOperationResponse{{GetReturnType operation "<>"}}();
|
||||
_result.Request = _httpRequest;
|
||||
_result.Response = _httpResponse;
|
||||
{{#IfReturnType operation "any"}}
|
||||
// Deserialize Response
|
||||
if ((int)_statusCode == 200 || (int)_statusCode == 201 || (int)_statusCode == 202)
|
||||
{
|
||||
{{#IfReturnType operation "stream"}}
|
||||
_result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false);
|
||||
{{/IfReturnType operation "stream"}}
|
||||
{{#IfReturnType operation "obj"}}
|
||||
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
|
||||
try
|
||||
{
|
||||
_result.Body = SafeJsonConvert.DeserializeObject{{GetReturnType operation "<>"}}(_responseContent, DeserializationSettings);
|
||||
}
|
||||
catch (JsonException ex)
|
||||
{
|
||||
_httpRequest.Dispose();
|
||||
if (_httpResponse != null)
|
||||
{
|
||||
_httpResponse.Dispose();
|
||||
}
|
||||
throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
|
||||
}
|
||||
{{/IfReturnType operation "stream"}}
|
||||
}
|
||||
{{/IfReturnType operation "any"}}
|
||||
if (_shouldTrace)
|
||||
{
|
||||
ServiceClientTracing.Exit(_invocationId, _result);
|
||||
}
|
||||
return _result;
|
||||
|
||||
}
|
||||
|
||||
{{/.}}
|
||||
}
|
||||
}
|
||||
80
gen/KubernetesGenerator/KubernetesExtensions.cs.template
Normal file
80
gen/KubernetesGenerator/KubernetesExtensions.cs.template
Normal file
@@ -0,0 +1,80 @@
|
||||
// <auto-generated>
|
||||
// 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.
|
||||
// </auto-generated>
|
||||
|
||||
namespace k8s
|
||||
{
|
||||
using Models;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
/// <summary>
|
||||
/// Extension methods for Kubernetes.
|
||||
/// </summary>
|
||||
public static partial class KubernetesExtensions
|
||||
{
|
||||
{{#.}}
|
||||
/// <summary>
|
||||
/// {{ToXmlDoc operation.description}}
|
||||
/// </summary>
|
||||
/// <param name='operations'>
|
||||
/// The operations group for this extension method.
|
||||
/// </param>
|
||||
{{#operation.parameters}}
|
||||
/// <param name="{{GetDotNetName .}}">
|
||||
/// {{ToXmlDoc description}}
|
||||
/// </param>
|
||||
{{/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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// {{ToXmlDoc operation.description}}
|
||||
/// </summary>
|
||||
/// <param name='operations'>
|
||||
/// The operations group for this extension method.
|
||||
/// </param>
|
||||
{{#operation.parameters}}
|
||||
/// <param name="{{GetDotNetName .}}">
|
||||
/// {{ToXmlDoc description}}
|
||||
/// </param>
|
||||
{{/operation.parameters}}
|
||||
/// <param name="cancellationToken">
|
||||
/// A <see cref="CancellationToken"/> which can be used to cancel the asynchronous operation.
|
||||
/// </param>
|
||||
public static async Task{{GetReturnType operation "<>"}} {{GetMethodName operation "Async"}}(
|
||||
this IKubernetes operations,
|
||||
{{#operation.parameters}}
|
||||
{{GetDotNetType .}} {{GetDotNetName . "true"}},
|
||||
{{/operation.parameters}}
|
||||
CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
using (var _result = await operations.{{GetMethodName operation "WithHttpMessagesAsync"}}(
|
||||
{{#operation.parameters}}
|
||||
{{GetDotNetName .}},
|
||||
{{/operation.parameters}}
|
||||
null,
|
||||
cancellationToken).ConfigureAwait(false))
|
||||
{
|
||||
{{GetReturnType operation "_result.Body"}};
|
||||
}
|
||||
}
|
||||
|
||||
{{/.}}
|
||||
}
|
||||
}
|
||||
21
gen/KubernetesGenerator/KubernetesGenerator.csproj
Normal file
21
gen/KubernetesGenerator/KubernetesGenerator.csproj
Normal file
@@ -0,0 +1,21 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CaseExtensions" Version="1.1.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
||||
<PackageReference Include="NSwag.Core" Version="11.17.2" />
|
||||
<PackageReference Include="Nustache" Version="1.16.0.8" NoWarn="NU1701" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="*.template">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
97
gen/KubernetesGenerator/Model.cs.template
Normal file
97
gen/KubernetesGenerator/Model.cs.template
Normal file
@@ -0,0 +1,97 @@
|
||||
// <auto-generated>
|
||||
// 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.
|
||||
// </auto-generated>
|
||||
|
||||
namespace k8s.Models
|
||||
{
|
||||
using Microsoft.Rest;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections;
|
||||
using System.Linq;
|
||||
|
||||
/// <summary>
|
||||
/// {{ToXmlDoc def.description}}
|
||||
/// </summary>
|
||||
public partial class {{clz}}
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the {{GetClassName def}} class.
|
||||
/// </summary>
|
||||
public {{clz}}()
|
||||
{
|
||||
CustomInit();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the {{GetClassName def}} class.
|
||||
/// </summary>
|
||||
{{#properties}}
|
||||
{{#isRequired}}
|
||||
/// <param name="{{GetDotNetName name "fieldctor"}}">
|
||||
/// {{ToXmlDoc description}}
|
||||
/// </param>
|
||||
{{/isRequired}}
|
||||
{{/properties}}
|
||||
{{#properties}}
|
||||
{{^isRequired}}
|
||||
/// <param name="{{GetDotNetName name "fieldctor"}}">
|
||||
/// {{ToXmlDoc description}}
|
||||
/// </param>
|
||||
{{/isRequired}}
|
||||
{{/properties}}
|
||||
public {{clz}}({{GetModelCtorParam def}})
|
||||
{
|
||||
{{#properties}}
|
||||
{{GetDotNetName name "field"}} = {{GetDotNetName name "fieldctor"}};
|
||||
{{/properties}}
|
||||
CustomInit();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An initialization method that performs custom operations like setting defaults
|
||||
/// </summary>
|
||||
partial void CustomInit();
|
||||
{{#properties}}
|
||||
|
||||
/// <summary>
|
||||
/// {{ToXmlDoc description}}
|
||||
/// </summary>
|
||||
[JsonProperty(PropertyName = "{{name}}")]
|
||||
public {{GetDotNetType .}} {{GetDotNetName name "field"}} { get; set; }
|
||||
{{/properties}}
|
||||
|
||||
/// <summary>
|
||||
/// Validate the object.
|
||||
/// </summary>
|
||||
/// <exception cref="ValidationException">
|
||||
/// Thrown if validation fails
|
||||
/// </exception>
|
||||
public virtual void Validate()
|
||||
{
|
||||
{{#properties}}
|
||||
{{#IfType . "object"}}
|
||||
{{#isRequired}}
|
||||
if ({{GetDotNetName name "field"}} == null)
|
||||
{
|
||||
throw new ValidationException(ValidationRules.CannotBeNull, "{{GetDotNetName name "field"}}");
|
||||
}
|
||||
{{/isRequired}}
|
||||
{{/IfType . "object"}}
|
||||
{{/properties}}
|
||||
{{#properties}}
|
||||
{{#IfType . "object"}}
|
||||
{{GetDotNetName name "field"}}?.Validate();
|
||||
{{/IfType . "object"}}
|
||||
{{#IfType . "objectarray"}}
|
||||
foreach(var obj in {{GetDotNetName name "field"}})
|
||||
{
|
||||
obj.Validate();
|
||||
}
|
||||
{{/IfType . "objectarray"}}
|
||||
{{/properties}}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// <auto-generated>
|
||||
// Code generated by gen/KubernetesWatchGenerator
|
||||
// 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.
|
||||
// </auto-generated>
|
||||
@@ -1,5 +1,5 @@
|
||||
// <auto-generated>
|
||||
// Code generated by gen/KubernetesWatchGenerator
|
||||
// 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.
|
||||
// </auto-generated>
|
||||
@@ -1,12 +1,18 @@
|
||||
using CaseExtensions;
|
||||
using NJsonSchema;
|
||||
using NSwag;
|
||||
using Nustache.Core;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection.Metadata;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Security;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace KubernetesWatchGenerator
|
||||
@@ -16,6 +22,7 @@ namespace KubernetesWatchGenerator
|
||||
private static HashSet<string> _classesWithValidation;
|
||||
private static readonly Dictionary<string, string> ClassNameMap = new Dictionary<string, string>();
|
||||
private static Dictionary<JsonSchema4, string> _schemaToNameMap;
|
||||
private static Dictionary<JsonSchema4, string> _schemaToNameMapCooked;
|
||||
private static HashSet<string> _schemaDefinitionsInMultipleGroups;
|
||||
private static Dictionary<string, string> _classNameToPluralMap;
|
||||
|
||||
@@ -31,8 +38,8 @@ namespace KubernetesWatchGenerator
|
||||
|
||||
// Read the spec trimmed
|
||||
// here we cache all name in gen project for later use
|
||||
var swagger = await SwaggerDocument.FromFileAsync(Path.Combine(args[1], "swagger.json")).ConfigureAwait(false);
|
||||
foreach (var (k, v) in swagger.Definitions)
|
||||
var swaggercooked = await SwaggerDocument.FromFileAsync(Path.Combine(args[1], "swagger.json")).ConfigureAwait(false);
|
||||
foreach (var (k, v) in swaggercooked.Definitions)
|
||||
{
|
||||
if (v.ExtensionData?.TryGetValue("x-kubernetes-group-version-kind", out var _) == true)
|
||||
{
|
||||
@@ -46,8 +53,10 @@ namespace KubernetesWatchGenerator
|
||||
}
|
||||
}
|
||||
|
||||
_schemaToNameMapCooked = swaggercooked.Definitions.ToDictionary(x => x.Value, x => ToPascalCase(x.Key.Replace(".", "")));
|
||||
|
||||
// gen project removed all watch operations, so here we switch back to unprocessed version
|
||||
swagger = await SwaggerDocument.FromFileAsync(Path.Combine(args[1], "swagger.json.unprocessed")).ConfigureAwait(false);
|
||||
var swagger = await SwaggerDocument.FromFileAsync(Path.Combine(args[1], "swagger.json.unprocessed")).ConfigureAwait(false);
|
||||
_schemaToNameMap = swagger.Definitions.ToDictionary(x => x.Value, x => x.Key);
|
||||
_schemaDefinitionsInMultipleGroups = _schemaToNameMap.Values.Select(x =>
|
||||
{
|
||||
@@ -102,6 +111,14 @@ namespace KubernetesWatchGenerator
|
||||
Helpers.Register(nameof(GetKind), GetKind);
|
||||
Helpers.Register(nameof(GetPlural), GetPlural);
|
||||
Helpers.Register(nameof(GetTuple), GetTuple);
|
||||
Helpers.Register(nameof(GetReturnType), GetReturnType);
|
||||
Helpers.Register(nameof(IfKindIs), IfKindIs);
|
||||
Helpers.Register(nameof(AddCurly), AddCurly);
|
||||
Helpers.Register(nameof(GetRequestMethod), GetRequestMethod);
|
||||
Helpers.Register(nameof(EscapeDataString), EscapeDataString);
|
||||
Helpers.Register(nameof(IfReturnType), IfReturnType);
|
||||
Helpers.Register(nameof(GetModelCtorParam), GetModelCtorParam);
|
||||
Helpers.Register(nameof(IfType), IfType);
|
||||
|
||||
// Generate the Watcher operations
|
||||
// We skip operations where the name of the class in the C# client could not be determined correctly.
|
||||
@@ -119,6 +136,60 @@ namespace KubernetesWatchGenerator
|
||||
Render.FileToFile("Kubernetes.Watch.cs.template", watchOperations,
|
||||
Path.Combine(outputDirectory, "Kubernetes.Watch.cs"));
|
||||
|
||||
var data = swaggercooked.Operations
|
||||
.Where(o => o.Method != SwaggerOperationMethod.Options)
|
||||
.GroupBy(o => o.Operation.OperationId)
|
||||
.Select(g =>
|
||||
{
|
||||
var gs = g.ToArray();
|
||||
|
||||
for (int i = 1; i < g.Count(); i++)
|
||||
{
|
||||
gs[i].Operation.OperationId += i;
|
||||
}
|
||||
|
||||
return gs;
|
||||
})
|
||||
.SelectMany(g => g)
|
||||
.Select(o =>
|
||||
{
|
||||
var ps = o.Operation.ActualParameters.OrderBy(p => !p.IsRequired).ToArray();
|
||||
|
||||
o.Operation.Parameters.Clear();
|
||||
|
||||
var name = new HashSet<string>();
|
||||
|
||||
var i = 1;
|
||||
foreach (var p in ps)
|
||||
{
|
||||
if (name.Contains(p.Name))
|
||||
{
|
||||
p.Name = p.Name + i++;
|
||||
}
|
||||
|
||||
o.Operation.Parameters.Add(p);
|
||||
name.Add(p.Name);
|
||||
}
|
||||
|
||||
return o;
|
||||
})
|
||||
.ToArray();
|
||||
|
||||
Render.FileToFile("IKubernetes.cs.template", data, Path.Combine(outputDirectory, "IKubernetes.cs"));
|
||||
Render.FileToFile("KubernetesExtensions.cs.template", data, Path.Combine(outputDirectory, "KubernetesExtensions.cs"));
|
||||
Render.FileToFile("Kubernetes.cs.template", data, Path.Combine(outputDirectory, "Kubernetes.cs"));
|
||||
|
||||
foreach (var (_, def) in swaggercooked.Definitions)
|
||||
{
|
||||
var clz = GetClassNameForSchemaDefinition(def);
|
||||
Render.FileToFile("Model.cs.template", new
|
||||
{
|
||||
clz,
|
||||
def,
|
||||
properties = def.Properties.Values,
|
||||
}, Path.Combine(outputDirectory, "Models", $"{clz}.cs"));
|
||||
}
|
||||
|
||||
// Generate the interface declarations
|
||||
var skippedTypes = new HashSet<string>() { "V1WatchEvent", };
|
||||
|
||||
@@ -178,17 +249,20 @@ namespace KubernetesWatchGenerator
|
||||
string line = null;
|
||||
while ((line = reader.ReadLine()) != null)
|
||||
{
|
||||
if (!first)
|
||||
foreach (var wline in WordWrap(line, 80))
|
||||
{
|
||||
context.Write("\n");
|
||||
context.Write(" /// ");
|
||||
}
|
||||
else
|
||||
{
|
||||
first = false;
|
||||
}
|
||||
if (!first)
|
||||
{
|
||||
context.Write("\n");
|
||||
context.Write(" /// ");
|
||||
}
|
||||
else
|
||||
{
|
||||
first = false;
|
||||
}
|
||||
|
||||
context.Write(line);
|
||||
context.Write(SecurityElement.Escape(wline));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -213,7 +287,7 @@ namespace KubernetesWatchGenerator
|
||||
}
|
||||
else if (arguments != null && arguments.Count > 0 && arguments[0] != null && arguments[0] is JsonSchema4)
|
||||
{
|
||||
context.Write(GetClassName(arguments[0] as JsonSchema4));
|
||||
context.Write(GetClassNameForSchemaDefinition(arguments[0] as JsonSchema4));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,6 +332,11 @@ namespace KubernetesWatchGenerator
|
||||
return GetClassName(definition);
|
||||
}
|
||||
|
||||
if (_schemaToNameMapCooked.TryGetValue(definition, out var name))
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
var schemaName = _schemaToNameMap[definition];
|
||||
|
||||
var parts = schemaName.Split(".");
|
||||
@@ -380,20 +459,38 @@ namespace KubernetesWatchGenerator
|
||||
{
|
||||
if (arguments != null && arguments.Count > 0 && arguments[0] != null && arguments[0] is SwaggerOperation)
|
||||
{
|
||||
context.Write(GetMethodName(arguments[0] as SwaggerOperation));
|
||||
string suffix = null;
|
||||
if (arguments.Count > 1)
|
||||
{
|
||||
suffix = arguments[1] as string;
|
||||
}
|
||||
|
||||
context.Write(GetMethodName(arguments[0] as SwaggerOperation, suffix));
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetMethodName(SwaggerOperation watchOperation)
|
||||
private static string GetMethodName(SwaggerOperation watchOperation, string suffix)
|
||||
{
|
||||
var tag = watchOperation.Tags[0];
|
||||
tag = tag.Replace("_", string.Empty);
|
||||
|
||||
var methodName = ToPascalCase(watchOperation.OperationId);
|
||||
|
||||
// This tries to remove the version from the method name, e.g. watchCoreV1NamespacedPod => WatchNamespacedPod
|
||||
methodName = methodName.Replace(tag, string.Empty, StringComparison.OrdinalIgnoreCase);
|
||||
methodName += "Async";
|
||||
switch (suffix)
|
||||
{
|
||||
case "":
|
||||
case "Async":
|
||||
case "WithHttpMessagesAsync":
|
||||
methodName += suffix;
|
||||
break;
|
||||
|
||||
default:
|
||||
// This tries to remove the version from the method name, e.g. watchCoreV1NamespacedPod => WatchNamespacedPod
|
||||
methodName = methodName.Replace(tag, string.Empty, StringComparison.OrdinalIgnoreCase);
|
||||
methodName += "Async";
|
||||
break;
|
||||
}
|
||||
|
||||
return methodName;
|
||||
}
|
||||
|
||||
@@ -403,13 +500,30 @@ namespace KubernetesWatchGenerator
|
||||
if (arguments != null && arguments.Count > 0 && arguments[0] != null && arguments[0] is SwaggerParameter)
|
||||
{
|
||||
var parameter = arguments[0] as SwaggerParameter;
|
||||
context.Write(GetDotNetType(parameter.Type, parameter.Name, parameter.IsRequired));
|
||||
|
||||
if (parameter.Schema?.Reference != null)
|
||||
{
|
||||
context.Write(GetClassNameForSchemaDefinition(parameter.Schema.Reference));
|
||||
}
|
||||
else if (parameter.Schema != null)
|
||||
{
|
||||
context.Write(GetDotNetType(parameter.Schema.Type, parameter.Name, parameter.IsRequired, parameter.Schema.Format));
|
||||
}
|
||||
else
|
||||
{
|
||||
context.Write(GetDotNetType(parameter.Type, parameter.Name, parameter.IsRequired, parameter.Format));
|
||||
}
|
||||
}
|
||||
else if (arguments != null && arguments.Count > 0 && arguments[0] != null && arguments[0] is JsonProperty)
|
||||
{
|
||||
var property = arguments[0] as JsonProperty;
|
||||
context.Write(GetDotNetType(property));
|
||||
}
|
||||
else if (arguments != null && arguments.Count > 2 && arguments[0] != null && arguments[1] != null &&
|
||||
arguments[2] != null && arguments[0] is JsonObjectType && arguments[1] is string &&
|
||||
arguments[2] is bool)
|
||||
{
|
||||
context.Write(GetDotNetType((JsonObjectType)arguments[0], (string)arguments[1], (bool)arguments[2]));
|
||||
context.Write(GetDotNetType((JsonObjectType)arguments[0], (string)arguments[1], (bool)arguments[2], (string)arguments[3]));
|
||||
}
|
||||
else if (arguments != null && arguments.Count > 0 && arguments[0] != null)
|
||||
{
|
||||
@@ -421,11 +535,11 @@ namespace KubernetesWatchGenerator
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetDotNetType(JsonObjectType jsonType, string name, bool required)
|
||||
private static string GetDotNetType(JsonObjectType jsonType, string name, bool required, string format)
|
||||
{
|
||||
if (name == "pretty" && !required)
|
||||
{
|
||||
return "bool?";
|
||||
return "string";
|
||||
}
|
||||
|
||||
switch (jsonType)
|
||||
@@ -441,23 +555,120 @@ namespace KubernetesWatchGenerator
|
||||
}
|
||||
|
||||
case JsonObjectType.Integer:
|
||||
switch (format)
|
||||
{
|
||||
case "int64":
|
||||
if (required)
|
||||
{
|
||||
return "long";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "long?";
|
||||
}
|
||||
|
||||
break;
|
||||
case "int32":
|
||||
default:
|
||||
if (required)
|
||||
{
|
||||
return "int";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "int?";
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case JsonObjectType.Number:
|
||||
if (required)
|
||||
{
|
||||
return "int";
|
||||
return "double";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "int?";
|
||||
return "double?";
|
||||
}
|
||||
|
||||
case JsonObjectType.String:
|
||||
return "string";
|
||||
|
||||
switch (format)
|
||||
{
|
||||
case "byte":
|
||||
return "byte[]";
|
||||
case "date-time":
|
||||
if (required)
|
||||
{
|
||||
return "System.DateTime";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "System.DateTime?";
|
||||
}
|
||||
}
|
||||
|
||||
return "string";
|
||||
case JsonObjectType.Object:
|
||||
return "object";
|
||||
default:
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetDotNetType(JsonSchema4 schema, JsonProperty parent)
|
||||
{
|
||||
if (schema != null)
|
||||
{
|
||||
if (schema.IsArray)
|
||||
{
|
||||
return $"IList<{GetDotNetType(schema.Item, parent)}>";
|
||||
}
|
||||
|
||||
if (schema.IsDictionary && schema.AdditionalPropertiesSchema != null)
|
||||
{
|
||||
return $"IDictionary<string, {GetDotNetType(schema.AdditionalPropertiesSchema, parent)}>";
|
||||
}
|
||||
|
||||
|
||||
if (schema?.Reference != null)
|
||||
{
|
||||
return GetClassNameForSchemaDefinition(schema.Reference);
|
||||
}
|
||||
else if (schema != null)
|
||||
{
|
||||
return GetDotNetType(schema.Type, parent.Name, parent.IsRequired, schema.Format);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return GetDotNetType(parent.Type, parent.Name, parent.IsRequired, parent.Format);
|
||||
}
|
||||
|
||||
private static string GetDotNetType(JsonProperty p)
|
||||
{
|
||||
if (p.SchemaReference != null)
|
||||
{
|
||||
return GetClassNameForSchemaDefinition(p.SchemaReference);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (p.IsArray)
|
||||
{
|
||||
// getType
|
||||
return $"IList<{GetDotNetType(p.Item, p)}>";
|
||||
}
|
||||
|
||||
if (p.IsDictionary && p.AdditionalPropertiesSchema != null)
|
||||
{
|
||||
return $"IDictionary<string, {GetDotNetType(p.AdditionalPropertiesSchema, p)}>";
|
||||
}
|
||||
|
||||
return GetDotNetType(p.Type, p.Name, p.IsRequired, p.Format);
|
||||
}
|
||||
}
|
||||
|
||||
private static void GetDotNetName(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
|
||||
RenderBlock fn, RenderBlock inverse)
|
||||
{
|
||||
@@ -465,26 +676,95 @@ namespace KubernetesWatchGenerator
|
||||
{
|
||||
var parameter = arguments[0] as SwaggerParameter;
|
||||
context.Write(GetDotNetName(parameter.Name));
|
||||
|
||||
if (arguments.Count > 1 && arguments[1] as string == "true" && !parameter.IsRequired)
|
||||
{
|
||||
context.Write($" = null");
|
||||
}
|
||||
|
||||
}
|
||||
else if (arguments != null && arguments.Count > 0 && arguments[0] != null && arguments[0] is string)
|
||||
{
|
||||
var parameter = arguments[0] as SwaggerParameter;
|
||||
context.Write(GetDotNetName((string)arguments[0]));
|
||||
var style = "parameter";
|
||||
if (arguments.Count > 1)
|
||||
{
|
||||
style = arguments[1] as string;
|
||||
}
|
||||
|
||||
context.Write(GetDotNetName((string)arguments[0], style));
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetDotNetName(string jsonName)
|
||||
private static string GetDotNetName(string jsonName, string style = "parameter")
|
||||
{
|
||||
if (jsonName == "namespace")
|
||||
switch (style)
|
||||
{
|
||||
return "@namespace";
|
||||
}
|
||||
else if (jsonName == "continue")
|
||||
{
|
||||
return "@continue";
|
||||
case "parameter":
|
||||
if (jsonName == "namespace")
|
||||
{
|
||||
return "namespaceParameter";
|
||||
}
|
||||
else if (jsonName == "continue")
|
||||
{
|
||||
return "continueParameter";
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "fieldctor":
|
||||
if (jsonName == "namespace")
|
||||
{
|
||||
return "namespaceProperty";
|
||||
}
|
||||
else if (jsonName == "continue")
|
||||
{
|
||||
return "continueProperty";
|
||||
}
|
||||
else if (jsonName == "__referencePath")
|
||||
{
|
||||
return "refProperty";
|
||||
}
|
||||
else if (jsonName == "default")
|
||||
{
|
||||
return "defaultProperty";
|
||||
}
|
||||
else if (jsonName == "operator")
|
||||
{
|
||||
return "operatorProperty";
|
||||
}
|
||||
else if (jsonName == "$schema")
|
||||
{
|
||||
return "schema";
|
||||
}
|
||||
else if (jsonName == "enum")
|
||||
{
|
||||
return "enumProperty";
|
||||
}
|
||||
else if (jsonName == "object")
|
||||
{
|
||||
return "objectProperty";
|
||||
}
|
||||
else if (jsonName == "readOnly")
|
||||
{
|
||||
return "readOnlyProperty";
|
||||
}
|
||||
else if (jsonName == "from")
|
||||
{
|
||||
return "fromProperty";
|
||||
}
|
||||
|
||||
if (jsonName.Contains("-"))
|
||||
{
|
||||
return jsonName.ToCamelCase();
|
||||
}
|
||||
|
||||
break;
|
||||
case "field":
|
||||
return GetDotNetName(jsonName, "fieldctor").ToPascalCase();
|
||||
|
||||
}
|
||||
|
||||
return jsonName;
|
||||
return jsonName.ToCamelCase();
|
||||
}
|
||||
|
||||
private static void GetPathExpression(RenderContext context, IList<object> arguments,
|
||||
@@ -507,7 +787,7 @@ namespace KubernetesWatchGenerator
|
||||
pathExpression = pathExpression.Substring(1);
|
||||
}
|
||||
|
||||
pathExpression = pathExpression.Replace("{namespace}", "{@namespace}");
|
||||
pathExpression = pathExpression.Replace("{namespace}", "{namespaceParameter}");
|
||||
return pathExpression;
|
||||
}
|
||||
|
||||
@@ -520,6 +800,98 @@ namespace KubernetesWatchGenerator
|
||||
}
|
||||
}
|
||||
|
||||
private static void GetReturnType(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
|
||||
RenderBlock fn, RenderBlock inverse)
|
||||
{
|
||||
var operation = arguments?.FirstOrDefault() as SwaggerOperation;
|
||||
if (operation != null)
|
||||
{
|
||||
string style = null;
|
||||
if (arguments.Count > 1)
|
||||
{
|
||||
style = arguments[1] as string;
|
||||
}
|
||||
|
||||
context.Write(GetReturnType(operation, style));
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetReturnType(SwaggerOperation operation, string sytle)
|
||||
{
|
||||
SwaggerResponse response;
|
||||
|
||||
if (!operation.Responses.TryGetValue("200", out response))
|
||||
{
|
||||
operation.Responses.TryGetValue("201", out response);
|
||||
}
|
||||
|
||||
string toType()
|
||||
{
|
||||
if (response != null)
|
||||
{
|
||||
var schema = response.Schema;
|
||||
|
||||
if (schema == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
if (schema.Format == "file")
|
||||
{
|
||||
return "Stream";
|
||||
}
|
||||
|
||||
|
||||
if (schema.Reference != null)
|
||||
{
|
||||
return GetClassNameForSchemaDefinition(schema.Reference);
|
||||
}
|
||||
|
||||
return GetDotNetType(schema.Type, "", true, schema.Format);
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
var t = toType();
|
||||
|
||||
switch (sytle)
|
||||
{
|
||||
case "<>":
|
||||
if (t != "")
|
||||
{
|
||||
return "<" + t + ">";
|
||||
}
|
||||
|
||||
break;
|
||||
case "void":
|
||||
if (t == "")
|
||||
{
|
||||
return "void";
|
||||
}
|
||||
|
||||
break;
|
||||
case "return":
|
||||
if (t != "")
|
||||
{
|
||||
return "return";
|
||||
}
|
||||
|
||||
break;
|
||||
case "_result.Body":
|
||||
if (t != "")
|
||||
{
|
||||
return "return _result.Body";
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
private static string GetApiVersion(JsonSchema4 definition)
|
||||
{
|
||||
var groupVersionKindElements = (object[])definition.ExtensionData["x-kubernetes-group-version-kind"];
|
||||
@@ -528,6 +900,141 @@ namespace KubernetesWatchGenerator
|
||||
return groupVersionKind["version"] as string;
|
||||
}
|
||||
|
||||
private static void IfKindIs(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
|
||||
RenderBlock fn, RenderBlock inverse)
|
||||
{
|
||||
var parameter = arguments?.FirstOrDefault() as SwaggerParameter;
|
||||
if (parameter != null)
|
||||
{
|
||||
string kind = null;
|
||||
if (arguments.Count > 1)
|
||||
{
|
||||
kind = arguments[1] as string;
|
||||
}
|
||||
|
||||
if (kind == "query" && parameter.Kind == SwaggerParameterKind.Query)
|
||||
{
|
||||
fn(null);
|
||||
}
|
||||
else if (kind == "path" && parameter.Kind == SwaggerParameterKind.Path)
|
||||
{
|
||||
fn(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddCurly(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
|
||||
RenderBlock fn, RenderBlock inverse)
|
||||
{
|
||||
var s = arguments?.FirstOrDefault() as string;
|
||||
if (s != null)
|
||||
{
|
||||
context.Write("{" + s + "}");
|
||||
}
|
||||
}
|
||||
|
||||
private static void GetRequestMethod(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
|
||||
RenderBlock fn, RenderBlock inverse)
|
||||
{
|
||||
var s = arguments?.FirstOrDefault() as SwaggerOperationMethod?;
|
||||
if (s != null)
|
||||
{
|
||||
context.Write(s.ToString().ToUpper());
|
||||
}
|
||||
}
|
||||
|
||||
private static void IfReturnType(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
|
||||
RenderBlock fn, RenderBlock inverse)
|
||||
{
|
||||
var operation = arguments?.FirstOrDefault() as SwaggerOperation;
|
||||
if (operation != null)
|
||||
{
|
||||
string type = null;
|
||||
if (arguments.Count > 1)
|
||||
{
|
||||
type = arguments[1] as string;
|
||||
}
|
||||
|
||||
var rt = GetReturnType(operation, "void");
|
||||
if (type == "any" && rt != "void")
|
||||
{
|
||||
fn(null);
|
||||
}
|
||||
else if (type == "stream" && rt == "Stream")
|
||||
{
|
||||
fn(null);
|
||||
}
|
||||
else if (type == "obj" && rt != "void" && rt != "Stream")
|
||||
{
|
||||
fn(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void EscapeDataString(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
|
||||
RenderBlock fn, RenderBlock inverse)
|
||||
{
|
||||
var name = GetDotNetName(arguments[0] as string);
|
||||
var type = arguments[1] as JsonObjectType?;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case JsonObjectType.String:
|
||||
context.Write($"System.Uri.EscapeDataString({name})");
|
||||
break;
|
||||
default:
|
||||
context.Write($"System.Uri.EscapeDataString(SafeJsonConvert.SerializeObject({name}, SerializationSettings).Trim('\"'))");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private static void GetModelCtorParam(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
|
||||
RenderBlock fn, RenderBlock inverse)
|
||||
{
|
||||
var schema = arguments[0] as JsonSchema4;
|
||||
|
||||
if (schema != null)
|
||||
{
|
||||
context.Write(string.Join(", ", schema.Properties.Values
|
||||
.OrderBy(p => !p.IsRequired)
|
||||
.Select(p =>
|
||||
{
|
||||
string sp = $"{GetDotNetType(p)} {GetDotNetName(p.Name, "fieldctor")}";
|
||||
|
||||
if (!p.IsRequired)
|
||||
{
|
||||
sp = $"{sp} = null";
|
||||
}
|
||||
|
||||
return sp;
|
||||
})));
|
||||
}
|
||||
}
|
||||
|
||||
private static void IfType(RenderContext context, IList<object> arguments, IDictionary<string, object> options,
|
||||
RenderBlock fn, RenderBlock inverse)
|
||||
{
|
||||
var property = arguments?.FirstOrDefault() as JsonProperty;
|
||||
if (property != null)
|
||||
{
|
||||
string type = null;
|
||||
if (arguments.Count > 1)
|
||||
{
|
||||
type = arguments[1] as string;
|
||||
}
|
||||
|
||||
if (type == "object" && property.Reference != null && !property.IsArray && property.AdditionalPropertiesSchema == null)
|
||||
{
|
||||
fn(null);
|
||||
}
|
||||
else if (type == "objectarray" && property.IsArray && property.Item?.Reference != null)
|
||||
{
|
||||
fn(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static string ToPascalCase(string name)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
@@ -537,5 +1044,40 @@ namespace KubernetesWatchGenerator
|
||||
|
||||
return char.ToUpper(name[0]) + name.Substring(1);
|
||||
}
|
||||
|
||||
public static IEnumerable<string> WordWrap(string text, int width)
|
||||
{
|
||||
var lines = text.Split(new[] { "\r\n", "\r", "\n" }, StringSplitOptions.None);
|
||||
foreach (var line in lines)
|
||||
{
|
||||
var processedLine = line.Trim();
|
||||
|
||||
// yield empty lines as they are (probably) intensional
|
||||
if (processedLine.Length == 0)
|
||||
{
|
||||
yield return processedLine;
|
||||
}
|
||||
|
||||
// feast on the line until it's gone
|
||||
while (processedLine.Length > 0)
|
||||
{
|
||||
// determine potential wrapping points
|
||||
var whitespacePositions = Enumerable
|
||||
.Range(0, processedLine.Length)
|
||||
.Where(i => char.IsWhiteSpace(processedLine[i]))
|
||||
.Concat(new[] { processedLine.Length })
|
||||
.Cast<int?>();
|
||||
var preWidthWrapAt = whitespacePositions.LastOrDefault(i => i <= width);
|
||||
var postWidthWrapAt = whitespacePositions.FirstOrDefault(i => i > width);
|
||||
|
||||
// choose preferred wrapping point
|
||||
var wrapAt = preWidthWrapAt ?? postWidthWrapAt ?? processedLine.Length;
|
||||
|
||||
// wrap
|
||||
yield return processedLine.Substring(0, wrapAt);
|
||||
processedLine = processedLine.Substring(wrapAt).Trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
// <auto-generated>
|
||||
// Code generated by gen/KubernetesWatchGenerator
|
||||
// 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.
|
||||
// </auto-generated>
|
||||
@@ -1,32 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
|
||||
<PackageReference Include="NSwag.Core" Version="11.17.2" />
|
||||
<PackageReference Include="Nustache" Version="1.16.0.8" NoWarn="NU1701" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="ModelExtensions.cs.template">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Kubernetes.Watch.cs.template">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="IKubernetes.Watch.cs.template">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="ModelOperators.cs.template">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="VersionConverter.cs.template">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -29,8 +29,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KubernetesClient.Tests", "t
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "gen", "{879F8787-C3BB-43F3-A92D-6D4C7D3A5285}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KubernetesWatchGenerator", "gen\KubernetesWatchGenerator\KubernetesWatchGenerator.csproj", "{542DC30E-FDF7-4A35-B026-6C21F435E8B1}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "patch", "examples\patch\patch.csproj", "{04DE2C84-117D-4E21-8B45-B7AE627697BD}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "httpClientFactory", "examples\httpClientFactory\httpClientFactory.csproj", "{A07314A0-02E8-4F36-B233-726D59D28F08}"
|
||||
@@ -41,7 +39,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "E2E.Tests", "tests\E2E.Test
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SkipTestLogger", "tests\SkipTestLogger\SkipTestLogger.csproj", "{4D2AE427-F856-49E5-B61D-EA6B17D89051}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "customResource", "examples\customResource\customResource.csproj", "{95672061-5799-4454-ACDB-D6D330DB1EC4}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "customResource", "examples\customResource\customResource.csproj", "{95672061-5799-4454-ACDB-D6D330DB1EC4}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KubernetesGenerator", "gen\KubernetesGenerator\KubernetesGenerator.csproj", "{79BA7C4A-98AA-467E-80D4-0E4F03EE6DDE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -161,18 +161,6 @@ Global
|
||||
{806AD0E5-833F-42FB-A870-4BCEE7F4B17F}.Release|x64.Build.0 = Release|Any CPU
|
||||
{806AD0E5-833F-42FB-A870-4BCEE7F4B17F}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{806AD0E5-833F-42FB-A870-4BCEE7F4B17F}.Release|x86.Build.0 = Release|Any CPU
|
||||
{542DC30E-FDF7-4A35-B026-6C21F435E8B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{542DC30E-FDF7-4A35-B026-6C21F435E8B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{542DC30E-FDF7-4A35-B026-6C21F435E8B1}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{542DC30E-FDF7-4A35-B026-6C21F435E8B1}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{542DC30E-FDF7-4A35-B026-6C21F435E8B1}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{542DC30E-FDF7-4A35-B026-6C21F435E8B1}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{542DC30E-FDF7-4A35-B026-6C21F435E8B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{542DC30E-FDF7-4A35-B026-6C21F435E8B1}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{542DC30E-FDF7-4A35-B026-6C21F435E8B1}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{542DC30E-FDF7-4A35-B026-6C21F435E8B1}.Release|x64.Build.0 = Release|Any CPU
|
||||
{542DC30E-FDF7-4A35-B026-6C21F435E8B1}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{542DC30E-FDF7-4A35-B026-6C21F435E8B1}.Release|x86.Build.0 = Release|Any CPU
|
||||
{04DE2C84-117D-4E21-8B45-B7AE627697BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{04DE2C84-117D-4E21-8B45-B7AE627697BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{04DE2C84-117D-4E21-8B45-B7AE627697BD}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
@@ -245,6 +233,18 @@ Global
|
||||
{95672061-5799-4454-ACDB-D6D330DB1EC4}.Release|x64.Build.0 = Release|Any CPU
|
||||
{95672061-5799-4454-ACDB-D6D330DB1EC4}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{95672061-5799-4454-ACDB-D6D330DB1EC4}.Release|x86.Build.0 = Release|Any CPU
|
||||
{79BA7C4A-98AA-467E-80D4-0E4F03EE6DDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{79BA7C4A-98AA-467E-80D4-0E4F03EE6DDE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{79BA7C4A-98AA-467E-80D4-0E4F03EE6DDE}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{79BA7C4A-98AA-467E-80D4-0E4F03EE6DDE}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{79BA7C4A-98AA-467E-80D4-0E4F03EE6DDE}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{79BA7C4A-98AA-467E-80D4-0E4F03EE6DDE}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{79BA7C4A-98AA-467E-80D4-0E4F03EE6DDE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{79BA7C4A-98AA-467E-80D4-0E4F03EE6DDE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{79BA7C4A-98AA-467E-80D4-0E4F03EE6DDE}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{79BA7C4A-98AA-467E-80D4-0E4F03EE6DDE}.Release|x64.Build.0 = Release|Any CPU
|
||||
{79BA7C4A-98AA-467E-80D4-0E4F03EE6DDE}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{79BA7C4A-98AA-467E-80D4-0E4F03EE6DDE}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -259,13 +259,13 @@ Global
|
||||
{1DDB0CCF-7CCE-4A60-BAC6-9AE1779DEDB5} = {B70AFB57-57C9-46DC-84BE-11B7DDD34B40}
|
||||
{35DD7248-F9EC-4272-A32C-B0C59E5A6FA7} = {3D1864AA-1FFC-4512-BB13-46055E410F73}
|
||||
{806AD0E5-833F-42FB-A870-4BCEE7F4B17F} = {8AF4A5C2-F0CE-47D5-A4C5-FE4AB83CA509}
|
||||
{542DC30E-FDF7-4A35-B026-6C21F435E8B1} = {879F8787-C3BB-43F3-A92D-6D4C7D3A5285}
|
||||
{04DE2C84-117D-4E21-8B45-B7AE627697BD} = {B70AFB57-57C9-46DC-84BE-11B7DDD34B40}
|
||||
{A07314A0-02E8-4F36-B233-726D59D28F08} = {B70AFB57-57C9-46DC-84BE-11B7DDD34B40}
|
||||
{B9647AD4-F6B0-406F-8B79-6781E31600EC} = {B70AFB57-57C9-46DC-84BE-11B7DDD34B40}
|
||||
{5056C4A2-5E12-4C16-8DA7-8835DA58BFF2} = {8AF4A5C2-F0CE-47D5-A4C5-FE4AB83CA509}
|
||||
{4D2AE427-F856-49E5-B61D-EA6B17D89051} = {8AF4A5C2-F0CE-47D5-A4C5-FE4AB83CA509}
|
||||
{95672061-5799-4454-ACDB-D6D330DB1EC4} = {B70AFB57-57C9-46DC-84BE-11B7DDD34B40}
|
||||
{79BA7C4A-98AA-467E-80D4-0E4F03EE6DDE} = {879F8787-C3BB-43F3-A92D-6D4C7D3A5285}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {049A763A-C891-4E8D-80CF-89DD3E22ADC7}
|
||||
|
||||
Reference in New Issue
Block a user