Ë
    ö%9jó'  ã                   ó^   — d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
mZ  G d„ de«      Zy	)
zµConfigure HMAC keys that can be used to authenticate requests to Google Cloud Storage.

See [HMAC keys documentation](https://cloud.google.com/storage/docs/authentication/hmackeys)
é    )Ú_rfc3339_nanos_to_datetime)ÚNotFound)Úcreate_trace_span)Ú_DEFAULT_TIMEOUT)ÚDEFAULT_RETRYÚDEFAULT_RETRY_IF_ETAG_IN_JSONc                   ó2  — e Zd ZdZdZ	 dZ	 dZ	 eefZdd„Zd„ Z	d„ Z
ed	„ «       Zed
„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zej$                  d„ «       Zed„ «       Zed„ «       Zed„ «       Zed„ «       Zeefd„Zeefd„Zeefd„Zeefd„Zy)ÚHMACKeyMetadataa   Metadata about an HMAC service account key withn Cloud Storage.

    :type client: :class:`~google.cloud.stoage.client.Client`
    :param client: client associated with the key metadata.

    :type access_id: str
    :param access_id: (Optional) Unique ID of an existing key.

    :type project_id: str
    :param project_id: (Optional) Project ID of an existing key.
        Defaults to client's project.

    :type user_project: str
    :param user_project: (Optional) This parameter is currently ignored.
    ÚACTIVEÚINACTIVEÚDELETEDNc                 ór   — || _         i | _        |�|| j                  d<   |�|| j                  d<   || _        y )NÚaccessIdÚ	projectId)Ú_clientÚ_propertiesÚ_user_project)ÚselfÚclientÚ	access_idÚ
