winget-cli

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

Enums.cs (6065B)


      1 // -----------------------------------------------------------------------------
      2 // <copyright file="Enums.cs" company="Microsoft Corporation">
      3 //     Copyright (c) Microsoft Corporation. Licensed under the MIT License.
      4 // </copyright>
      5 // -----------------------------------------------------------------------------
      6 
      7 namespace Microsoft.WinGetUtil.Common
      8 {
      9     using System;
     10 
     11     /// <summary>
     12     /// Options for creating a manifest for validation.
     13     /// Must be in sync with WinGetCreateManifestOption at:
     14     ///     https://github.com/microsoft/winget-cli/blob/master/src/WinGetUtil/WinGetUtil.h.
     15     /// </summary>
     16     [Flags]
     17     public enum WinGetCreateManifestOption
     18     {
     19         /// <summary>
     20         /// Just create the manifest without any validation
     21         /// </summary>
     22         NoValidation = 0,
     23 
     24         /// <summary>
     25         /// Only validate against json schema
     26         /// </summary>
     27         SchemaValidation = 0x1,
     28 
     29         /// <summary>
     30         /// Validate against schema and also perform semantic validation
     31         /// </summary>
     32         SchemaAndSemanticValidation = 0x2,
     33 
     34         /// <summary>
     35         /// Allow shadow manifest
     36         /// </summary>
     37         AllowShadowManifest = 0x4,
     38 
     39         // Below options are additional validation behaviors if needed
     40 
     41         /// <summary>
     42         /// Return error on manifest fields that require verified publishers, used during semantic validation
     43         /// </summary>
     44         ReturnErrorOnVerifiedPublisherFields = 0x1000,
     45     }
     46 
     47     /// <summary>
     48     /// Options for validating a manifest.
     49     /// Must be in sync with WinGetValidateManifestOptionV2 at:
     50     ///     https://github.com/microsoft/winget-cli/blob/master/src/WinGetUtil/WinGetUtil.h.
     51     /// </summary>
     52     [Flags]
     53     public enum WinGetValidateManifestOptionV2
     54     {
     55         /// <summary>
     56         /// No validation, caller will get E_INVALIDARG
     57         /// </summary>
     58         None = 0,
     59 
     60         /// <summary>
     61         /// Dependencies validation against index
     62         /// </summary>
     63         DependenciesValidation = 0x1,
     64 
     65         /// <summary>
     66         /// Arp version validation against index
     67         /// </summary>
     68         ArpVersionValidation = 0x2,
     69 
     70         /// <summary>
     71         /// Installer validation
     72         /// </summary>
     73         InstallerValidation = 0x4,
     74     }
     75 
     76     /// <summary>
     77     /// Operation type for validating a manifest.
     78     /// Must be in sync with WinGetValidateManifestOperationType at:
     79     ///     https://github.com/microsoft/winget-cli/blob/master/src/WinGetUtil/WinGetUtil.h.
     80     /// </summary>
     81     public enum WinGetValidateManifestOperationType
     82     {
     83         /// <summary>
     84         /// Add
     85         /// </summary>
     86         OperationTypeAdd = 0,
     87 
     88         /// <summary>
     89         /// Update
     90         /// </summary>
     91         OperationTypeUpdate = 1,
     92 
     93         /// <summary>
     94         /// Delete
     95         /// </summary>
     96         OperationTypeDelete = 2,
     97     }
     98 
     99     /// <summary>
    100     /// Manifest validation result.
    101     /// Must be in sync with WinGetValidateManifestResult at:
    102     ///     https://github.com/microsoft/winget-cli/blob/master/src/WinGetUtil/WinGetUtil.h.
    103     /// </summary>
    104     [Flags]
    105     public enum WinGetValidateManifestResult
    106     {
    107         /// <summary>
    108         /// Manifest validation success.
    109         /// </summary>
    110         Success = 0,
    111 
    112         // Each validation step should have an enum for corresponding failure.
    113 
    114         /// <summary>
    115         /// Dependencies validation failure.
    116         /// </summary>
    117         DependenciesValidationFailure = 0x1,
    118 
    119         /// <summary>
    120         /// Arp version validation failure.
    121         /// </summary>
    122         ArpVersionValidationFailure = 0x2,
    123 
    124         /// <summary>
    125         /// Installer validation failure.
    126         /// </summary>
    127         InstallerValidationFailure = 0x4,
    128 
    129         // Dependencies validation result.
    130 
    131         /// <summary>
    132         /// Single Manifest package has dependencies.
    133         /// </summary>
    134         SingleManifestPackageHasDependencies = 0x10000,
    135 
    136         /// <summary>
    137         /// Multi manifest package has dependencies.
    138         /// </summary>
    139         MultiManifestPackageHasDependencies = 0x20000,
    140 
    141         /// <summary>
    142         /// Missing manifest dependencies node.
    143         /// </summary>
    144         MissingManifestDependenciesNode = 0x40000,
    145 
    146         /// <summary>
    147         /// No Suitable min version found for manifest.
    148         /// </summary>
    149         NoSuitableMinVersionDependency = 0x80000,
    150 
    151         /// <summary>
    152         /// Validation encountered a loop during dependencies validation.
    153         /// </summary>
    154         FoundDependencyLoop = 0x100000,
    155 
    156         // Internal error meaning validation does not complete as desired.
    157 
    158         /// <summary>
    159         /// Manifest validation internal error.
    160         /// </summary>
    161         InternalError = 0x1000,
    162     }
    163 
    164     /// <summary>
    165     ///  Option flags for WinGetBeginInstallerMetadataCollection.
    166     /// </summary>
    167     [Flags]
    168     public enum WinGetBeginInstallerMetadataCollectionOptions
    169     {
    170         /// <summary>
    171         /// None.
    172         /// </summary>
    173         WinGetBeginInstallerMetadataCollectionOption_None = 0,
    174 
    175         /// <summary>
    176         /// The inputJSON is a local file path, not a JSON string.
    177         /// </summary>
    178         WinGetBeginInstallerMetadataCollectionOption_InputIsFilePath = 0x1,
    179 
    180         /// <summary>
    181         ///  The inputJSON is a remote URI, not a JSON string.
    182         /// </summary>
    183         WinGetBeginInstallerMetadataCollectionOption_InputIsURI = 0x2,
    184     }
    185 
    186     /// <summary>
    187     /// Option flags for WinGetCompleteInstallerMetadataCollection.
    188     /// </summary>
    189     [Flags]
    190     public enum WinGetCompleteInstallerMetadataCollectionOptions
    191     {
    192         /// <summary>
    193         /// Metadata collection option none.
    194         /// </summary>
    195         WinGetCompleteInstallerMetadataCollectionOption_None = 0,
    196 
    197         /// <summary>
    198         /// Complete will simply free the collection handle without doing any additional work.
    199         /// </summary>
    200         WinGetCompleteInstallerMetadataCollectionOption_Abandon = 0x1,
    201     }
    202 }