Create the object from a previously serialized object.

        :param data: The output of the "serialize" call
        Example:
        source_id = 'foobar123'
        name = 'Address Schema'
        version = '1.0'
        attrs = ['address', 'city', 'state']
        payment_handle = 0
        schema1 = await Schema.create(source_id, name, version, attrs, payment_handle)
        data1 = await schema1.serialize()
        :return: A re-instantiated object

async def deserialize(data: dict):
        """
        Create the object from a previously serialized object.

        :param data: The output of the "serialize" call
        Example:
        source_id = 'foobar123'
        name = 'Address Schema'
        version = '1.0'
        attrs = ['address', 'city', 'state']
        payment_handle = 0
        schema1 = await Schema.create(source_id, name, version, attrs, payment_handle)
        data1 = await schema1.serialize()
        :return: A re-instantiated object
        """
        try:
            # Todo: Find better way to access attr_names. Potential for issues.
            schema = await Schema._deserialize("vcx_schema_deserialize",
                                               json.dumps(data),
                                               data['data']['source_id'],
                                               data['data']['name'],
                                               data['data']['version'],
                                               data['data']['data'])

            schema.schema_id = await schema.get_schema_id()
            return schema
        except KeyError:
            raise VcxError(ErrorCode.InvalidSchema)