winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

GetFullItem.cs (1937B)


      1 // -----------------------------------------------------------------------------
      2 // <copyright file="GetFullItem.cs" company="Microsoft Corporation">
      3 //     Copyright (c) Microsoft Corporation. Licensed under the MIT License.
      4 // </copyright>
      5 // -----------------------------------------------------------------------------
      6 
      7 namespace Microsoft.Management.Configuration.Processor.DSCv3.Schema_2024_04.Outputs
      8 {
      9     using Microsoft.Management.Configuration.Processor.DSCv3.Model;
     10     using Microsoft.Management.Configuration.Processor.Extensions;
     11     using Windows.Foundation.Collections;
     12 
     13     /// <summary>
     14     /// The full form of the get output.
     15     /// When the retrieved instance is for group resource, adapter resource, or nested inside a group or adapter resource, DSC returns a full get result, which also includes the resource type and instance name.
     16     /// </summary>
     17     internal class GetFullItem : FullItemBase<GetSimpleItem, GetFullItem>, IResourceGetItem
     18     {
     19         /// <summary>
     20         /// Initializes a new instance of the <see cref="GetFullItem"/> class.
     21         /// </summary>
     22         public GetFullItem()
     23         {
     24         }
     25 
     26         /// <inheritdoc />
     27         public ValueSet Settings
     28         {
     29             get
     30             {
     31                 if (this.SimpleResult != null)
     32                 {
     33                     return this.SimpleResult.ActualState?.ToValueSet() ?? throw new System.InvalidOperationException("Get result has not been initialized.");
     34                 }
     35                 else if (this.FullResults != null)
     36                 {
     37                     throw new System.NotImplementedException("Requires constructing the entire group as the settings.");
     38                 }
     39                 else
     40                 {
     41                     throw new System.InvalidOperationException("Get result has not been initialized.");
     42                 }
     43             }
     44         }
     45     }
     46 }