
    (ph(                     f    S r SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSK	Jr   " S S	\5      rg
)zConfigure 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)
    )NotFound)_rfc3339_nanos_to_datetime)create_trace_span)_DEFAULT_TIMEOUT)DEFAULT_RETRY)DEFAULT_RETRY_IF_ETAG_IN_JSONc                   D   \ rS rSrSrSr Sr Sr \\4rSS jr	S r
S	 r\S
 5       r\S 5       r\S 5       r\S 5       r\S 5       r\S 5       r\R&                  S 5       r\S 5       r\S 5       r\S 5       r\S 5       r\\4S jr\\4S jr\\4S jr\\4S jrSrg)HMACKeyMetadata   a  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                 n    Xl         0 U l        Ub  X R                  S'   Ub  X0R                  S'   X@l        g )NaccessId	projectId_client_properties_user_project)selfclient	access_id
project_iduser_projects        P/var/www/html/venv/lib/python3.13/site-packages/google/cloud/storage/hmac_key.py__init__HMACKeyMetadata.__init__:   s=     +4Z(!,6[))    c                     [        XR                  5      (       d  [        $ U R                  UR                  :H  =(       a    U R                  UR                  :H  $ N)
isinstance	__class__NotImplementedr   r   )r   others     r   __eq__HMACKeyMetadata.__eq__F   s<    %00!!||u}},R5??1RRr   c                 X    [        U R                  5      [        U R                  5      -   $ r    )hashr   r   r   s    r   __hash__HMACKeyMetadata.__hash__L   s    DLL!D$888r   c                 8    U R                   R                  S5      $ )zdAccess ID of the key.

:rtype: str or None
:returns: unique identifier of the key within a project.
r   r   getr)   s    r   r   HMACKeyMetadata.access_idO   s     ##J//r   c                 8    U R                   R                  S5      $ )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   r1   HMACKeyMetadata.etagX   s     ##F++r   c                 8    U R                   R                  S5      $ )ziID of the key, including the Project ID and the Access ID.

:rtype: str or None
:returns: ID of the key.
idr-   r)   s    r   r4   HMACKeyMetadata.ida   s     ##D))r   c                 8    U R                   R                  S5      $ )zbProject ID associated with the key.

:rtype: str or None
:returns: project identfier for the key.
r   r-   r)   s    r   projectHMACKeyMetadata.projectj   s     ##K00r   c                 8    U R                   R                  S5      $ )zService 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_email%HMACKeyMetadata.service_account_emails   s     ##$9::r   c                 8    U R                   R                  S5      $ )zGet / set key's state.

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

:rtype: str or None
:returns: key's current state.
stater-   r)   s    r   r>   HMACKeyMetadata.state|   s     ##G,,r   c                      XR                   S'   g )Nr>   )r   r   values     r   r>   r?      s    $)!r   c                 V    U R                   R                  S5      nUb  [        U5      $ g)  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   rA   s     r   time_createdHMACKeyMetadata.time_created   s0       $$]3-e44 r   c                 V    U R                   R                  S5      nUb  [        U5      $ g)rD   updatedNrF   rA   s     r   rJ   HMACKeyMetadata.updated   s0       $$Y/-e44 r   c                     U R                   c  [        S5      eU R                  nUc  U R                  R                  nSU SU R                    3$ )z%Resource path for the metadata's key.zNo 'access_id' set.z
/projects/z
/hmacKeys/)r   
ValueErrorr7   r   )r   r7   s     r   pathHMACKeyMetadata.path   sO     >>!233,,?ll**GG9Jt~~.>??r   c                     U R                   $ )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   HMACKeyMetadata.user_project   s     !!!r   c                    [        SS9    0 nU R                  b  U R                  US'   U R                  R                  U R                  UUUS9   SSS5        g! [
         a     SSS5        gf = f! , (       d  f       g= f)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_resourcerN   r   r   rX   rY   	qs_paramss       r   existsHMACKeyMetadata.exists   s     $<=	$$0/3/@/@Im,**II!*#	 +  ! >=   >= >=s/   A2AAA2
A/$A2.A//A22
B c                     [        SS9   0 nU R                  b  U R                  US'   U R                  R                  U R                  UUUS9U l        SSS5        g! , (       d  f       g= f)a  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.reloadrS   NrU   rV   )r   r   r   rZ   rN   r   r[   s       r   reloadHMACKeyMetadata.reload   sf     $<=I  ,+/+<+<	-(#||99		&	  :  D >==s   A
A
A+c           	          [        SS9   0 nU R                  b  U R                  US'   SU R                  0nU R                  R	                  U R
                  UUUUS9U l        SSS5        g! , (       d  f       g= f)a  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.updaterS   NrU   r>   rV   )r   r   r>   r   _put_resourcerN   r   )r   rX   rY   r\   payloads        r   updateHMACKeyMetadata.update   sw     $<=I  ,+/+<+<	-(

+G#||99		&  :  D >==s   AA,,
A:c                     [        SS9   0 nU R                  b  U R                  US'   U R                  R                  U R                  UUUS9  SSS5        g! , (       d  f       g= f)a  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.deleterS   NrU   rV   )r   r   r   _delete_resourcerN   r[   s       r   deleteHMACKeyMetadata.delete  sa     $<=I  ,+/+<+<	-(LL))		&	 *  >==s   AA
A&r   )NNN) __name__
__module____qualname____firstlineno____doc__ACTIVE_STATEINACTIVE_STATEDELETED_STATE_SETTABLE_STATESr   r%   r*   propertyr   r1   r4   r7   r;   r>   setterrG   rJ   rN   r   r   r   r]   r`   r   re   ri   __static_attributes__ 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)ro   google.cloud.exceptionsr   google.cloud._helpersr   +google.cloud.storage._opentelemetry_tracingr   google.cloud.storage.constantsr   google.cloud.storage.retryr   r   objectr
   rw   r   r   <module>r~      s,   
 - < I ; 4 DUf Ur   