from typing import Unpack
from q2_sdk.core.install_steps.base import (
InstallStep,
InstallStepAttribute,
InstallStepArguments,
)
from q2_sdk.hq.db.user_account_attribute import (
UserAccountAttribute as UserAccountAttributeDbObj,
)
[docs]
class UserAccountAttribute(InstallStep):
"""Interacts with the Q2_UserAccountAttribute table"""
def __init__(self, short_name, **kwargs: Unpack[InstallStepArguments]):
super().__init__(**kwargs)
self.short_name = InstallStepAttribute(short_name)
[docs]
async def install(self):
await super().install()
await UserAccountAttributeDbObj(
self.logger, hq_credentials=self.hq_credentials
).create(self.short_name.value)
[docs]
async def uninstall(self):
await UserAccountAttributeDbObj(
self.logger, hq_credentials=self.hq_credentials
).delete(self.short_name.value)