project_idÚuser_projects        úY/var/www/html/truck-me/venv/lib/python3.12/site-packages/google/cloud/storage/hmac_key.pyÚ__init__zHMACKeyMetadata.__init__9   sE   € ØˆŒØˆÔàÐ Ø+4ˆD×Ñ˜ZÑ(àÐ!Ø,6ˆD×Ñ˜[Ñ)à)ˆÕó    c                 ó¢   — t        || j                  «      st        S | j                  |j                  k(  xr | j                  |j                  k(  S ©N)Ú
isinstanceÚ	__class__ÚNotImplementedr   r   )r   Úothers     r   Ú__eq__zHMACKeyMetadata.__eq__E   s;   € Ü˜% §¡Ô0Ü!Ð!à�|‰|˜uŸ}™}Ñ,ÒR°·±À5Ç?Á?Ñ1RÐRr   c                 óX   — t        | j                  «      t        | j                  «      z   S r   )Úhashr   r   ©r   s    r   Ú__hash__zHMACKeyMetadata.__hash__K   s   € Ü�D—L‘LÓ!¤D¨¯©Ó$8Ñ8Ð8r   c                 ó8   — | j                   j                  d«      S )z|Access ID of the key.

        :rtype: str or None
        :returns: unique identifier of the key within a project.
        r   ©r   Úgetr%   s    r   r   zHMACKeyMetadata.access_idN   s   € ð ×Ñ×#Ñ# JÓ/Ð/r   c                 ó8   — | j                   j                  d«      S )z•ETag identifying the version of the key metadata.

        :rtype: str or None
        :returns: ETag for the version of the key's metadata.
        Úetagr(   r%   s    r   r+   zHMACKeyMetadata.etagW   s   € ð ×Ñ×#Ñ# FÓ+Ð+r   c                 ó8   — | j                   j                  d«      S )z�ID of the key, including the Project ID and the Access ID.

        :rtype: str or None
        :returns: ID of the key.
        Úidr(   r%   s    r   r-   zHMACKeyMetadata.id`   s   € ð ×Ñ×#Ñ# DÓ)Ð)r   c                 ó8   — | j                   j                  d«      S )zzProject ID associated with the key.

        :rtype: str or None
        :returns: project identfier for the key.
        r   r(   r%   s    r   ÚprojectzHMACKeyMetadata.projecti   s   € ð ×Ñ×#Ñ# KÓ0Ð0r   c                 ó8   — | j                   j                  d«      S )z­Service account e-mail address associated with the key.

        :rtype: str or None
        :returns: e-mail address for the service account which created the key.
        ÚserviceAccountEmailr(   r%   s    r   Úservice_account_emailz%HMACKeyMetadata.service_account_emailr   s   € ð ×Ñ×#Ñ#Ð$9Ó:Ð:r   c                 ó8   — | j                   j                  d«      S )zÂGet / set key's state.

        One of:
            - ``ACTIVE``
            - ``INACTIVE``
            - ``DELETED``

        :rtype: str or None
        :returns: key's current state.
        Ústater(   r%   s    r   r4   zHMACKeyMetadata.state{   s   € ð ×Ñ×#Ñ# GÓ,Ð,r   c                 ó"   — || j                   d<   y )Nr4   )r   ©r   Úvalues     r   r4   zHMACKeyMetadata.state‰   s   € à$)ˆ×Ñ˜Ò!r   c                 óT   — | j                   j                  d«      }|�t        |«      S y)á3  Retrieve the timestamp at which the HMAC key was created.

        :rtype: :class:`datetime.datetime` or ``NoneType``
        :returns: Datetime object parsed from RFC3339 valid timestamp, or
                  ``None`` if the bucket's resource has not been loaded
                  from the server.
        ÚtimeCreatedN©r   r)   r   r6   s     r   Útime_createdzHMACKeyMetadata.time_created�   s0   € ð × Ñ ×$Ñ$ ]Ó3ˆØÐÜ-¨eÓ4Ð4ð r   c                 óT   — | j                   j                  d«      }|�t        |«      S y)r9   ÚupdatedNr;   r6   s     r   r>   zHMACKeyMetadata.updatedš   s0   € ð × Ñ ×$Ñ$ YÓ/ˆØÐÜ-¨eÓ4Ð4ð r   c                 óœ   — | j                   €t        d«      ‚| j                  }|€| j                  j                  }d|› d| j                   › �S )z%Resource path for the metadata's key.zNo 'access_id' set.z
/projects/z
/hmacKeys/)r   Ú
ValueErrorr/   r   )r   r/   s     r   ÚpathzHMACKeyMetadata.path§   sO   € ð �>‰>Ð!ÜÐ2Ó3Ð3à—,‘,ˆØˆ?Ø—l‘l×*Ñ*ˆGà˜G˜9 J¨t¯~©~Ð.>Ð?Ð?r   c                 ó   — | j                   S )z—Project ID to be billed for API requests made via this bucket.

        This property is currently ignored by the server.

        :rtype: str
        )r   r%   s    r   r   zHMACKeyMetadata.user_project´   s   € ð ×!Ñ!Ð!r   c                 ó  — t        d¬«      5  	 i }| j                  �| j                  |d<   | j                  j                  | j                  |||¬«       	 ddd«       y# t
        $ r Y ddd«       yw xY w# 1 sw Y   yxY w)a#  Determine whether or not the key for this metadata exists.

        :type timeout: float or tuple
        :param timeout:
            (Optional) The amount of time, in seconds, to wait
            for the server response.  See: :ref:`configuring_timeouts`

        :type retry: google.api_core.retry.Retry or google.cloud.storage.retry.ConditionalRetryPolicy
        :param retry:
            (Optional) How to retry the RPC. See: :ref:`configuring_retries`

        :rtype: bool
        :returns: True if the key exists in Cloud Storage.
        zStorage.HmacKey.exists©ÚnameNÚuserProject©Úquery_paramsÚtimeoutÚretryTF)r   r   r   Ú_get_resourcerA   r   ©r   rI   rJ   Ú	qs_paramss       r   ÚexistszHMACKeyMetadata.exists¾   s—   € ô Ð$<Ô=ñ 	ðØ�	à×$Ñ$Ð0Ø/3×/@Ñ/@�I˜mÑ,à—‘×*Ñ*Ø—I‘IØ!*Ø#Øð	 +ô ð ÷!	ð 	øô ò Ø÷	ð 	ðú÷	ð 	ús/   �A6�AAÁA6Á	A3Á(A6Á2A3Á3A6Á6A?c                 óÜ   — t        d¬«      5  i }| j                  �| j                  |d<   | j                  j                  | j                  |||¬«      | _        ddd«       y# 1 sw Y   yxY w)a4  Reload properties from Cloud Storage.

        :type timeout: float or tuple
        :param timeout:
            (Optional) The amount of time, in seconds, to wait
            for the server response.  See: :ref:`configuring_timeouts`

        :type retry: google.api_core.retry.Retry or google.cloud.storage.retry.ConditionalRetryPolicy
        :param retry:
            (Optional) How to retry the RPC. See: :ref:`configuring_retries`

        :raises :class:`~google.api_core.exceptions.NotFound`:
            if the key does not exist on the back-end.
        zStorage.HmacKey.reloadrD   NrF   rG   )r   r   r   rK   rA   r   rL   s       r   ÚreloadzHMACKeyMetadata.reloadß   so   € ô Ð$<Ô=ñ 	ØˆIà× Ñ Ð,Ø+/×+<Ñ+<�	˜-Ñ(à#Ÿ|™|×9Ñ9Ø—	‘	Ø&ØØð	  :ó  ˆDÔ÷	÷ 	ñ 	ús   �AA"Á"A+c                 óú   — t        d¬«      5  i }| j                  �| j                  |d<   d| j                  i}| j                  j	                  | j
                  ||||¬«      | _        ddd«       y# 1 sw Y   yxY w)a9  Save writable properties to Cloud Storage.

        :type timeout: float or tuple
        :param timeout:
            (Optional) The amount of time, in seconds, to wait
            for the server response.  See: :ref:`configuring_timeouts`

        :type retry: google.api_core.retry.Retry or google.cloud.storage.retry.ConditionalRetryPolicy
        :param retry:
            (Optional) How to retry the RPC. See: :ref:`configuring_retries`

        :raises :class:`~google.api_core.exceptions.NotFound`:
            if the key does not exist on the back-end.
        zStorage.HmacKey.updaterD   NrF   r4   rG   )r   r   r4   r   Ú_put_resourcerA   r   )r   rI   rJ   rM   Úpayloads        r   ÚupdatezHMACKeyMetadata.updateû   s€   € ô Ð$<Ô=ñ 	ØˆIØ× Ñ Ð,Ø+/×+<Ñ+<�	˜-Ñ(à §
¡
Ð+ˆGØ#Ÿ|™|×9Ñ9Ø—	‘	ØØ&ØØð  :ó  ˆDÔ÷	÷ 	ñ 	ús   �AA1Á1A:c                 óÒ   — t        d¬«      5  i }| j                  �| j                  |d<   | j                  j                  | j                  |||¬«       ddd«       y# 1 sw Y   yxY w)a1  Delete the key from Cloud Storage.

        :type timeout: float or tuple
        :param timeout:
            (Optional) The amount of time, in seconds, to wait
            for the server response.  See: :ref:`configuring_timeouts`

        :type retry: google.api_core.retry.Retry or google.cloud.storage.retry.ConditionalRetryPolicy
        :param retry:
            (Optional) How to retry the RPC. See: :ref:`configuring_retries`

        :raises :class:`~google.api_core.exceptions.NotFound`:
            if the key does not exist on the back-end.
        zStorage.HmacKey.deleterD   NrF   rG   )r   r   r   Ú_delete_resourcerA   rL   s       r   ÚdeletezHMACKeyMetadata.delete  sj   € ô Ð$<Ô=ñ 
	ØˆIØ× Ñ Ð,Ø+/×+<Ñ+<�	˜-Ñ(à�L‰L×)Ñ)Ø—	‘	Ø&ØØð	 *ô ÷
	÷ 
	ñ 
	ús   �AAÁA&)NNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚACTIVE_STATEÚINACTIVE_STATEÚDELETED_STATEÚ_SETTABLE_STATESr   r"   r&   Úpropertyr   r+   r-   r/   r2   r4   Úsetterr<   r>   rA   r   r   r   rN   rP   r   rT   rW   © r   r   r
   r
      sT  „ ñð  €LØ:Ø€Nðð €MØ5à$ nÐ5Ðó
*òSò9ð ñ0ó ð0ð ñ,ó ð,ð ñ*ó ð*ð ñ1ó ð1ð ñ;ó ð;ð ñ-ó ð-ð ‡\�\ñ*ó ð*ð ñ
5ó ð
5ð ñ
5ó ð
5ð ñ
@ó ð
@ð ñ"ó ð"ð .°]ó ðB .°]ó ð8 .Ð5Ró ð: .°]ô r   r
   N)r[   Úgoogle.cloud._helpersr   Úgoogle.cloud.exceptionsr   Ú+google.cloud.storage._opentelemetry_tracingr   Úgoogle.cloud.storage.constantsr   Úgoogle.cloud.storage.retryr   r   Úobjectr
   rb   r   r   ú<module>ri      s)   ðñõ
 =Ý ,å IÝ ;ß SôU�fõ Ur   