|
| 1 | +use crate::{ |
| 2 | + contracts::{ |
| 3 | + common::ResourceKind, |
| 4 | + detect::{ClientDetection, DetectionEvidence, DetectionStatus}, |
| 5 | + mutate::MutationAction, |
| 6 | + }, |
| 7 | + domain::{AdapterListResult, AdapterMutationResult, ClientProfile}, |
| 8 | +}; |
| 9 | + |
| 10 | +pub fn detect_placeholder( |
| 11 | + profile: &'static ClientProfile, |
| 12 | + include_versions: bool, |
| 13 | +) -> ClientDetection { |
| 14 | + ClientDetection { |
| 15 | + client: profile.kind, |
| 16 | + status: DetectionStatus::Absent, |
| 17 | + evidence: DetectionEvidence { |
| 18 | + binary_path: None, |
| 19 | + config_path: None, |
| 20 | + version: include_versions.then_some("not_collected".to_string()), |
| 21 | + }, |
| 22 | + note: format!( |
| 23 | + "{} adapter scaffold is ready. Detection implementation will be added in issue #19/#20.", |
| 24 | + profile.display_name |
| 25 | + ), |
| 26 | + } |
| 27 | +} |
| 28 | + |
| 29 | +pub fn list_placeholder( |
| 30 | + profile: &'static ClientProfile, |
| 31 | + resource_kind: ResourceKind, |
| 32 | +) -> AdapterListResult { |
| 33 | + AdapterListResult { |
| 34 | + items: Vec::new(), |
| 35 | + warning: Some(format!( |
| 36 | + "{} listing for '{}' is not implemented yet.", |
| 37 | + resource_kind.as_str(), |
| 38 | + profile.key |
| 39 | + )), |
| 40 | + } |
| 41 | +} |
| 42 | + |
| 43 | +pub fn mutate_placeholder( |
| 44 | + profile: &'static ClientProfile, |
| 45 | + action: MutationAction, |
| 46 | + target_id: &str, |
| 47 | +) -> AdapterMutationResult { |
| 48 | + AdapterMutationResult { |
| 49 | + accepted: false, |
| 50 | + message: format!( |
| 51 | + "Mutation '{}' for '{}' on '{}' is not implemented yet.", |
| 52 | + action.as_str(), |
| 53 | + target_id, |
| 54 | + profile.key |
| 55 | + ), |
| 56 | + } |
| 57 | +} |
0 commit comments