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

Method schema

lib/dsc-lib/src/dscresources/dscresource.rs:526–546  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

524 }
525
526 fn schema(&self) -> Result<String, DscError> {
527 debug!("{}", t!("dscresources.dscresource.invokeSchema", resource = self.type_name));
528 if let Some(deprecation_message) = self.deprecation_message.as_ref() {
529 warn!("{}", t!("dscresources.dscresource.deprecationMessage", resource = self.type_name, message = deprecation_message));
530 }
531 if let Some(schema) = &self.schema {
532 return Ok(serde_json::to_string(schema)?);
533 }
534 if let Some(adapter) = &self.require_adapter {
535 return self.invoke_schema_with_adapter(adapter, self);
536 }
537
538 match &self.implemented_as {
539 Some(ImplementedAs::Command) => {
540 command_resource::get_schema(self, self.target_resource.as_deref())
541 },
542 _ => {
543 Err(DscError::NotImplemented(t!("dscresources.dscresource.customResourceNotSupported").to_string()))
544 },
545 }
546 }
547
548 fn export(&self, input: &str) -> Result<ExportResult, DscError> {
549 debug!("{}", t!("dscresources.dscresource.invokeExport", resource = self.type_name));

Callers 4

validate_propertiesFunction · 0.80
schemaFunction · 0.80
show_dsc_resourceMethod · 0.80

Calls 4

get_schemaFunction · 0.70
to_stringFunction · 0.50
as_refMethod · 0.45

Tested by

no test coverage detected