Create a credential based off of a known message id for a given connection.
        :param source_id: user defined id of object.
        :param connection: connection handle of connection to receive offer from
        :param msg_id: message id
        :return: A created credential
        Example:
        credential = await Credential.create_with_msgid(source_id, connection, msg_id)
        assert await credential.get_state() == State.RequestReceived

async def create_with_msgid(source_id: str, connection: Connection, msg_id: str):
        """
        Create a credential based off of a known message id for a given connection.
        :param source_id: user defined id of object.
        :param connection: connection handle of connection to receive offer from
        :param msg_id: message id
        :return: A created credential
        Example:
        credential = await Credential.create_with_msgid(source_id, connection, msg_id)
        assert await credential.get_state() == State.RequestReceived
        """
        credential = Credential(source_id,)

        c_source_id = c_char_p(source_id.encode('utf-8'))
        c_msg_id = c_char_p(json.dumps(msg_id).encode('utf-8'))
        c_connection_handle = c_uint32(connection.handle)

        if not hasattr(Credential.create_with_msgid, "cb"):
            Credential.create_with_msgid.cb = create_cb(CFUNCTYPE(None, c_uint32, c_uint32, c_uint32, c_char_p))

        credential.handle, cred_offer = await do_call('vcx_credential_create_with_msgid',
                                                      c_source_id,
                                                      c_connection_handle,
                                                      c_msg_id,
                                                      Credential.create_with_msgid.cb)

        credential.cred_offer = json.loads(cred_offer.decode())

        return credential