# flake8: noqa
"""
The pyslk package provides Python wrapper functions for the slk and the
slk_helpers. The slk is the official command line interface (cli) of the
StrongLink system by StrongBox Data Solutions. The slk_helpers was developed
at DKRZ and provides some additional functionality beyond the slk.

* **pyslk.pyslk:** basic wrappers for nearly all slk and slk_helpers commands
* **pyslk.parsers:** extended wrappers for a few slk and slk_helpers commands
* **pyslk.utils:** some utility functions
* **pyslk.exceptions:** one exception class used in this package
"""
import importlib.metadata

from .base import (
    FileGroup,
    GroupCollection,
    StatusJob,
    cli_versions,
    expiration_date,
    get_resource_path,
    get_search_status,
    hostname,
    is_search_incomplete,
    is_search_successful,
    list_clone_file,
    list_clone_search,
)
from .base import ls
from .base import ls as list
from .base import (
    search,
    search_immediately,
    searchid_exists,
    session,
    total_number_search_results,
    valid_session,
    valid_token,
    version_slk,
    version_slk_helpers,
)
from .config import get, module_load, set
from .constants import (
    MAX_RETRIES_SUBMIT_JOBS_BASIC,
    MAX_RETRIES_SUBMIT_JOBS_SAVE_MODE,
    MIN_VERSION_SLK,
    MIN_VERSION_SLK_HELPERS,
    PYSLK_DEFAULT_LIST_CLONE_COLUMNS,
    PYSLK_DEFAULT_LIST_COLUMN_TYPES,
    PYSLK_DEFAULT_LIST_COLUMNS,
    PYSLK_DEFAULT_LIST_COLUMNS_3_3_21,
    PYSLK_DEFAULT_NUMBER_RETRIES_NONMOD_CMDS,
    PYSLK_FILE_SIZE_UNITS,
    PYSLK_LOGGER,
    PYSLK_SEARCH_DELAY,
    PYSLK_WILDCARDS,
    SEARCH_QUERY_OPERATORS,
    SLK,
    SLK_HELPERS,
    SLK_SYSTEM_CONFIG,
    SLK_USER_CONFIG,
    SLK_USER_LOG,
)
from .core import (
    access_hsm,
    arch_size,
    chgrp,
    chmod,
    chown,
    count_tapes,
    count_tapes_with_multi_tape_files,
    count_tapes_with_single_tape_files,
    delete,
    gen_file_query,
    gen_file_query_as_dict,
    gen_search_query,
    get_checksum,
    get_metadata,
    get_rcrs,
    get_resource_id,
    get_resource_mtime,
    get_resource_permissions,
    get_resource_size,
    get_resource_tape,
    get_resource_type,
    get_storage_information,
    get_tag,
    get_tape_barcode,
    get_tape_id,
    get_tape_status,
    group_files_by_tape,
    has_no_flag_partial,
    has_no_flag_partial_details,
    hsm2json,
    hsm2json_dict,
    hsm2json_file,
    is_cached,
    is_cached_details,
    is_file,
    is_namespace,
    is_on_tape,
    is_on_tape_details,
    is_tape_available,
    json2hsm,
    json_dict2hsm,
    json_file2hsm,
    json_str2hsm,
    makedirs,
    mkdir,
    move,
    rename,
    resource_exists,
    set_tag,
    tape_exists,
    tape_status,
)
from .jobs import (
    SubmittedJobs,
    get_bad_files_verify_job,
    get_checked_resources_verify_job,
    get_job_status,
    get_result_verify_job,
    is_job_finished,
    is_job_processing,
    is_job_queued,
    is_job_successful,
    job_exists,
    job_queue,
    submit_verify_job,
)
from .pyslk_exceptions import (
    ArchiveError,
    HostNotReachableError,
    PySlkBadFileError,
    PySlkBadProcessError,
    PySlkEmptyInputError,
    PySlkException,
    PySlkNoValidLoginTokenError,
    SizeMismatchError,
    SlkIOError,
    check_for_errors,
)
from .pyslk_warnings import SlkWarning
from .raw import (
    archive_raw,
    checksum_raw,
    chmod_raw,
    delete_raw,
    exists_raw,
    gen_file_query_raw,
    gen_search_query_raw,
    group_files_by_tape_raw,
    group_raw,
    has_no_flag_partial_raw,
    hostname_raw,
    hsm2json_raw,
    is_on_tape_raw,
    iscached_raw,
    job_exists_raw,
    job_queue_raw,
    job_report_raw,
    job_status_raw,
    json2hsm_raw,
    list_clone_file_raw,
    list_clone_search_raw,
    list_raw,
    metadata_raw,
    mkdir_raw,
    move_raw,
    owner_raw,
    print_rcrs_raw,
    recall2_raw,
    recall_raw,
    rename_raw,
    resource_mtime_raw,
    resource_path_raw,
    resource_permissions_raw,
    resource_tape_raw,
    resource_type_raw,
    result_verify_job_raw,
    retrieve2_raw,
    retrieve_raw,
    search_immediately_raw,
    search_incomplete_raw,
    search_raw,
    search_status_raw,
    search_successful_raw,
    searchid_exists_raw,
    session_raw,
    size_raw,
    submit_verify_job_raw,
    tag_raw,
    tape_barcode_raw,
    tape_exists_raw,
    tape_id_raw,
    tape_library_raw,
    tape_status_raw,
    tnsr_raw,
    total_number_search_results_raw,
    version_slk_helpers_raw,
    version_slk_raw,
)
from .retry import log_attempt_number, try_archive
from .transfer import archive, recall_dev, recall_single, retrieve, retrieve_improved
from .utils import (
    FakeProc,
    access_local,
    construct_dst_from_src,
    convert_expiration_date,
    get_recall_job_id,
    get_slk_pid,
    is_search_id,
    login_valid,
    run_slk,
    which,
)
from .version import slk_helpers_version, slk_version

