# Path: src/stratis_cli/_constants.py
# class PoolMaintenanceErrorCode(IntEnum):
#     """
#     Maintenance error codes for the pool.
#     """
# 
#     NO_IPC_REQUESTS = 1
#     NO_POOL_CHANGES = 2
#     READ_ONLY = 3
# 
#     def __str__(self):
#         return "EM%s" % str(self.value).zfill(3)
# 
#     @staticmethod
#     def from_str(code_str):
#         """
#         Discover the code, if any, from the code string.
# 
#         :returns: the code if it finds a match, otherwise None
#         :rtype: PoolMaintenanceErrorCode or NoneType
#         """
#         for code in PoolMaintenanceErrorCode:
#             if code_str == str(code):
#                 return code
#         return None
# 
#     def explain(self):
#         """
#         Return an explanation of the error return code.
#         """
#         if self is PoolMaintenanceErrorCode.NO_IPC_REQUESTS:
#             return (
#                 "The pool will return an error on any IPC request that could "
#                 "cause a change in the pool state, for example, a request to "
#                 "rename a filesystem. It will still be able to respond to "
#                 "purely informational requests."
#             )
# 
#         if self is PoolMaintenanceErrorCode.NO_POOL_CHANGES:
#             return (
#                 "The pool is unable to manage itself by reacting to events, "
#                 "such as devicemapper events, that might require it to take "
#                 "any maintenance operations."
#             )
# 
#         if self is PoolMaintenanceErrorCode.READ_ONLY:  # pragma: no cover
#             return "The pool is in read-only mode."
# 
#         assert False, "impossible error code reached"  # pragma: no cover


from enum import Enum, IntEnum
from ._constants import PoolMaintenanceErrorCode
        if self is PoolActionAvailability.NO_POOL_CHANGES:
            return "no_pool_changes"
        if self is PoolActionAvailability.NO_WRITE_IO:  # pragma: no cover
            return "no_write_io"

        assert False, "impossible value reached"  # pragma: no cover

    @staticmethod
    def from_str(code_str):
        """
        Get ActionAvailability object from a string.
        :param str code_str: a code string
        :rtype: str or NoneType
        """
        for item in list(PoolActionAvailability):
            if code_str == str(item):
                return item
        return None

    def pool_maintenance_error_codes(self):
        """
        Return the list of PoolMaintenanceErrorCodes for this availability.

        :rtype: list of PoolMaintenanceErrorCode
        """
        codes = []
        if self >= PoolActionAvailability.NO_IPC_REQUESTS:
            codes.append(PoolMaintenanceErrorCode.NO_IPC_REQUESTS)

        if self >= PoolActionAvailability.NO_POOL_CHANGES:

# Path: src/stratis_cli/_constants.py
# class PoolMaintenanceErrorCode(IntEnum):
#     """
#     Maintenance error codes for the pool.
#     """
# 
#     NO_IPC_REQUESTS = 1
#     NO_POOL_CHANGES = 2
#     READ_ONLY = 3
# 
#     def __str__(self):
#         return "EM%s" % str(self.value).zfill(3)
# 
#     @staticmethod
#     def from_str(code_str):
#         """
#         Discover the code, if any, from the code string.
# 
#         :returns: the code if it finds a match, otherwise None
#         :rtype: PoolMaintenanceErrorCode or NoneType
#         """
#         for code in PoolMaintenanceErrorCode:
#             if code_str == str(code):
#                 return code
#         return None
# 
#     def explain(self):
#         """
#         Return an explanation of the error return code.
#         """
#         if self is PoolMaintenanceErrorCode.NO_IPC_REQUESTS:
#             return (
#                 "The pool will return an error on any IPC request that could "
#                 "cause a change in the pool state, for example, a request to "
#                 "rename a filesystem. It will still be able to respond to "
#                 "purely informational requests."
#             )
# 
#         if self is PoolMaintenanceErrorCode.NO_POOL_CHANGES:
#             return (
#                 "The pool is unable to manage itself by reacting to events, "
#                 "such as devicemapper events, that might require it to take "
#                 "any maintenance operations."
#             )
# 
#         if self is PoolMaintenanceErrorCode.READ_ONLY:  # pragma: no cover
#             return "The pool is in read-only mode."
# 
#         assert False, "impossible error code reached"  # pragma: no cover


# Path: src/stratis_cli/_stratisd_constants.py
from enum import Enum, IntEnum
from ._constants import PoolMaintenanceErrorCode

        if self is PoolActionAvailability.NO_POOL_CHANGES:
            return "no_pool_changes"
        if self is PoolActionAvailability.NO_WRITE_IO:  # pragma: no cover
            return "no_write_io"

        assert False, "impossible value reached"  # pragma: no cover

    @staticmethod
    def from_str(code_str):
        """
        Get ActionAvailability object from a string.
        :param str code_str: a code string
        :rtype: str or NoneType
        """
        for item in list(PoolActionAvailability):
            if code_str == str(item):
                return item
        return None

    def pool_maintenance_error_codes(self):
        """
        Return the list of PoolMaintenanceErrorCodes for this availability.

        :rtype: list of PoolMaintenanceErrorCode
        """
        codes = []
        if self >= PoolActionAvailability.NO_IPC_REQUESTS:
            codes.append(PoolMaintenanceErrorCode.NO_IPC_REQUESTS)

        if self >= PoolActionAvailability.NO_POOL_CHANGES:

            codes.append(PoolMaintenanceErrorCode.NO_POOL_CHANGES)