def _kwarg_init_constructor(self, **kwargs): self.__suspend_mutability_checks__ = True try: for k in kwargs: if not hasattr(type(self), k): raise exc.ArtifactInvalidProperty(prop=k) setattr(self, k, kwargs[k]) self._validate_required(self.metadata.attributes.properties) finally: del self.__suspend_mutability_checks__
def _update(self, values): for k in values: if hasattr(type(self), k): setattr(self, k, values[k]) else: raise exc.ArtifactInvalidProperty(prop=k)
def get_type_specific_property(self, prop_name): try: return getattr(self.base, prop_name) except AttributeError: raise exc.ArtifactInvalidProperty(prop=prop_name)
def __getattr__(self, name): if not hasattr(self, name): raise exc.ArtifactInvalidProperty(prop=name) return super(ArtifactProxy, self).__getattr__(name)