from typing import Unpack
from q2_sdk.core.install_steps.base import (
InstallStep,
InstallStepAttribute,
InstallStepArguments,
)
from q2_sdk.hq.db.api_stored_proc import ApiStoredProc as ApiStoredProcDbObj
[docs]
class ApiStoredProc(InstallStep):
def __init__(
self,
short_name,
description=None,
name=None,
**kwargs: Unpack[InstallStepArguments],
):
super().__init__(**kwargs)
self.short_name = InstallStepAttribute(short_name)
self.description = InstallStepAttribute(description)
self.name = InstallStepAttribute(name)
[docs]
async def install(self):
await super().install()
await ApiStoredProcDbObj(
self.logger, hq_credentials=self.hq_credentials
).create(self.short_name.value, self.description.value, self.name.value)