PinFlow.h (2036B)
1 // Copyright (c) Microsoft Corporation. 2 // Licensed under the MIT License. 3 #pragma once 4 #include "ExecutionContext.h" 5 6 namespace AppInstaller::CLI::Workflow 7 { 8 // Opens the pinning index for use in future operations. 9 // Required Args: None 10 // Inputs: None 11 // Outputs: PinningIndex 12 struct OpenPinningIndex : public WorkflowTask 13 { 14 OpenPinningIndex(bool readOnly = false) : WorkflowTask("OpenPinningIndex"), m_readOnly(readOnly) {} 15 16 void operator()(Execution::Context& context) const override; 17 18 private: 19 bool m_readOnly; 20 }; 21 22 // Gets all the pins from the index. 23 // Required Args: None 24 // Inputs: PinningIndex 25 // Outputs: Pins 26 void GetAllPins(Execution::Context& context); 27 28 // Searches for all the pins associated with a package. 29 // There may be several if a package is available from multiple sources 30 // or if the pin is for the installed package. 31 // Required Args: None 32 // Inputs: PinningIndex, Package 33 // Outputs: Pins 34 void SearchPin(Execution::Context& context); 35 36 // Adds a pin for the current package. 37 // A separate pin will be added for each source. 38 // Required Args: None 39 // Inputs: PinningIndex, Package, InstalledVersion? 40 // Outputs: None 41 void AddPin(Execution::Context& context); 42 43 // Removes all the pins associated with a package. 44 // Required Args: None 45 // Inputs: PinningIndex, Package, InstalledPackageVersion 46 // Outputs: None 47 void RemovePin(Execution::Context& context); 48 49 // Report the pins in a table. 50 // This includes searching for the corresponding installed packages 51 // to be able to show more info, like the package name. 52 // Required Args: None 53 // Inputs: Pins 54 // Outputs: None 55 void ReportPins(Execution::Context& context); 56 57 // Resets all the existing pins. 58 // Required Args: None 59 // Inputs: None 60 // Outputs: None 61 void ResetAllPins(Execution::Context& context); 62 }