from .._omni_kit_usd_layers import acquire_auto_authoring_interface, release_auto_authoring_interface, ILayersInstance


class AutoAuthoring:
    def __init__(self, layers_instance: ILayersInstance, usd_context) -> None:
        self._layers_instance = layers_instance
        self._usd_context = usd_context
        self._auto_authoring_interface = acquire_auto_authoring_interface()

    @property
    def usd_context(self):
        return self._usd_context
        
    def destroy(self):
        self._layers_instance = None
        release_auto_authoring_interface(self._auto_authoring_interface)

    def is_enabled(self) -> bool:
        return self._auto_authoring_interface.is_enabled(self._layers_instance)

    def set_default_layer(self, layer_identifier: str):
        self._auto_authoring_interface.set_default_layer(self._layers_instance, layer_identifier)

    def get_default_layer(self) -> str:
        return self._auto_authoring_interface.get_default_layer(self._layers_instance)

    def is_auto_authoring_layer(self, layer_identifier: str) -> bool:
        return self._auto_authoring_interface.is_auto_authoring_layer(self._layers_instance, layer_identifier)
