//! Git hooks adapter requirement.

use core::any::Any;

use aqc_git_hooks_engine::{GitHooksPath, TextFileRequirements};
use shackles_core::{AdapterRequirement, ScalarAssertion};

use crate::types::ADAPTER_ID;

#[derive(Debug, Clone, Default)]
pub struct GitHooksAdapterRequirement {
    pub hooks_path: Option<ScalarAssertion<GitHooksPath>>,
    pub files: TextFileRequirements,
}

impl AdapterRequirement for GitHooksAdapterRequirement {
    fn adapter_id(&self) -> &'static str {
        ADAPTER_ID
    }

    fn as_any(&self) -> &dyn Any {
        self
    }
}
