MCPcopy Create free account
hub / github.com/PowerShell/DSC / validate

Method validate

lib/dsc-lib/src/dscresources/dscresource.rs:507–524  ·  view source on GitHub ↗
(&self, config: &str)

Source from the content-addressed store, hash-verified

505 }
506
507 fn validate(&self, config: &str) -> Result<ValidateResult, DscError> {
508 debug!("{}", t!("dscresources.dscresource.invokeValidate", resource = self.type_name));
509 if let Some(deprecation_message) = self.deprecation_message.as_ref() {
510 warn!("{}", t!("dscresources.dscresource.deprecationMessage", resource = self.type_name, message = deprecation_message));
511 }
512 if self.require_adapter.is_some() {
513 return Err(DscError::NotSupported(t!("dscresources.dscresource.invokeValidateNotSupported", resource = self.type_name).to_string()));
514 }
515
516 match &self.implemented_as {
517 Some(ImplementedAs::Command) => {
518 command_resource::invoke_validate(self, config, self.target_resource.as_deref())
519 },
520 _ => {
521 Err(DscError::NotImplemented(t!("dscresources.dscresource.customResourceNotSupported").to_string()))
522 },
523 }
524 }
525
526 fn schema(&self) -> Result<String, DscError> {
527 debug!("{}", t!("dscresources.dscresource.invokeSchema", resource = self.type_name));

Callers 3

validate_propertiesFunction · 0.45
validate_jsonFunction · 0.45

Calls 2

invoke_validateFunction · 0.85
as_refMethod · 0.45

Tested by

no test coverage detected