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

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

try:
    import builtins as __builtin__
except ImportError:
    import __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


def _swig_add_metaclass(metaclass):
    """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass"""
    def wrapper(cls):
        return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy())
    return wrapper


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



def add_property_accessors(target_cls, src_cls=None, src_getter=None):
    """
    Dynamically creates attributes in the target class based on the getter and setter
    methods of a source class.

    This method inspects the source class for methods with 'get_' and 'set_' prefixes,
    and creates corresponding properties in the target class. If a `src_getter` is provided,
    it is used to obtain an instance of the source class, allowing for delegation of property
    access.

    Args:
        target_cls (type): The class where the properties will be added.
        src_cls (type, optional): The class to inspect for getter and setter methods.
                                  If not provided, the target class is used.
        src_getter (callable, optional): A callable that takes an instance of the target class
                                          and returns an instance of the source class.
                                          This is used for delegating property access.

    Example:
        1. Simplifying Access in the Package Class
        - Before: package.get_size()
        - After calling add_property_accessors(Package): package.size

        2. Delegating Access of Internal Objects
        - Before: package.get_nevra().get_name()
        - After calling add_property_accessors(Package, Nevra, Package.get_nevra): package.name
    """
    def create_getter(getter_name):
        def getter(self):
            getter_target = src_getter(self) if src_getter else self
            return getattr(getter_target, getter_name)() if getter_name in dir(getter_target) else None
        return getter

    def create_setter(setter_name):
        def setter(self, value):
            setter_target = src_getter(self) if src_getter else self
            return getattr(setter_target, setter_name)(value) if setter_name in dir(setter_target) else None
        return setter

    if not src_cls:
        src_cls = target_cls

    getter_prefix = 'get_'
    setter_prefix = 'set_'
    attrs = {method[len(getter_prefix):] for method in dir(src_cls) if method.startswith(getter_prefix) or method.startswith(setter_prefix)}
    for attr in attrs:
        getter_name = getter_prefix + attr
        setter_name = setter_prefix + attr
        setattr(target_cls, attr, property(
            create_getter(getter_name),
            create_setter(setter_name)
        ))


class Iterator:
    def __init__(self, container, begin, end):
        self.container = container
        self.current = begin
        self.end = end

    def __iter__(self):
        return self

    def __next__(self):
        if self.current != self.end:
            value = self.current.value()
            self.current.next()
            return value
        else:
            raise StopIteration

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__ = _common.delete_SwigPyIterator

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

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

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

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

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

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

    def next(self):
        return _common.SwigPyIterator_next(self)

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

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

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

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

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

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

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

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

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