__all__ = [
    "ArchiveError",
    "FakeProc",
    "FileGroup",
    "GroupCollection",
    "HostNotReachableError",
    "MAX_RETRIES_SUBMIT_JOBS_BASIC",
    "MAX_RETRIES_SUBMIT_JOBS_SAVE_MODE",
    "MIN_VERSION_SLK",
    "MIN_VERSION_SLK_HELPERS",
    "PYSLK_DEFAULT_LIST_CLONE_COLUMNS",
    "PYSLK_DEFAULT_LIST_COLUMNS",
    "PYSLK_DEFAULT_LIST_COLUMNS_3_3_21",
    "PYSLK_DEFAULT_LIST_COLUMN_TYPES",
    "PYSLK_DEFAULT_NUMBER_RETRIES_NONMOD_CMDS",
    "PYSLK_FILE_SIZE_UNITS",
    "PYSLK_LOGGER",
    "PYSLK_SEARCH_DELAY",
    "PYSLK_WILDCARDS",
    "PySlkBadFileError",
    "PySlkBadProcessError",
    "PySlkEmptyInputError",
    "PySlkException",
    "PySlkNoValidLoginTokenError",
    "SEARCH_QUERY_OPERATORS",
    "SLK",
    "SLK_HELPERS",
    "SLK_SYSTEM_CONFIG",
    "SLK_USER_CONFIG",
    "SLK_USER_LOG",
    "SizeMismatchError",
    "SlkIOError",
    "SlkWarning",
    "StatusJob",
    "SubmittedJobs",
    "access_hsm",
    "access_local",
    "arch_size",
    "archive",
    "archive_raw",
    "check_for_errors",
    "checksum_raw",
    "chgrp",
    "chmod",
    "chmod_raw",
    "chown",
    "cli_versions",
    "construct_dst_from_src",
    "convert_expiration_date",
    "count_tapes",
    "count_tapes_with_multi_tape_files",
    "count_tapes_with_single_tape_files",
    "delete",
    "delete_raw",
    "exists_raw",
    "expiration_date",
    "gen_file_query",
    "gen_file_query_as_dict",
    "gen_file_query_raw",
    "gen_search_query",
    "gen_search_query_raw",
    "get",
    "get_bad_files_verify_job",
    "get_checked_resources_verify_job",
    "get_checksum",
    "get_job_status",
    "get_metadata",
    "get_rcrs",
    "get_recall_job_id",
    "get_resource_id",
    "get_resource_mtime",
    "get_resource_path",
    "get_resource_permissions",
    "get_resource_size",
    "get_resource_tape",
    "get_resource_type",
    "get_result_verify_job",
    "get_search_status",
    "get_slk_pid",
    "get_storage_information",
    "get_tag",
    "get_tape_barcode",
    "get_tape_id",
    "get_tape_status",
    "group_files_by_tape",
    "group_files_by_tape_raw",
    "group_raw",
    "has_no_flag_partial",
    "has_no_flag_partial_details",
    "has_no_flag_partial_raw",
    "hostname",
    "hostname_raw",
    "hsm2json",
    "hsm2json_dict",
    "hsm2json_file",
    "hsm2json_raw",
    "is_cached",
    "is_cached_details",
    "is_file",
    "is_job_finished",
    "is_job_processing",
    "is_job_queued",
    "is_job_successful",
    "is_namespace",
    "is_on_tape",
    "is_on_tape_details",
    "is_on_tape_raw",
    "is_search_id",
    "is_search_incomplete",
    "is_search_successful",
    "is_tape_available",
    "iscached_raw",
    "job_exists",
    "job_exists_raw",
    "job_queue",
    "job_queue_raw",
    "job_report_raw",
    "job_status_raw",
    "json2hsm",
    "json2hsm_raw",
    "json_dict2hsm",
    "json_file2hsm",
    "json_str2hsm",
    "list",
    "list_clone_file",
    "list_clone_file_raw",
    "list_clone_search",
    "list_clone_search_raw",
    "list_raw",
    "log_attempt_number",
    "login_valid",
    "ls",
    "makedirs",
    "metadata_raw",
    "mkdir",
    "mkdir_raw",
    "module_load",
    "move",
    "move_raw",
    "owner_raw",
    "print_rcrs_raw",
    "recall_dev",
    "recall_raw",
    "recall_single",
    "recall2_raw",
    "rename",
    "rename_raw",
    "resource_exists",
    "resource_mtime_raw",
    "resource_path_raw",
    "resource_permissions_raw",
    "resource_tape_raw",
    "resource_type_raw",
    "result_verify_job_raw",
    "retrieve",
    "retrieve_improved",
    "retrieve_raw",
    "retrieve2_raw",
    "run_slk",
    "search",
    "search_immediately",
    "search_immediately_raw",
    "search_incomplete_raw",
    "search_raw",
    "search_status_raw",
    "search_successful_raw",
    "searchid_exists",
    "searchid_exists_raw",
    "session",
    "session_raw",
    "set",
    "set_tag",
    "size_raw",
    "slk_helpers_version",
    "slk_version",
    "submit_verify_job",
    "submit_verify_job_raw",
    "tag_raw",
    "tape_barcode_raw",
    "tape_exists",
    "tape_exists_raw",
    "tape_id_raw",
    "tape_library_raw",
    "tape_status",
    "tape_status_raw",
    "tnsr_raw",
    "total_number_search_results",
    "total_number_search_results_raw",
    "try_archive",
    "valid_session",
    "valid_token",
    "version_slk",
    "version_slk_helpers",
    "version_slk_helpers_raw",
    "version_slk_raw",
    "which",
]

__version__ = importlib.metadata.version("pyslk")
ENV = config.module_load()
