in azext_iot/monitor/property.py [0:0]
def _validate_payload_against_entities(self, payload: dict, name, minimum_severity):
name_miss = []
issues_handler = IssueHandler()
if not self._is_component(payload):
# update is not part of a component check under interfaces
schema = self._template.get_schema(name=name)
if not schema:
name_miss.append(name)
details = strings.invalid_field_name_mismatch_template(
name_miss, self._template.schema_names
)
interfaces_with_specified_property = (
self._template._get_interface_list_property(name)
)
if len(interfaces_with_specified_property) > 1:
details = strings.duplicate_property_name(
name, interfaces_with_specified_property
)
issues_handler.add_central_issue(
severity=Severity.warning,
details=details,
message=None,
device_id=self._device_id,
template_id=self._template.id,
)
else:
# Property update is part of a component perform additional validations under component list.
component_property_updates = [
property_name
for property_name in payload
if property_name != PNP_DTDLV2_COMPONENT_MARKER
]
for property_name in component_property_updates:
schema = self._template.get_schema(
name=property_name, identifier=name, is_component=True
)
if not schema:
name_miss.append(property_name)
details = strings.invalid_field_name_component_mismatch_template(
name_miss, self._template.component_schema_names
)
if name_miss:
issues_handler.add_central_issue(
severity=Severity.warning,
details=details,
message=None,
device_id=self._device_id,
template_id=self._template.id,
)
return issues_handler.get_issues_with_minimum_severity(minimum_severity)