# Register SwigPyIterator in _common:
_common.SwigPyIterator_swigregister(SwigPyIterator)
class VectorString(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 _common.VectorString_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __nonzero__(self):
        return _common.VectorString___nonzero__(self)

    def __bool__(self):
        return _common.VectorString___bool__(self)

    def __len__(self):
        return _common.VectorString___len__(self)

    def __getslice__(self, i, j):
        return _common.VectorString___getslice__(self, i, j)

    def __setslice__(self, *args):
        return _common.VectorString___setslice__(self, *args)

    def __delslice__(self, i, j):
        return _common.VectorString___delslice__(self, i, j)

    def __delitem__(self, *args):
        return _common.VectorString___delitem__(self, *args)

    def __getitem__(self, *args):
        return _common.VectorString___getitem__(self, *args)

    def __setitem__(self, *args):
        return _common.VectorString___setitem__(self, *args)

    def pop(self):
        return _common.VectorString_pop(self)

    def append(self, x):
        return _common.VectorString_append(self, x)

    def empty(self):
        return _common.VectorString_empty(self)

    def size(self):
        return _common.VectorString_size(self)

    def swap(self, v):
        return _common.VectorString_swap(self, v)

    def begin(self):
        return _common.VectorString_begin(self)

    def end(self):
        return _common.VectorString_end(self)

    def rbegin(self):
        return _common.VectorString_rbegin(self)

    def rend(self):
        return _common.VectorString_rend(self)

    def clear(self):
        return _common.VectorString_clear(self)

    def get_allocator(self):
        return _common.VectorString_get_allocator(self)

    def pop_back(self):
        return _common.VectorString_pop_back(self)

    def erase(self, *args):
        return _common.VectorString_erase(self, *args)

    def __init__(self, *args):
        _common.VectorString_swiginit(self, _common.new_VectorString(*args))

    def push_back(self, x):
        return _common.VectorString_push_back(self, x)

    def front(self):
        return _common.VectorString_front(self)

    def back(self):
        return _common.VectorString_back(self)

    def assign(self, n, x):
        return _common.VectorString_assign(self, n, x)

    def resize(self, *args):
        return _common.VectorString_resize(self, *args)

    def insert(self, *args):
        return _common.VectorString_insert(self, *args)

    def reserve(self, n):
        return _common.VectorString_reserve(self, n)

    def capacity(self):
        return _common.VectorString_capacity(self)
    __swig_destroy__ = _common.delete_VectorString

# Register VectorString in _common:
_common.VectorString_swigregister(VectorString)


def VectorString__str__(self):
    return str(list(self))
VectorString.__str__ = VectorString__str__

def VectorString__eq__(self, other):
    return list(self) == list(other)
VectorString.__eq__ = VectorString__eq__

def VectorString__ne__(self, other):
    return list(self) != list(other)
VectorString.__ne__ = VectorString__ne__

def VectorString__lt__(self, other):
    return list(self) < list(other)
VectorString.__lt__ = VectorString__lt__

def VectorString__le__(self, other):
    return list(self) <= list(other)
VectorString.__le__ = VectorString__le__

def VectorString__gt__(self, other):
    return list(self) > list(other)
VectorString.__gt__ = VectorString__gt__

def VectorString__ge__(self, other):
    return list(self) >= list(other)
VectorString.__ge__ = VectorString__ge__

def VectorString__iadd__(self, value):
    self.extend(value)
    return self
VectorString.__iadd__ = VectorString__iadd__

def VectorString__imul__(self, value):
    data = list(self)
    data *= value
    self.clear()
    self.extend(data)
    return self
VectorString.__imul__ = VectorString__imul__

def VectorString__mul__(self, value):
    result = self.copy()
    result *= value
    return result
VectorString.__mul__ = VectorString__mul__

def VectorString__rmul__(self, value):
    return self * value
VectorString.__rmul__ = VectorString__rmul__

def VectorString__add__(self, value):
    result = self.copy()
    result.extend(value)
    return result
VectorString.__add__ = VectorString__add__

def VectorString__append(self, item):
    self.push_back(item)
VectorString.append = VectorString__append

def VectorString__copy(self):
    return VectorString(list(self))
VectorString.copy = VectorString__copy

def VectorString__count(self, item):
    return list(self).count(item)
VectorString.count = VectorString__count

def VectorString__extend(self, iterable):
    for i in iterable:
        self.push_back(i)
VectorString.extend = VectorString__extend

def VectorString__index(self, *args, **kwargs):
    data = list(self)
    return data.index(*args, **kwargs)
VectorString.index = VectorString__index

def VectorString__insert(self, *args, **kwargs):
    data = list(self)
    data.insert(*args, **kwargs)
    self.clear()
    self.extend(data)
VectorString.insert = VectorString__insert

def VectorString__remove(self, *args, **kwargs):
    data = list(self)
    data.remove(*args, **kwargs)
    self.clear()
    self.extend(data)
VectorString.remove = VectorString__remove

def VectorString__sort(self, *args, **kwargs):
    data = list(self)
    data.sort()
    self.clear()
    self.extend(data)
VectorString.sort = VectorString__sort

def VectorString__reverse(self, *args, **kwargs):
    data = list(self)
    data.reverse()
    self.clear()
    self.extend(data)
VectorString.reverse = VectorString__reverse

class Version(object):
    r"""Structure representing a version, supporting up to three components."""

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

    def __init__(self, *args):
        _common.Version_swiginit(self, _common.new_Version(*args))

    def get_major(self):
        r"""
        Retrieves the major version component.

        :rtype: int
        :return: The major version number.
        """
        return _common.Version_get_major(self)

    def get_minor(self):
        r"""
        Retrieves the minor version component.

        :rtype: int
        :return: The minor version number.
        """
        return _common.Version_get_minor(self)

    def get_patch(self):
        r"""
        Retrieves the patch version component.

        :rtype: int
        :return: The patch version number.
        """
        return _common.Version_get_patch(self)

    def set_major(self, major):
        r"""
        Sets the major version component.

        :type major: int
        :param major: The value of the major version component.
        """
        return _common.Version_set_major(self, major)

    def set_minor(self, minor):
        r"""
        Sets the minor version component.

        :type minor: int
        :param minor: The value for the minor version component.
        """
        return _common.Version_set_minor(self, minor)

    def set_patch(self, patch):
        r"""
        Sets the patch version component.

        :type patch: int
        :param patch: The value for the patch version component.
        """
        return _common.Version_set_patch(self, patch)

# Register Version in _common:
_common.Version_swigregister(Version)
class Repository(object):
    r"""Represents a single repository within the manifest."""

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

    def __init__(self, *args):
        _common.Repository_swiginit(self, _common.new_Repository(*args))

    def get_id(self):
        r"""
        Retrieves the repository ID.

        :rtype: string
        :return: The repository ID.
        """
        return _common.Repository_get_id(self)

    def get_baseurl(self):
        r"""
        Retrieves the base URL of the repository.

        :rtype: string
        :return: The base URL.
        """
        return _common.Repository_get_baseurl(self)

    def get_metalink(self):
        r"""
        Retrieves the metalink URL of the repository.

        :rtype: string
        :return: The metalink URL.
        """
        return _common.Repository_get_metalink(self)

    def get_mirrorlist(self):
        r"""
        Retrieves the mirrorlist URL of the repository.

        :rtype: string
        :return: The mirrorlist URL.
        """
        return _common.Repository_get_mirrorlist(self)

    def set_id(self, id):
        r"""
        Sets the repository ID.

        :type id: string
        :param id: The repository ID to set.
        """
        return _common.Repository_set_id(self, id)

    def set_baseurl(self, baseurl):
        r"""
        Sets the base URL of the repository.

        :type baseurl: string
        :param baseurl: The base URL to set.
        """
        return _common.Repository_set_baseurl(self, baseurl)

    def set_metalink(self, metalink):
        r"""
        Sets the metalink URL of the repository.

        :type metalink: string
        :param metalink: The metalink URL to set.
        """
        return _common.Repository_set_metalink(self, metalink)

    def set_mirrorlist(self, mirrorlist):
        r"""
        Sets the mirrorlist URL of the repository.

        :type mirrorlist: string
        :param mirrorlist: The mirrorlist URL to set.
        """
        return _common.Repository_set_mirrorlist(self, mirrorlist)

# Register Repository in _common:
_common.Repository_swigregister(Repository)
class NoSuchRepositoryIdError(object):
    r"""Exception thrown when a repository with a given ID does not exist."""

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

    def __init__(self, message):
        _common.NoSuchRepositoryIdError_swiginit(self, _common.new_NoSuchRepositoryIdError(message))
    __swig_destroy__ = _common.delete_NoSuchRepositoryIdError

# Register NoSuchRepositoryIdError in _common:
_common.NoSuchRepositoryIdError_swigregister(NoSuchRepositoryIdError)
class Repositories(object):
    r"""A container for all repositories listed in the manifest."""

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

    def __init__(self, *args):
        _common.Repositories_swiginit(self, _common.new_Repositories(*args))

    def contains(self, id):
        r"""
        Checks if a given repository exists.

        :type id: string
        :param id: The repository ID.
        :rtype: boolean
        :return: True if the given repository exists; otherwise, false.
        """
        return _common.Repositories_contains(self, id)

    def size(self):
        r"""
        Gets the number of repositories in the container.

        :rtype: std::size_t
        :return: The size of the repositories container.
        """
        return _common.Repositories_size(self)

    def get(self, id):
        r"""
        Retrieves a repository by its ID.

        :type id: string
        :param id: The repository ID.
        :rtype: :py:class:`Repository`
        :return: A repository with the given ID.
        """
        return _common.Repositories_get(self, id)

    def add(self, repository):
        r"""
        Adds a repository to the container.

        :type repository: :py:class:`Repository`
        :param repository: The repository to add.
        """
        return _common.Repositories_add(self, repository)

    def begin(self):
        r"""Returns an iterator to the beginning of the container."""
        return _common.Repositories_begin(self)

    def end(self):
        r"""Returns an iterator to the end of the container."""
        return _common.Repositories_end(self)

    def __getitem__(self, id):
        return _common.Repositories___getitem__(self, id)

    def __setitem__(self, id, repository):
        return _common.Repositories___setitem__(self, id, repository)

    def __contains__(self, id):
        return _common.Repositories___contains__(self, id)

    def __len__(self):
        return _common.Repositories___len__(self)

# Register Repositories in _common:
_common.Repositories_swigregister(Repositories)
class RepositoriesIterator(object):
    thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
    __repr__ = _swig_repr
    __swig_destroy__ = _common.delete_RepositoriesIterator

    def __init__(self, *args):
        _common.RepositoriesIterator_swiginit(self, _common.new_RepositoriesIterator(*args))

    def value(self):
        return _common.RepositoriesIterator_value(self)

    def next(self):
        return _common.RepositoriesIterator_next(self)

    def __ne__(self, other):
        return _common.RepositoriesIterator___ne__(self, other)

# Register RepositoriesIterator in _common:
_common.RepositoriesIterator_swigregister(RepositoriesIterator)
class MapRepositories(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 _common.MapRepositories_iterator(self)
    def __iter__(self):
        return self.iterator()

    def __nonzero__(self):
        return _common.MapRepositories___nonzero__(self)

    def __bool__(self):
        return _common.MapRepositories___bool__(self)

    def __len__(self):
        return _common.MapRepositories___len__(self)
    def __iter__(self):
        return self.key_iterator()
    def iterkeys(self):
        return self.key_iterator()
    def itervalues(self):
        return self.value_iterator()
    def iteritems(self):
        return self.iterator()

    def __getitem__(self, key):
        return _common.MapRepositories___getitem__(self, key)

    def __delitem__(self, key):
        return _common.MapRepositories___delitem__(self, key)

    def has_key(self, key):
        return _common.MapRepositories_has_key(self, key)

    def keys(self):
        return _common.MapRepositories_keys(self)

    def values(self):
        return _common.MapRepositories_values(self)

    def items(self):
        return _common.MapRepositories_items(self)

    def __contains__(self, key):
        return _common.MapRepositories___contains__(self, key)

    def key_iterator(self):
        return _common.MapRepositories_key_iterator(self)

    def value_iterator(self):
        return _common.MapRepositories_value_iterator(self)

    def __setitem__(self, *args):
        return _common.MapRepositories___setitem__(self, *args)

    def asdict(self):
        return _common.MapRepositories_asdict(self)

    def __init__(self, *args):
        _common.MapRepositories_swiginit(self, _common.new_MapRepositories(*args))

    def empty(self):
        return _common.MapRepositories_empty(self)

    def size(self):
        return _common.MapRepositories_size(self)

    def swap(self, v):
        return _common.MapRepositories_swap(self, v)

    def begin(self):
        return _common.MapRepositories_begin(self)

    def end(self):
        return _common.MapRepositories_end(self)

    def rbegin(self):
        return _common.MapRepositories_rbegin(self)

    def rend(self):
        return _common.MapRepositories_rend(self)

    def clear(self):
        return _common.MapRepositories_clear(self)

    def get_allocator(self):
        return _common.MapRepositories_get_allocator(self)

    def count(self, x):
        return _common.MapRepositories_count(self, x)

    def erase(self, *args):
        return _common.MapRepositories_erase(self, *args)

    def find(self, x):
        return _common.MapRepositories_find(self, x)

    def lower_bound(self, x):
        return _common.MapRepositories_lower_bound(self, x)

    def upper_bound(self, x):
        return _common.MapRepositories_upper_bound(self, x)
    __swig_destroy__ = _common.delete_MapRepositories

# Register MapRepositories in _common:
_common.MapRepositories_swigregister(MapRepositories)

def Repositories__iter__(self):
    return Iterator(self, self.begin(), self.end())
Repositories.__iter__ = Repositories__iter__
del Repositories__iter__


add_property_accessors(Repository)
add_property_accessors(Version)


