# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.5.1
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.

import typing
# Import the low-level C/C++ module
if getattr(globals().get("__spec__"), "parent", None) or __package__ or "." in __name__:
    from . import _comps
else:
    import _comps

import builtins as __builtin__

def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)


def _swig_setattr_nondynamic_instance_variable(set):
    def set_instance_attr(self, name, value):
        if name == "this":
            set(self, name, value)
        elif name == "thisown":
            self.this.own(value)
        elif hasattr(self, name) and isinstance(getattr(type(self), name), property):
            set(self, name, value)
        else:
            raise AttributeError("You cannot add instance attributes to %s" % self)
    return set_instance_attr


def _swig_setattr_nondynamic_class_variable(set):
    def set_class_attr(cls, name, value):
        if hasattr(cls, name) and not isinstance(getattr(cls, name), property):
            set(cls, name, value)
        else:
            raise AttributeError("You cannot add class attributes to %s" % cls)
    return set_class_attr


class _SwigNonDynamicMeta(type):
    """Meta class to enforce nondynamic attributes (no new attributes) for a class"""
    __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__)


import weakref

class SwigPyIterator(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined - class is abstract")
    __repr__ = _swig_repr
    __swig_destroy__ = _comps.delete_SwigPyIterator

    def value(self):
        return _comps.SwigPyIterator_value(self)

    def incr(self, n=1):
        return _comps.SwigPyIterator_incr(self, n)

    def decr(self, n=1):
        return _comps.SwigPyIterator_decr(self, n)

    def distance(self, x):
        return _comps.SwigPyIterator_distance(self, x)

    def equal(self, x):
        return _comps.SwigPyIterator_equal(self, x)

    def copy(self):
        return _comps.SwigPyIterator_copy(self)

    def __next__(self):
        return _comps.SwigPyIterator___next__(self)

    def previous(self):
        return _comps.SwigPyIterator_previous(self)

    def advance(self, n):
        return _comps.SwigPyIterator_advance(self, n)

    def __eq__(self, x):
        return _comps.SwigPyIterator___eq__(self, x)

    def __ne__(self, x):
        return _comps.SwigPyIterator___ne__(self, x)

    def __iadd__(self, n):
        return _comps.SwigPyIterator___iadd__(self, n)

    def __isub__(self, n):
        return _comps.SwigPyIterator___isub__(self, n)

    def __add__(self, n):
        return _comps.SwigPyIterator___add__(self, n)

    def __sub__(self, *args):
        return _comps.SwigPyIterator___sub__(self, *args)
    def __iter__(self):
        return self

# Register SwigPyIterator in _comps:
_comps.SwigPyIterator_swigregister(SwigPyIterator)
from . import common
from . import exception
from . import repo
from . import conf
from . import logger
from . import transaction
PackageType_CONDITIONAL = _comps.PackageType_CONDITIONAL
PackageType_DEFAULT = _comps.PackageType_DEFAULT
PackageType_MANDATORY = _comps.PackageType_MANDATORY
PackageType_OPTIONAL = _comps.PackageType_OPTIONAL

def __or__(a, b):
    return _comps.__or__(a, b)

def __ior__(a, b):
    return _comps.__ior__(a, b)

def __and__(a, b):
    return _comps.__and__(a, b)

def any(flags):
    return _comps.any(flags)

def package_type_from_string(*args):
    return _comps.package_type_from_string(*args)

def package_type_to_string(type):
    return _comps.package_type_to_string(type)

def package_types_to_strings(types):
    return _comps.package_types_to_strings(types)
class Package(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    __swig_destroy__ = _comps.delete_Package

    def __init__(self, *args):
        _comps.Package_swiginit(self, _comps.new_Package(*args))

    def __eq__(self, other):
        return _comps.Package___eq__(self, other)

    def __ne__(self, other):
        return _comps.Package___ne__(self, other)

    def get_name(self):
        r"""
        :rtype: string
        :return: The Package name.
        Since: 5.0
        """
        return _comps.Package_get_name(self)

    def set_name(self, value):
        return _comps.Package_set_name(self, value)

    def get_type(self):
        r"""
        :rtype: int
        :return: The PackageType.
        Since: 5.0
        """
        return _comps.Package_get_type(self)

    def set_type(self, value):
        return _comps.Package_set_type(self, value)

    def get_type_string(self):
        r"""
        :rtype: string
        :return: std::string that corresponds to the PackageType.
        Since: 5.0
        """
        return _comps.Package_get_type_string(self)

    def get_condition(self):
        r"""
        :rtype: string
        :return: The condition (name of package) under which the package gets installed.
        Since: 5.0
        """
        return _comps.Package_get_condition(self)

    def set_condition(self, value):
        return _comps.Package_set_condition(self, value)

# Register Package in _comps:
_comps.Package_swigregister(Package)
class GroupId(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, *args):
        _comps.GroupId_swiginit(self, _comps.new_GroupId(*args))

    def __eq__(self, other):
        return _comps.GroupId___eq__(self, other)

    def __ne__(self, other):
        return _comps.GroupId___ne__(self, other)
    id = property(_comps.GroupId_id_get, _comps.GroupId_id_set)
    __swig_destroy__ = _comps.delete_GroupId

# Register GroupId in _comps:
_comps.GroupId_swigregister(GroupId)
class Group(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    __swig_destroy__ = _comps.delete_Group

    def __init__(self, *args):
        _comps.Group_swiginit(self, _comps.new_Group(*args))

    def get_base(self):
        r"""
        :rtype: libdnf5::BaseWeakPtr
        :return: The `Base` object to which this object belongs.
        Since: 5.2.6
        """
        return _comps.Group_get_base(self)

    def get_groupid(self):
        r"""
        :rtype: string
        :return: The Group id.
        Since: 5.0
        """
        return _comps.Group_get_groupid(self)

    def get_name(self):
        r"""
        :rtype: string
        :return: The Group name.
        Since: 5.0
        """
        return _comps.Group_get_name(self)

    def get_description(self):
        r"""
        :rtype: string
        :return: The Group description.
        Since: 5.0
        """
        return _comps.Group_get_description(self)

    def get_translated_name(self, *args):
        r"""
        :rtype: string
        :return: The translated name of the Group based on current locales.
                    If no translation is found, return untranslated name.
        Since: 5.0
        """
        return _comps.Group_get_translated_name(self, *args)

    def get_translated_description(self, *args):
        r"""
        :rtype: string
        :return: The translated description of the Group based on current locales.
                    If no translation is found, return untranslated ui_description.
        Since: 5.0
        """
        return _comps.Group_get_translated_description(self, *args)

    def get_order(self):
        r"""
        :rtype: string
        :return: The Group display order.
        Since: 5.0
        """
        return _comps.Group_get_order(self)

    def get_order_int(self):
        r"""
        :rtype: int
        :return: The Group display order as an integer or INT_MAX if the order is invalid.
        Since: 5.2.12.1
        """
        return _comps.Group_get_order_int(self)

    def get_langonly(self):
        r"""
        :rtype: string
        :return: The Group langonly.
        Since: 5.0
        """
        return _comps.Group_get_langonly(self)

    def get_uservisible(self):
        r"""
        :rtype: boolean
        :return: `true` if the Group is visible to the users.
        Since: 5.0
        """
        return _comps.Group_get_uservisible(self)

    def get_default(self):
        r"""
        :rtype: boolean
        :return: `true` if the Group is installed by default.
        Since: 5.0
        """
        return _comps.Group_get_default(self)

    def get_packages(self):
        r"""
        :rtype: std::vector< libdnf5::comps::Package,std::allocator< libdnf5::comps::Package > >
        :return: std::vector of Packages belonging to the Group.
        Since: 5.0
        """
        return _comps.Group_get_packages(self)

    def get_packages_of_type(self, type):
        r"""
        :rtype: std::vector< libdnf5::comps::Package,std::allocator< libdnf5::comps::Package > >
        :return: std::vector of Packages of given type belonging to the Group.
        :type type: int
        :param type: One of the PackageTypes.
        Since: 5.0
        """
        return _comps.Group_get_packages_of_type(self, type)

    def get_repos(self):
        r"""
        :rtype: std::set< std::string,std::less< std::string >,std::allocator< std::string > >
        :return: std::set of names of repositories that contain the Group.
        Since: 5.0
        """
        return _comps.Group_get_repos(self)

    def get_installed(self):
        r"""
        :rtype: boolean
        :return: `true` if the Group is installed (belongs to the @System repo).
        Since: 5.0
        """
        return _comps.Group_get_installed(self)

    def get_reason(self):
        r"""
        :rtype: int
        :return: Resolved reason why the Group was installed.
                    Groups can be installed due to multiple reasons, only the most significant is returned.
        Since: 5.0
        """
        return _comps.Group_get_reason(self)

    def __iadd__(self, rhs):
        r"""
        Merge the Group with another one.
        Since: 5.0
        """
        return _comps.Group___iadd__(self, rhs)

    def __eq__(self, rhs):
        return _comps.Group___eq__(self, rhs)

    def __ne__(self, rhs):
        return _comps.Group___ne__(self, rhs)

    def __lt__(self, rhs):
        return _comps.Group___lt__(self, rhs)

    def serialize(self, path):
        r"""
        Serialize the Group into an xml file.
        :type path: string
        :param path: Path of the output xml file.
        :raises: utils::xml::XMLSaveError When saving of the file fails.
        Since: 5.0
        """
        return _comps.Group_serialize(self, path)

# Register Group in _comps:
_comps.Group_swigregister(Group)
class VectorPackage(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def iterator(self):
        return _comps.VectorPackage_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __bool__(self):
        return _comps.VectorPackage___bool__(self)

    def __len__(self):
        return _comps.VectorPackage___len__(self)

    def __delitem__(self, *args):
        return _comps.VectorPackage___delitem__(self, *args)

    def __getitem__(self, *args):
        return _comps.VectorPackage___getitem__(self, *args)

    def __setitem__(self, *args):
        return _comps.VectorPackage___setitem__(self, *args)

    def pop(self):
        return _comps.VectorPackage_pop(self)

    def append(self, x):
        return _comps.VectorPackage_append(self, x)

    def empty(self):
        return _comps.VectorPackage_empty(self)

    def size(self):
        return _comps.VectorPackage_size(self)

    def swap(self, v):
        return _comps.VectorPackage_swap(self, v)

    def begin(self):
        return _comps.VectorPackage_begin(self)

    def end(self):
        return _comps.VectorPackage_end(self)

    def rbegin(self):
        return _comps.VectorPackage_rbegin(self)

    def rend(self):
        return _comps.VectorPackage_rend(self)

    def clear(self):
        return _comps.VectorPackage_clear(self)

    def get_allocator(self):
        return _comps.VectorPackage_get_allocator(self)

    def pop_back(self):
        return _comps.VectorPackage_pop_back(self)

    def erase(self, *args):
        return _comps.VectorPackage_erase(self, *args)

    def __init__(self, *args):
        _comps.VectorPackage_swiginit(self, _comps.new_VectorPackage(*args))

    def push_back(self, x):
        return _comps.VectorPackage_push_back(self, x)

    def front(self):
        return _comps.VectorPackage_front(self)

    def back(self):
        return _comps.VectorPackage_back(self)

    def assign(self, n, x):
        return _comps.VectorPackage_assign(self, n, x)

    def insert(self, *args):
        return _comps.VectorPackage_insert(self, *args)

    def reserve(self, n):
        return _comps.VectorPackage_reserve(self, n)

    def capacity(self):
        return _comps.VectorPackage_capacity(self)
    __swig_destroy__ = _comps.delete_VectorPackage

# Register VectorPackage in _comps:
_comps.VectorPackage_swigregister(VectorPackage)
class SetConstIteratorGroup(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def value(self):
        return _comps.SetConstIteratorGroup_value(self)

    def next(self):
        return _comps.SetConstIteratorGroup_next(self)

    def prev(self):
        return _comps.SetConstIteratorGroup_prev(self)

    def __eq__(self, other):
        return _comps.SetConstIteratorGroup___eq__(self, other)

    def __ne__(self, other):
        return _comps.SetConstIteratorGroup___ne__(self, other)
    __swig_destroy__ = _comps.delete_SetConstIteratorGroup

# Register SetConstIteratorGroup in _comps:
_comps.SetConstIteratorGroup_swigregister(SetConstIteratorGroup)
class SetGroup(object):
    r"""
    Set represents set of objects (e.g. repositories, or groups)
    and implements set operations such as unions or differences.
    """

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr
    __swig_destroy__ = _comps.delete_SetGroup

    def empty(self):
        return _comps.SetGroup_empty(self)

    def size(self):
        return _comps.SetGroup_size(self)

    def clear(self):
        return _comps.SetGroup_clear(self)

    def add(self, *args):
        return _comps.SetGroup_add(self, *args)

    def remove(self, obj):
        return _comps.SetGroup_remove(self, obj)

    def find(self, obj):
        return _comps.SetGroup_find(self, obj)

    def contains(self, obj):
        return _comps.SetGroup_contains(self, obj)

    def __ior__(self, other):
        return _comps.SetGroup___ior__(self, other)

    def __iand__(self, other):
        return _comps.SetGroup___iand__(self, other)

    def __isub__(self, other):
        return _comps.SetGroup___isub__(self, other)

    def __ixor__(self, other):
        return _comps.SetGroup___ixor__(self, other)

    def update(self, other):
        return _comps.SetGroup_update(self, other)

    def intersection(self, other):
        return _comps.SetGroup_intersection(self, other)

    def difference(self, other):
        return _comps.SetGroup_difference(self, other)

    def symmetric_difference(self, other):
        return _comps.SetGroup_symmetric_difference(self, other)

    def is_subset(self, other):
        return _comps.SetGroup_is_subset(self, other)

    def is_superset(self, other):
        return _comps.SetGroup_is_superset(self, other)

    def swap(self, other):
        return _comps.SetGroup_swap(self, other)

    def get_data(self, *args):
        r"""Return reference to underlying std::set"""
        return _comps.SetGroup_get_data(self, *args)

    def begin(self):
        return _comps.SetGroup_begin(self)

    def end(self):
        return _comps.SetGroup_end(self)

    def __len__(self):
        return _comps.SetGroup___len__(self)

# Register SetGroup in _comps:
_comps.SetGroup_swigregister(SetGroup)
class SackQueryGroup(SetGroup):
    r"""Query is a Set with filtering capabilities."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, *args):
        _comps.SackQueryGroup_swiginit(self, _comps.new_SackQueryGroup(*args))

    def filter(self, *args):
        return _comps.SackQueryGroup_filter(self, *args)

    def get(self):
        r"""Get a single object. Raise an exception if none or multiple objects match the query."""
        return _comps.SackQueryGroup_get(self)

    def list(self):
        r"""List all objects matching the query."""
        return _comps.SackQueryGroup_list(self)

    def get_data(self, *args):
        r"""Return reference to underlying std::set"""
        return _comps.SackQueryGroup_get_data(self, *args)
    __swig_destroy__ = _comps.delete_SackQueryGroup

# Register SackQueryGroup in _comps:
_comps.SackQueryGroup_swigregister(SackQueryGroup)
class GroupQuery(SackQueryGroup):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    __swig_destroy__ = _comps.delete_GroupQuery

    def __init__(self, *args):
        _comps.GroupQuery_swiginit(self, _comps.new_GroupQuery(*args))

    def get_base(self):
        r"""
        :rtype: libdnf5::BaseWeakPtr
        :return: The `Base` object to which this object belongs.
        Since: 5.2.6
        """
        return _comps.GroupQuery_get_base(self)

    def filter_groupid(self, *args):
        return _comps.GroupQuery_filter_groupid(self, *args)

    def filter_package_name(self, *args):
        r"""
        Filter groups by packages they contain. Keep only groups that contain packages with given names.

        :type patterns: std::vector< std::string,std::allocator< std::string > >
        :param patterns:         A vector of strings (package names) the filter is matched against.
        :param cmp_type:         A comparison (match) operator, defaults to `QueryCmp::EQ`.
        Since: 5.12
        """
        return _comps.GroupQuery_filter_package_name(self, *args)

    def filter_name(self, *args):
        return _comps.GroupQuery_filter_name(self, *args)

    def filter_uservisible(self, value):
        return _comps.GroupQuery_filter_uservisible(self, value)

    def filter_default(self, value):
        return _comps.GroupQuery_filter_default(self, value)

    def filter_installed(self, value):
        return _comps.GroupQuery_filter_installed(self, value)

# Register GroupQuery in _comps:
_comps.GroupQuery_swigregister(GroupQuery)

def SetGroup__iter__(self):
    return common.Iterator(self, self.begin(), self.end())
SetGroup.__iter__ = SetGroup__iter__
del SetGroup__iter__

class EnvironmentId(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, *args):
        _comps.EnvironmentId_swiginit(self, _comps.new_EnvironmentId(*args))

    def __eq__(self, other):
        return _comps.EnvironmentId___eq__(self, other)

    def __ne__(self, other):
        return _comps.EnvironmentId___ne__(self, other)
    id = property(_comps.EnvironmentId_id_get, _comps.EnvironmentId_id_set)
    __swig_destroy__ = _comps.delete_EnvironmentId

# Register EnvironmentId in _comps:
_comps.EnvironmentId_swigregister(EnvironmentId)
class Environment(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    __swig_destroy__ = _comps.delete_Environment

    def __init__(self, *args):
        _comps.Environment_swiginit(self, _comps.new_Environment(*args))

    def get_base(self):
        r"""
        :rtype: libdnf5::BaseWeakPtr
        :return: The `Base` object to which this object belongs.
        Since: 5.2.6
        """
        return _comps.Environment_get_base(self)

    def get_environmentid(self):
        r"""
        :rtype: string
        :return: The Environment id.
        Since: 5.0
        """
        return _comps.Environment_get_environmentid(self)

    def get_name(self):
        r"""
        :rtype: string
        :return: The Environment name.
        Since: 5.0
        """
        return _comps.Environment_get_name(self)

    def get_description(self):
        r"""
        :rtype: string
        :return: The Environment description.
        Since: 5.0
        """
        return _comps.Environment_get_description(self)

    def get_translated_name(self, *args):
        r"""
        :rtype: string
        :return: The translated name of the Environment based on current locales.
                    If no translation is found, return untranslated name.
        Since: 5.0
        """
        return _comps.Environment_get_translated_name(self, *args)

    def get_translated_description(self, *args):
        r"""
        :rtype: string
        :return: The translated description of the Environment based on current locales.
                    If no translation is found, return untranslated description.
        Since: 5.0
        """
        return _comps.Environment_get_translated_description(self, *args)

    def get_order(self):
        r"""
        :rtype: string
        :return: The Environment display order.
        Since: 5.0
        """
        return _comps.Environment_get_order(self)

    def get_order_int(self):
        r"""
        :rtype: int
        :return: The Environment display order as an integer or INT_MAX if the order is invalid.
        Since: 5.2.12.1
        """
        return _comps.Environment_get_order_int(self)

    def get_groups(self):
        r"""
        :rtype: std::vector< std::string,std::allocator< std::string > >
        :return: std::vector of Group ids belonging to the Environment.
        Since: 5.0
        """
        return _comps.Environment_get_groups(self)

    def get_default_groups(self):
        r"""
        :rtype: std::vector< std::string,std::allocator< std::string > >
        :return: std::vector of default Group ids belonging to the Environment.
        Since: 5.4.1.0
        """
        return _comps.Environment_get_default_groups(self)

    def get_optional_groups(self):
        r"""
        :rtype: std::vector< std::string,std::allocator< std::string > >
        :return: std::vector of optional Group ids belonging to the Environment.
        Since: 5.0
        """
        return _comps.Environment_get_optional_groups(self)

    def get_repos(self):
        r"""
        :rtype: std::set< std::string,std::less< std::string >,std::allocator< std::string > >
        :return: std::set of names of repositories that contain the Environment.
        Since: 5.0
        """
        return _comps.Environment_get_repos(self)

    def get_installed(self):
        r"""
        :rtype: boolean
        :return: `true` if the Environment is installed (belongs to the @System repo).
        Since: 5.0
        """
        return _comps.Environment_get_installed(self)

    def get_reason(self):
        r"""
        :rtype: int
        :return: Resolved reason why the Environment was installed.
                    Environments can be installed due to multiple reasons, only the most significant is returned.
        Since: 5.0
        """
        return _comps.Environment_get_reason(self)

    def __iadd__(self, rhs):
        r"""
        Merge the Environment with another one.
        Since: 5.0
        """
        return _comps.Environment___iadd__(self, rhs)

    def __eq__(self, rhs):
        return _comps.Environment___eq__(self, rhs)

    def __ne__(self, rhs):
        return _comps.Environment___ne__(self, rhs)

    def __lt__(self, rhs):
        return _comps.Environment___lt__(self, rhs)

    def serialize(self, path):
        r"""
        Serialize the Environment into an xml file
        :type path: string
        :param path: Path of the output xml file.
        :raises: utils::xml::XMLSaveError When saving of the file fails.
        Since: 5.0
        """
        return _comps.Environment_serialize(self, path)

# Register Environment in _comps:
_comps.Environment_swigregister(Environment)
class SetConstIteratorEnvironment(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr

    def value(self):
        return _comps.SetConstIteratorEnvironment_value(self)

    def next(self):
        return _comps.SetConstIteratorEnvironment_next(self)

    def prev(self):
        return _comps.SetConstIteratorEnvironment_prev(self)

    def __eq__(self, other):
        return _comps.SetConstIteratorEnvironment___eq__(self, other)

    def __ne__(self, other):
        return _comps.SetConstIteratorEnvironment___ne__(self, other)
    __swig_destroy__ = _comps.delete_SetConstIteratorEnvironment

# Register SetConstIteratorEnvironment in _comps:
_comps.SetConstIteratorEnvironment_swigregister(SetConstIteratorEnvironment)
class SetEnvironment(object):
    r"""
    Set represents set of objects (e.g. repositories, or groups)
    and implements set operations such as unions or differences.
    """

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")

    def __init__(self, *args, **kwargs):
        raise AttributeError("No constructor defined")
    __repr__ = _swig_repr
    __swig_destroy__ = _comps.delete_SetEnvironment

    def empty(self):
        return _comps.SetEnvironment_empty(self)

    def size(self):
        return _comps.SetEnvironment_size(self)

    def clear(self):
        return _comps.SetEnvironment_clear(self)

    def add(self, *args):
        return _comps.SetEnvironment_add(self, *args)

    def remove(self, obj):
        return _comps.SetEnvironment_remove(self, obj)

    def find(self, obj):
        return _comps.SetEnvironment_find(self, obj)

    def contains(self, obj):
        return _comps.SetEnvironment_contains(self, obj)

    def __ior__(self, other):
        return _comps.SetEnvironment___ior__(self, other)

    def __iand__(self, other):
        return _comps.SetEnvironment___iand__(self, other)

    def __isub__(self, other):
        return _comps.SetEnvironment___isub__(self, other)

    def __ixor__(self, other):
        return _comps.SetEnvironment___ixor__(self, other)

    def update(self, other):
        return _comps.SetEnvironment_update(self, other)

    def intersection(self, other):
        return _comps.SetEnvironment_intersection(self, other)

    def difference(self, other):
        return _comps.SetEnvironment_difference(self, other)

    def symmetric_difference(self, other):
        return _comps.SetEnvironment_symmetric_difference(self, other)

    def is_subset(self, other):
        return _comps.SetEnvironment_is_subset(self, other)

    def is_superset(self, other):
        return _comps.SetEnvironment_is_superset(self, other)

    def swap(self, other):
        return _comps.SetEnvironment_swap(self, other)

    def get_data(self, *args):
        r"""Return reference to underlying std::set"""
        return _comps.SetEnvironment_get_data(self, *args)

    def begin(self):
        return _comps.SetEnvironment_begin(self)

    def end(self):
        return _comps.SetEnvironment_end(self)

    def __len__(self):
        return _comps.SetEnvironment___len__(self)

# Register SetEnvironment in _comps:
_comps.SetEnvironment_swigregister(SetEnvironment)

def __eq__(*args):
    return _comps.__eq__(*args)

class SackQueryEnvironment(SetEnvironment):
    r"""Query is a Set with filtering capabilities."""

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, *args):
        _comps.SackQueryEnvironment_swiginit(self, _comps.new_SackQueryEnvironment(*args))

    def filter(self, *args):
        return _comps.SackQueryEnvironment_filter(self, *args)

    def get(self):
        r"""Get a single object. Raise an exception if none or multiple objects match the query."""
        return _comps.SackQueryEnvironment_get(self)

    def list(self):
        r"""List all objects matching the query."""
        return _comps.SackQueryEnvironment_list(self)

    def get_data(self, *args):
        r"""Return reference to underlying std::set"""
        return _comps.SackQueryEnvironment_get_data(self, *args)
    __swig_destroy__ = _comps.delete_SackQueryEnvironment

# Register SackQueryEnvironment in _comps:
_comps.SackQueryEnvironment_swigregister(SackQueryEnvironment)
class EnvironmentQuery(SackQueryEnvironment):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    __swig_destroy__ = _comps.delete_EnvironmentQuery

    def __init__(self, *args):
        _comps.EnvironmentQuery_swiginit(self, _comps.new_EnvironmentQuery(*args))

    def get_base(self):
        r"""
        :rtype: libdnf5::BaseWeakPtr
        :return: The `Base` object to which this object belongs.
        Since: 5.2.6
        """
        return _comps.EnvironmentQuery_get_base(self)

    def filter_environmentid(self, *args):
        return _comps.EnvironmentQuery_filter_environmentid(self, *args)

    def filter_name(self, *args):
        return _comps.EnvironmentQuery_filter_name(self, *args)

    def filter_installed(self, value):
        return _comps.EnvironmentQuery_filter_installed(self, value)

# Register EnvironmentQuery in _comps:
_comps.EnvironmentQuery_swigregister(EnvironmentQuery)

def SetEnvironment__iter__(self):
    return common.Iterator(self, self.begin(), self.end())
SetEnvironment.__iter__ = SetEnvironment__iter__
del SetEnvironment__iter__

class CompsSack(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, *args):
        _comps.CompsSack_swiginit(self, _comps.new_CompsSack(*args))
    __swig_destroy__ = _comps.delete_CompsSack

    def get_weak_ptr(self):
        r"""
        Create WeakPtr to CompsSack
        Since: 5.2.12.1
        """
        return _comps.CompsSack_get_weak_ptr(self)

    def get_base(self):
        r"""
        :rtype: libdnf5::BaseWeakPtr
        :return: The `Base` object to which this object belongs.
        Since: 5.2.12.1
        """
        return _comps.CompsSack_get_base(self)

    def load_config_excludes(self):
        r"""
        Loads excluded comps from the configuration.
        Uses the `disable_excludes`, `excludegroups` and `excludeenvironments` configuration options for calculation.
        Since: 5.2.12.1
        """
        return _comps.CompsSack_load_config_excludes(self)

    def get_config_environment_excludes(self):
        r"""
        Returns config excluded environments
        Since: 5.2.12.1
        """
        return _comps.CompsSack_get_config_environment_excludes(self)

    def get_config_group_excludes(self):
        r"""
        Returns config excluded groups
        Since: 5.2.12.1
        """
        return _comps.CompsSack_get_config_group_excludes(self)

    def get_user_environment_excludes(self):
        r"""
        Returns user excluded environments
        Since: 5.2.12.1
        """
        return _comps.CompsSack_get_user_environment_excludes(self)

    def add_user_environment_excludes(self, excludes):
        r"""
        Add environments to user excluded environments
        :type excludes: :py:class:`EnvironmentQuery`
        :param excludes:: environments to add to excludes
        Since: 5.2.12.1
        """
        return _comps.CompsSack_add_user_environment_excludes(self, excludes)

    def remove_user_environment_excludes(self, excludes):
        r"""
        Remove environments from user excluded environments
        :type excludes: :py:class:`EnvironmentQuery`
        :param excludes:: environments to remove from excludes
        Since: 5.2.12.1
        """
        return _comps.CompsSack_remove_user_environment_excludes(self, excludes)

    def set_user_environment_excludes(self, excludes):
        r"""
        Resets user excluded environments to a new value
        :type excludes: :py:class:`EnvironmentQuery`
        :param excludes:: environments to exclude
        Since: 5.2.12.1
        """
        return _comps.CompsSack_set_user_environment_excludes(self, excludes)

    def clear_user_environment_excludes(self):
        r"""
        Clear user excluded environments
        Since: 5.2.12.1
        """
        return _comps.CompsSack_clear_user_environment_excludes(self)

    def get_user_group_excludes(self):
        r"""
        Returns user excluded groups
        Since: 5.2.12.1
        """
        return _comps.CompsSack_get_user_group_excludes(self)

    def add_user_group_excludes(self, excludes):
        r"""
        Add groups to user excluded groups
        :type excludes: :py:class:`GroupQuery`
        :param excludes:: groups to add to excludes
        Since: 5.2.12.1
        """
        return _comps.CompsSack_add_user_group_excludes(self, excludes)

    def remove_user_group_excludes(self, excludes):
        r"""
        Remove groups from user excluded groups
        :type excludes: :py:class:`GroupQuery`
        :param excludes:: groups to remove from excludes
        Since: 5.2.12.1
        """
        return _comps.CompsSack_remove_user_group_excludes(self, excludes)

    def set_user_group_excludes(self, excludes):
        r"""
        Resets user excluded groups to a new value
        :type excludes: :py:class:`GroupQuery`
        :param excludes:: groups to exclude
        Since: 5.2.12.1
        """
        return _comps.CompsSack_set_user_group_excludes(self, excludes)

    def clear_user_group_excludes(self):
        r"""
        Clear user excluded groups
        Since: 5.2.12.1
        """
        return _comps.CompsSack_clear_user_group_excludes(self)

# Register CompsSack in _comps:
_comps.CompsSack_swigregister(CompsSack)
class CompsSackWeakPtr(object):
    r"""
    WeakPtr is a "smart" pointer. It contains a pointer to resource and to guard of resource.
    WeakPtr pointer can be owner of the resource. However, the resource itself may depend on another resource.
    WeakPtr registers/unregisters itself at the guard of resource. And the resource guard invalidates
    the registered WeakPtrs when the resource is unusable (eg. its dependecny was released).
    Note on thread safety:
    It is safe to create, access and destroy WeakPtrs in multiple threads simultaneously.
    """

    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr

    def __init__(self, *args):
        _comps.CompsSackWeakPtr_swiginit(self, _comps.new_CompsSackWeakPtr(*args))
    __swig_destroy__ = _comps.delete_CompsSackWeakPtr

    def __deref__(self):
        r"""Provides access to the managed object. Generates exception if object is not valid."""
        return _comps.CompsSackWeakPtr___deref__(self)

    def get(self):
        r"""Returns a pointer to the managed object. Generates exception if object is not valid."""
        return _comps.CompsSackWeakPtr_get(self)

    def is_valid(self):
        r"""Checks if managed object is valid."""
        return _comps.CompsSackWeakPtr_is_valid(self)

    def has_same_guard(self, other):
        r"""Checks if the other WeakPtr instance has the same WeakPtrGuard."""
        return _comps.CompsSackWeakPtr_has_same_guard(self, other)

    def __ref__(self):
        return _comps.CompsSackWeakPtr___ref__(self)

    def __eq__(self, other):
        return _comps.CompsSackWeakPtr___eq__(self, other)

    def __ne__(self, other):
        return _comps.CompsSackWeakPtr___ne__(self, other)

    def __lt__(self, other):
        return _comps.CompsSackWeakPtr___lt__(self, other)

    def __gt__(self, other):
        return _comps.CompsSackWeakPtr___gt__(self, other)

    def __le__(self, other):
        return _comps.CompsSackWeakPtr___le__(self, other)

    def __ge__(self, other):
        return _comps.CompsSackWeakPtr___ge__(self, other)

    def __hash__(self):
        return _comps.CompsSackWeakPtr___hash__(self)

    def get_weak_ptr(self):
        r"""
        Create WeakPtr to CompsSack
        Since: 5.2.12.1
        """
        return _comps.CompsSackWeakPtr_get_weak_ptr(self)

    def get_base(self):
        r"""
        :rtype: libdnf5::BaseWeakPtr
        :return: The `Base` object to which this object belongs.
        Since: 5.2.12.1
        """
        return _comps.CompsSackWeakPtr_get_base(self)

    def load_config_excludes(self):
        r"""
        Loads excluded comps from the configuration.
        Uses the `disable_excludes`, `excludegroups` and `excludeenvironments` configuration options for calculation.
        Since: 5.2.12.1
        """
        return _comps.CompsSackWeakPtr_load_config_excludes(self)

    def get_config_environment_excludes(self):
        r"""
        Returns config excluded environments
        Since: 5.2.12.1
        """
        return _comps.CompsSackWeakPtr_get_config_environment_excludes(self)

    def get_config_group_excludes(self):
        r"""
        Returns config excluded groups
        Since: 5.2.12.1
        """
        return _comps.CompsSackWeakPtr_get_config_group_excludes(self)

    def get_user_environment_excludes(self):
        r"""
        Returns user excluded environments
        Since: 5.2.12.1
        """
        return _comps.CompsSackWeakPtr_get_user_environment_excludes(self)

    def add_user_environment_excludes(self, excludes):
        r"""
        Add environments to user excluded environments
        :type excludes: :py:class:`EnvironmentQuery`
        :param excludes:: environments to add to excludes
        Since: 5.2.12.1
        """
        return _comps.CompsSackWeakPtr_add_user_environment_excludes(self, excludes)

    def remove_user_environment_excludes(self, excludes):
        r"""
        Remove environments from user excluded environments
        :type excludes: :py:class:`EnvironmentQuery`
        :param excludes:: environments to remove from excludes
        Since: 5.2.12.1
        """
        return _comps.CompsSackWeakPtr_remove_user_environment_excludes(self, excludes)

    def set_user_environment_excludes(self, excludes):
        r"""
        Resets user excluded environments to a new value
        :type excludes: :py:class:`EnvironmentQuery`
        :param excludes:: environments to exclude
        Since: 5.2.12.1
        """
        return _comps.CompsSackWeakPtr_set_user_environment_excludes(self, excludes)

    def clear_user_environment_excludes(self):
        r"""
        Clear user excluded environments
        Since: 5.2.12.1
        """
        return _comps.CompsSackWeakPtr_clear_user_environment_excludes(self)

    def get_user_group_excludes(self):
        r"""
        Returns user excluded groups
        Since: 5.2.12.1
        """
        return _comps.CompsSackWeakPtr_get_user_group_excludes(self)

    def add_user_group_excludes(self, excludes):
        r"""
        Add groups to user excluded groups
        :type excludes: :py:class:`GroupQuery`
        :param excludes:: groups to add to excludes
        Since: 5.2.12.1
        """
        return _comps.CompsSackWeakPtr_add_user_group_excludes(self, excludes)

    def remove_user_group_excludes(self, excludes):
        r"""
        Remove groups from user excluded groups
        :type excludes: :py:class:`GroupQuery`
        :param excludes:: groups to remove from excludes
        Since: 5.2.12.1
        """
        return _comps.CompsSackWeakPtr_remove_user_group_excludes(self, excludes)

    def set_user_group_excludes(self, excludes):
        r"""
        Resets user excluded groups to a new value
        :type excludes: :py:class:`GroupQuery`
        :param excludes:: groups to exclude
        Since: 5.2.12.1
        """
        return _comps.CompsSackWeakPtr_set_user_group_excludes(self, excludes)

    def clear_user_group_excludes(self):
        r"""
        Clear user excluded groups
        Since: 5.2.12.1
        """
        return _comps.CompsSackWeakPtr_clear_user_group_excludes(self)

# Register CompsSackWeakPtr in _comps:
_comps.CompsSackWeakPtr_swigregister(CompsSackWeakPtr)

