def sorted_members(self):
        members = collections.OrderedDict()
        required_names = self.metadata.get("required", ())
        for name, shape in self.members.items():
            members[name] = AbShapeMember(name=name, shape=shape, is_required=name in required_names)
        if self.is_output_shape:
            yield AbShapeMember(
                name="ResponseMetadata",
                shape=self._shape_resolver.get_shape_by_name("ResponseMetadata"),
                is_required=True,
            )
        yield from sorted(members.values(), key=lambda m: not m.is_required)