コード例 #1
0
        /// <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."));
        }
コード例 #2
0
        /// <summary>
        ///     Create a new <see cref="KubeResultV1"/>.
        /// </summary>
        /// <param name="status">
        ///     The <see cref="StatusV1"/> that represents the operation result.
        /// </param>
        protected KubeResultV1(StatusV1 status)
        {
            if (status == null)
            {
                throw new ArgumentNullException(nameof(status));
            }

            Status = status;
        }
コード例 #3
0
 /// <summary>
 ///     Create a new <see cref="KubeResourceListResultV1{TResource}"/> representing a <see cref="StatusV1"/>.
 /// </summary>
 /// <param name="status">
 ///     The <see cref="StatusV1"/> represented by the <see cref="KubeResourceListResultV1{TResource}"/>.
 /// </param>
 public KubeResourceListResultV1(StatusV1 status)
     : base(status)
 {
 }