
    Xj8                    j    d dl mZ d dlmZ d dlmZmZmZmZm	Z	m
Z
mZ d dlmZ erd dlmZ d	dZdgZy)
    )annotations)BytesIO)TYPE_CHECKINGAnyDictListOptionalUnioncast)File)Requestc                   t        t        t        t        t        t
           f      | j                        }|si S i }|j                         D ]0  \  }}t        |      dk(  sJ t        |d   j                        ||<   2 |S )at  Converts the request.files dictionary to a dictionary of BytesIO objects.

    `request.files` has the following format, even if only a single file is uploaded:

    ```python
    {
        "textFile": [
            sanic.request.File(type="text/plain", body=b"strawberry", name="textFile.txt")
        ]
    }
    ```

    Note that the dictionary entries are lists.
       r   )r   r	   r   strr   r   filesitemslenr   body)requestrequest_files
files_dict
field_name	file_lists        c/var/www/html/myl_app/scheduler-service/venv/lib/python3.12/site-packages/strawberry/sanic/utils.pyconvert_request_to_files_dictr      s     $sDJ"78'--HM	;=J!.!4!4!6 <
I9~"""!(1):):!;
:<
     r   N)r   r   returnzDict[str, Any])
__future__r   ior   typingr   r   r   r   r	   r
   r   sanic.requestr   r   r   __all__ r   r   <module>r$      s,    "  H H H %< +
+r   