/// <summary> /// The default <see cref="StatusV1"/> used when no status is available because an operation returned a list of resources. /// </summary> protected static StatusV1 DefaultStatus(KubeResourceListV1 <TResource> resources) { (string kind, string apiVersion) = KubeObjectV1.GetKubeKind <TResource>(); int resourceCount = resources != null ? resources.Items.Count : 0; return(StatusV1.Success($"Result contains {resourceCount} {apiVersion}/{kind} resources.")); }
/// <summary> /// Create a new <see cref="KubeResourceListResultV1{TResource}"/> representing the specified <typeparamref name="TResource"/> list. /// </summary> /// <param name="resources"> /// The <typeparamref name="TResource"/> list represented by the <see cref="KubeResourceListResultV1{TResource}"/>. /// </param> public KubeResourceListResultV1(KubeResourceListV1 <TResource> resources) : base(DefaultStatus(resources)) { Resources = resources; }