Create a receipt for a just-completed install.
(
agent: &str,
version: &str,
cli_version: &str,
source: &str,
files: Vec<ReceiptFile>,
settings: Vec<ReceiptSettings>,
)
| 98 | impl Receipt { |
| 99 | /// Create a receipt for a just-completed install. |
| 100 | pub fn new( |
| 101 | agent: &str, |
| 102 | version: &str, |
| 103 | cli_version: &str, |
| 104 | source: &str, |
| 105 | files: Vec<ReceiptFile>, |
| 106 | settings: Vec<ReceiptSettings>, |
| 107 | ) -> Self { |
| 108 | Self { |
| 109 | schema: RECEIPT_SCHEMA, |
| 110 | agent: agent.to_string(), |
| 111 | version: version.to_string(), |
| 112 | cli_version: cli_version.to_string(), |
| 113 | installed_at: chrono::Utc::now().to_rfc3339(), |
| 114 | source: source.to_string(), |
| 115 | files, |
| 116 | settings, |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | /// Persist the receipt under `~/.atomic/integrations/<agent>/`. |
| 121 | pub fn save(&self) -> AgentResult<PathBuf> { |
nothing calls this directly
no outgoing calls
no test coverage detected