def as_dict()

in rostran/core/resources.py [0:0]


    def as_dict(self, format=False):
        data = {Resource.TYPE: self.type}
        if self.condition:
            data[Resource.CONDITION] = self.condition
        data[Resource.PROPERTIES] = self.properties.as_dict(format=format)
        if self.depends_on:
            if format and isinstance(self.depends_on, list):
                depends_on = sorted_data(self.depends_on)
            else:
                depends_on = self.depends_on
            data[Resource.DEPENDS_ON] = depends_on
        if self.deletion_policy:
            data[Resource.DELETION_POLICY] = self.deletion_policy
        if self.metadata:
            data[Resource.METADATA] = self.metadata
        if self.other_properties:
            other_properties = (
                sorted_data(self.other_properties) if format else self.other_properties
            )
            data.update(other_properties)
        return data