async def get_record(cls, controller: AcaPyClient, credential_exchange_id: str): credential_exchange_id = cred_id_no_version(credential_exchange_id) record = await controller.issue_credential_v1_0.get_record( cred_ex_id=credential_exchange_id, ) return cls.__record_to_model(record)
async def request_credential(cls, controller: AcaPyClient, credential_exchange_id: str): credential_exchange_id = cred_id_no_version(credential_exchange_id) record = await controller.issue_credential_v2_0.send_request( cred_ex_id=credential_exchange_id, body=V20CredRequestRequest()) return cls.__record_to_model(record)
async def store_credential( cls, controller: AcaPyClient, credential_exchange_id: str ): credential_exchange_id = cred_id_no_version(credential_exchange_id) record = await controller.issue_credential_v1_0.store_credential( cred_ex_id=credential_exchange_id, body=V10CredentialStoreRequest() ) return cls.__record_to_model(record)
async def get_record(cls, controller: AcaPyClient, credential_exchange_id: str): credential_exchange_id = cred_id_no_version(credential_exchange_id) record = await controller.issue_credential_v2_0.get_record( cred_ex_id=credential_exchange_id, ) if not record.cred_ex_record: raise Exception("Record has not credential exchang record") return cls.__record_to_model(record.cred_ex_record)
async def store_credential(cls, controller: AcaPyClient, credential_exchange_id: str): credential_exchange_id = cred_id_no_version(credential_exchange_id) record = await controller.issue_credential_v2_0.store_credential( cred_ex_id=credential_exchange_id, body=V20CredStoreRequest()) if not record.cred_ex_record: raise Exception("No cred_ex_record found on record") return cls.__record_to_model(record.cred_ex_record)
async def delete_credential(cls, controller: AcaPyClient, credential_exchange_id: str): credential_exchange_id = cred_id_no_version(credential_exchange_id) record = await controller.issue_credential_v2_0.get_record( cred_ex_id=credential_exchange_id) await controller.issue_credential_v2_0.delete_record( cred_ex_id=credential_exchange_id) # also delete indy credential if record.indy and record.indy.cred_id_stored: await controller.credentials.delete_record( credential_id=record.indy.cred_id_stored)