// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 using System; using System.Collections.Generic; using System.Linq; namespace AWS.Deploy.CLI.ServerMode.Models { /// /// A category defined in the recipe that settings will be mapped to via the Id property. /// public class CategorySummary { /// /// The id of the category that will be specified on top level settings. /// public string Id { get; set; } /// /// The display name of the category shown to users in UI screens. /// public string DisplayName { get; set; } /// /// The order used to sort categories in UI screens. Categories will be shown in sorted descending order. /// public int Order { get; set; } public CategorySummary(string id, string displayName, int order) { Id = id; DisplayName = displayName; Order = order; } /// /// Transform recipe category types into the this ServerMode model type. /// /// /// public static List FromCategories(List categories) { return categories.Select(x => new CategorySummary(id: x.Id, displayName: x.DisplayName, order: x.Order)).ToList(); } } }