# Path: pyuploadcare/exceptions.py
# class InvalidParamError(InvalidRequestError):
#     """Invalid parameters errors, e.g. invalid UUID"""


import re
import dateutil.parser
from typing import TYPE_CHECKING, Any, Dict, Optional
from pyuploadcare.exceptions import InvalidParamError
    from pyuploadcare.client import Uploadcare

    You can iterate ``file_group`` or get ``File`` instance by key::

        >>> [file_ for file_ in file_group]
        [<uploadcare.File 6c5e9526-b0fe-4739-8975-72e8d5ee6342>, None]
        >>> file_group[0]
        <uploadcare.File 6c5e9526-b0fe-4739-8975-72e8d5ee6342>
        >>> len(file_group)
        2

    But slicing is not supported because ``FileGroup`` is immutable::

        >>> file_group[:]
        TypeError: slicing is not supported

    If file was deleted then you will get ``None``::

        >>> file_group[1]
        None

    """

    def __init__(self, cdn_url_or_group_id: str, client: "Uploadcare"):
        matches = GROUP_ID_REGEX.search(cdn_url_or_group_id)

        if not matches:
            raise InvalidParamError("Couldn't find group id")

        files_qty = int(matches.groupdict()["files_qty"])
        if files_qty <= 0:

# Path: pyuploadcare/exceptions.py
# class InvalidParamError(InvalidRequestError):
#     """Invalid parameters errors, e.g. invalid UUID"""


# Path: pyuploadcare/resources/file_group.py
import re
import dateutil.parser
from typing import TYPE_CHECKING, Any, Dict, Optional
from pyuploadcare.exceptions import InvalidParamError
    from pyuploadcare.client import Uploadcare


    You can iterate ``file_group`` or get ``File`` instance by key::

        >>> [file_ for file_ in file_group]
        [<uploadcare.File 6c5e9526-b0fe-4739-8975-72e8d5ee6342>, None]
        >>> file_group[0]
        <uploadcare.File 6c5e9526-b0fe-4739-8975-72e8d5ee6342>
        >>> len(file_group)
        2

    But slicing is not supported because ``FileGroup`` is immutable::

        >>> file_group[:]
        TypeError: slicing is not supported

    If file was deleted then you will get ``None``::

        >>> file_group[1]
        None

    """

    def __init__(self, cdn_url_or_group_id: str, client: "Uploadcare"):
        matches = GROUP_ID_REGEX.search(cdn_url_or_group_id)

        if not matches:
            raise InvalidParamError("Couldn't find group id")

        files_qty = int(matches.groupdict()["files_qty"])
        if files_qty <= 0:

            raise InvalidParamError("Couldn't find group id")