
    ,Ofb#                        d dl mZ d dlZd dlmZmZ d dlZd dlZd dlm	Z	m
Z
mZmZ erd dlmZ d dlmZ  G d de
      Zy)	    )annotationsN)TYPE_CHECKINGAny)	AttributeCompletableGithubObjectNotSet_ValuedAttribute)License)
Repositoryc                  6   e Zd ZdZddZddZedd       Zedd       Zedd       Z	edd       Z
edd       Zedd	       Zedd
       Zedd       Zedd       Zedd       Zedd       Zedd       Zedd       Zedd       Zedd       ZddZy)ContentFilez
    This class represents ContentFiles.

    The reference can be found here
    https://docs.github.com/en/rest/reference/repos#contents

    c                8   t         | _        t         | _        t         | _        t         | _        t         | _        t         | _        t         | _        t         | _        t         | _	        t         | _
        t         | _        t         | _        t         | _        t         | _        y N)r   _content_download_url	_encoding_git_url	_html_url_license_name_path_repository_sha_size_type_url_text_matchesselfs    2lib/python3.12/site-packages/github/ContentFile.py_initAttributeszContentFile._initAttributesC   sg    (.-3)/(.)/,2%+
%+
28$*	%+
%+
$*	-3    c                P    | j                  d| j                  j                  i      S )Npath)get__repr__r   valuer   s    r    __repr__zContentFile.__repr__S   s"    )9)9 :;;r"   c                d    | j                  | j                         | j                  j                  S r   )_completeIfNotSetr   r&   r   s    r    contentzContentFile.contentV   $    t}}-}}"""r"   c                    | j                   dk(  sJ d| j                           t        j                  t        | j                  d            S )Nbase64zunsupported encoding: zutf-8)encodingr-   	b64decode	bytearrayr*   r   s    r    decoded_contentzContentFile.decoded_content[   sA    }}(R,B4==/*RR(	$,, @AAr"   c                d    | j                  | j                         | j                  j                  S r   )r)   r   r&   r   s    r    download_urlzContentFile.download_url`   (    t112!!'''r"   c                d    | j                  | j                         | j                  j                  S r   )r)   r   r&   r   s    r    r.   zContentFile.encodinge   $    t~~.~~###r"   c                d    | j                  | j                         | j                  j                  S r   )r)   r   r&   r   s    r    git_urlzContentFile.git_urlj   r+   r"   c                d    | j                  | j                         | j                  j                  S r   )r)   r   r&   r   s    r    html_urlzContentFile.html_urlo   r6   r"   c                d    | j                  | j                         | j                  j                  S r   )r)   r   r&   r   s    r    licensezContentFile.licenset   r+   r"   c                d    | j                  | j                         | j                  j                  S r   )r)   r   r&   r   s    r    namezContentFile.namey   $    tzz*zzr"   c                d    | j                  | j                         | j                  j                  S r   )r)   r   r&   r   s    r    r$   zContentFile.path~   r?   r"   c                :   | j                   t        u rtdj                  | j                  j	                  d      d d       }t        t        j                  j                  | j                  | j                  d|id            | _         | j                   j                  S )N/   urlF)	completed)r   r   joinrD   splitr	   githubr   
_requester_headersr&   )r   repo_urls     r    
repositoryzContentFile.repository   s    v%xxs 3BQ 78H/!!,,T__dmmeU]M^jo,p D %%%r"   c                d    | j                  | j                         | j                  j                  S r   )r)   r   r&   r   s    r    shazContentFile.sha   "    tyy)yyr"   c                d    | j                  | j                         | j                  j                  S r   )r)   r   r&   r   s    r    sizezContentFile.size   r?   r"   c                d    | j                  | j                         | j                  j                  S r   )r)   r   r&   r   s    r    typezContentFile.type   r?   r"   c                d    | j                  | j                         | j                  j                  S r   )r)   r   r&   r   s    r    rD   zContentFile.url   rO   r"   c                d    | j                  | j                         | j                  j                  S r   )r)   r   r&   r   s    r    text_matcheszContentFile.text_matches   r4   r"   c                   d|v r| j                  |d         | _        d|v r| j                  |d         | _        d|v r| j                  |d         | _        d|v r| j                  |d         | _        d|v r| j                  |d         | _        d|v r2| j                  t        j                  j                  |d         | _	        d|v r| j                  |d         | _
        d|v r| j                  |d         | _        d	|v r2| j                  t        j                  j                  |d	         | _        d
|v r| j                  |d
         | _        d|v r| j                  |d         | _        d|v r| j                  |d         | _        d|v r| j                  |d         | _        d|v r| j'                  |d         | _        y y )Nr*   r3   r.   r8   r:   r<   r>   r$   rL   rN   rQ   rS   rD   rV   )_makeStringAttributer   r   r   r   r   _makeClassAttributerH   r
   r   r   r   r   r   r   _makeIntAttributer   r   r   _makeListOfDictsAttributer   )r   
attributess     r    _useAttributeszContentFile._useAttributes   s   
" 55j6KLDMZ'!%!:!::n;U!VD#!66z*7MNDN
" 55j6KLDM#!66z*7MNDN
" 44V^^5K5KZXaMbcDMZ22:f3EFDJZ22:f3EFDJ:%#778I8I8T8TV`amVnoDJ11*U2CDDIZ//
60BCDJZ22:f3EFDJJ11*U2CDDIZ'!%!?!?
>@Z![D (r"   N)returnNone)r^   str)r^   bytes)r^   r
   )r^   r   )r^   int)r\   zdict[str, Any]r^   r_   )__name__
__module____qualname____doc__r!   r'   propertyr*   r1   r3   r.   r8   r:   r<   r>   r$   rL   rN   rQ   rS   rD   rV   r]    r"   r    r   r   :   sE   4 < # # B B ( ( $ $ # # $ $ # #         & &             ( (\r"   r   )
__future__r   r-   typingr   r   github.GithubObjectrH   github.Repositoryr   r   r   r	   github.Licenser
   r   r   rh   r"   r    <module>rn      s7   X #  %   \ \&,H\) H\r"   