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