Add IKubernetesObject<TMetadata> (#404)
This commit is contained in:
@@ -3,11 +3,8 @@ using NSwag;
|
|||||||
using Nustache.Core;
|
using Nustache.Core;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Http;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace KubernetesWatchGenerator
|
namespace KubernetesWatchGenerator
|
||||||
@@ -227,10 +224,13 @@ namespace KubernetesWatchGenerator
|
|||||||
var kind = groupVersionKind["kind"] as string;
|
var kind = groupVersionKind["kind"] as string;
|
||||||
var className = GetClassName(definition);
|
var className = GetClassName(definition);
|
||||||
var interfaces = new List<string>();
|
var interfaces = new List<string>();
|
||||||
interfaces.Add("IKubernetesObject");
|
|
||||||
if (definition.Properties.TryGetValue("metadata", out var metadataProperty))
|
if (definition.Properties.TryGetValue("metadata", out var metadataProperty))
|
||||||
{
|
{
|
||||||
interfaces.Add($"IMetadata<{GetClassNameForSchemaDefinition(metadataProperty.Reference)}>");
|
interfaces.Add($"IKubernetesObject<{GetClassNameForSchemaDefinition(metadataProperty.Reference)}>");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
interfaces.Add("IKubernetesObject");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (definition.Properties.TryGetValue("items", out var itemsProperty))
|
if (definition.Properties.TryGetValue("items", out var itemsProperty))
|
||||||
|
|||||||
@@ -33,4 +33,10 @@ namespace k8s
|
|||||||
[JsonProperty(PropertyName = "kind")]
|
[JsonProperty(PropertyName = "kind")]
|
||||||
string Kind { get; set; }
|
string Kind { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>Represents a generic Kubernetes object that has an API version, a kind, and metadata.</summary>
|
||||||
|
/// <typeparam name="TMetadata"></typeparam>
|
||||||
|
public interface IKubernetesObject<TMetadata> : IKubernetesObject, IMetadata<TMetadata>
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user