Ë
    V¼Sf¿_  ã                   óæ  — d Z ddlZddlZddlmZ ddl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 dd	lmZ dd
lmZ ddlmZ dZ	 dZ	 dZ	 dZdZej3                  e¬«      ZdZ ej8                  ed«      Z	 dZdZdZ ej                  jB                  Z"ejF                  jH                  Z%d„ Z&d„ Z'd„ Z(d*d„Z)d„ Z*d„ Z+d„ Z, G d„ de-«      Z.d „ Z/d+d!„Z0d"„ Z1d#„ Z2d$„ Z3d%„ Z4d,d&„Z5d,d'„Z6d(„ Z7	 	 	 d-d)„Z8y).zVHelper functions for Cloud Storage utility classes.

These are *not* part of the API.
é    N)Úmd5)Úurlsplit)Ú
urlunsplit)Úuuid4)Úresumable_media)Úenvironment_vars)Ú_DEFAULT_TIMEOUT)ÚDEFAULT_RETRY)Ú)DEFAULT_RETRY_IF_METAGENERATION_SPECIFIEDÚSTORAGE_EMULATOR_HOSTÚAPI_ENDPOINT_OVERRIDEÚAPI_VERSION_OVERRIDEzgoogleapis.comzstorage.{universe_domain})Úuniverse_domainzhttps://Úv1))Úif_etag_matchzIf-Match)Úif_etag_not_matchzIf-None-Match))Úif_generation_matchÚifGenerationMatch)Úif_generation_not_matchÚifGenerationNotMatch)Úif_metageneration_matchÚifMetagenerationMatch)Úif_metageneration_not_matchÚifMetagenerationNotMatch)Úif_source_generation_matchÚifSourceGenerationMatch)Úif_source_generation_not_matchÚifSourceGenerationNotMatch)Úif_source_metageneration_matchÚifSourceMetagenerationMatch)Ú"if_source_metageneration_not_matchÚifSourceMetagenerationNotMatchz¤`num_retries` has been deprecated and will be removed in a future release. Use the `retry` argument with a Retry or ConditionalRetryPolicy object, or None, instead.c                  óJ   — t         j                  j                  t        d «      S ©N)ÚosÚenvironÚgetÚSTORAGE_EMULATOR_ENV_VAR© ó    ú\C:\Users\user\Documents\project_loop\venv\Lib\site-packages\google/cloud/storage/_helpers.pyÚ_get_storage_emulator_overrider,   X   s   € Ü�:‰:�>‰>Ô2°DÓ9Ð9r*   c                  óL   — t        j                  t        t        t        z   «      S r$   )r%   ÚgetenvÚ_API_ENDPOINT_OVERRIDE_ENV_VARÚ_DEFAULT_SCHEMEÚ_TRUE_DEFAULT_STORAGE_HOSTr)   r*   r+   Ú_get_default_storage_base_urlr2   \   s   € Ü�9‰9Ü&¬Ô:TÑ(Tóð r*   c                  óH   — t        «       t        t        z   k7  r
t        «       S y)zIThis is an experimental configuration variable. Use api_endpoint instead.N)r2   r0   r1   r)   r*   r+   Ú_get_api_endpoint_overrider4   b   s   € ä$Ó&¬/Ô<VÑ*VÒVÜ,Ó.Ð.Ør*   c                 óz   — t        | «      }|› d|j                  › �}t        |j                  ||rdndddf«      }|S )z²Returns the scheme and netloc sections of the url, with the bucket
    prepended to the netloc.

    Not intended for use with netlocs which include a username and password.
    ú.ú/Ú )r   Únetlocr   Úscheme)ÚurlÚbucketÚtrailing_slashÚ
parsed_urlÚ
new_netlocÚbase_urls         r+   Ú_virtual_hosted_style_base_urlrA   i   sM   € ô ˜#“€JØ�8˜1˜Z×.Ñ.Ð/Ð0€JÜØ	×	Ñ	˜J©~©À2ÀrÈ2ÐNó€Hð €Or*   c                  ó2   — t        j                  d«      dk(  S )NÚ!GOOGLE_API_USE_CLIENT_CERTIFICATEÚtrue)r%   r.   r)   r*   r+   Ú_use_client_certrE   w   s   € Ü�9‰9Ð8Ó9¸VÑCÐCr*   c                  óŒ   — t        j                  t        j                  t        j                  t        j                  «      «      S r$   )r%   r.   r   ÚPROJECTÚLEGACY_PROJECTr)   r*   r+   Ú_get_environ_projectrI   {   s/   € Ü�9‰9Ü× Ñ Ü
�	‰	Ô"×1Ñ1Ó2óð r*   c                 ó€   — | €yt        | d   j                  «       | d   j                  «       g«      st        d«      ‚| S )zÁPre-flight ``Bucket`` name validation.

    :type name: str or :data:`NoneType`
    :param name: Proposed bucket name.

    :rtype: str or :data:`NoneType`
    :returns: ``name`` if valid.
    Nr   éÿÿÿÿz8Bucket names must start and end with a number or letter.)ÚallÚisalnumÚ
ValueError)Únames    r+   Ú_validate_namerP   ‚   sD   € ð €|Øô ��Q‘—‘Ó! 4¨¡8×#3Ñ#3Ó#5Ð6Ô7ÜÐSÓTÐTØ€Kr*   c                   ó¾   — e Zd ZdZdd„Zed„ «       Zed„ «       Zed„ «       Zd„ Z	d„ Z
ed	„ «       Zdd
ddddddeedfd„Zd„ Zd„ Zdddddeedfd„Zdddddeedfd„Zy)Ú_PropertyMixina1  Abstract mixin for cloud storage classes with associated properties.

    Non-abstract subclasses should implement:
      - path
      - client
      - user_project

    :type name: str
    :param name: The name of the object. Bucket names must start and end with a
                 number or letter.
    Nc                 ó>   — || _         i | _        t        «       | _        y r$   )rO   Ú_propertiesÚsetÚ_changes)ÚselfrO   s     r+   Ú__init__z_PropertyMixin.__init__¡   s   € ØˆŒ	ØˆÔÜ›ˆ�r*   c                 ó   — t         ‚)z$Abstract getter for the object path.©ÚNotImplementedError©rW   s    r+   Úpathz_PropertyMixin.path¦   ó
   € ô "Ð!r*   c                 ó   — t         ‚)z&Abstract getter for the object client.rZ   r\   s    r+   Úclientz_PropertyMixin.client«   r^   r*   c                 ó   — t         ‚)z,Abstract getter for the object user_project.rZ   r\   s    r+   Úuser_projectz_PropertyMixin.user_project°   r^   r*   c                 ó"   — |€| j                   }|S )a£  Check client or verify over-ride.

        :type client: :class:`~google.cloud.storage.client.Client` or
                      ``NoneType``
        :param client: the client to use.  If not passed, falls back to the
                       ``client`` stored on the current object.

        :rtype: :class:`google.cloud.storage.client.Client`
        :returns: The client passed in or the currently bound client.
        )r`   )rW   r`   s     r+   Ú_require_clientz_PropertyMixin._require_clientµ   s   € ð ˆ>Ø—[‘[ˆFØˆr*   c                 ó   — i S )a@  Return any encryption headers needed to fetch the object.

        .. note::
           Defined here because :meth:`reload` calls it, but this method is
           really only relevant for :class:`~google.cloud.storage.blob.Blob`.

        :rtype: dict
        :returns: a mapping of encryption-related headers.
        r)   r\   s    r+   Ú_encryption_headersz"_PropertyMixin._encryption_headersÄ   s	   € ð ˆ	r*   c                 ó@   — i }| j                   �| j                   |d<   |S )zDefault query parameters.ÚuserProject)rb   )rW   Úparamss     r+   Ú_query_paramsz_PropertyMixin._query_paramsÐ   s*   € ð ˆØ×ÑÐ(Ø$(×$5Ñ$5ˆF�=Ñ!Øˆr*   ÚnoAclc                 ó  — | j                  |«      }| j                  }||d<   t        |||||¬«       |�||d<   | j                  «       }t	        |||¬«       |j                  | j                  |||	|
| ¬«      }| j                  |«       y)aÊ  Reload properties from Cloud Storage.

        If :attr:`user_project` is set, bills the API request to that project.

        :type client: :class:`~google.cloud.storage.client.Client` or
                      ``NoneType``
        :param client: the client to use. If not passed, falls back to the
                       ``client`` stored on the current object.

        :type projection: str
        :param projection: (Optional) If used, must be 'full' or 'noAcl'.
                           Defaults to ``'noAcl'``. Specifies the set of
                           properties to return.

        :type if_etag_match: Union[str, Set[str]]
        :param if_etag_match: (Optional) See :ref:`using-if-etag-match`

        :type if_etag_not_match: Union[str, Set[str]])
        :param if_etag_not_match: (Optional) See :ref:`using-if-etag-not-match`

        :type if_generation_match: long
        :param if_generation_match:
            (Optional) See :ref:`using-if-generation-match`

        :type if_generation_not_match: long
        :param if_generation_not_match:
            (Optional) See :ref:`using-if-generation-not-match`

        :type if_metageneration_match: long
        :param if_metageneration_match:
            (Optional) See :ref:`using-if-metageneration-match`

        :type if_metageneration_not_match: long
        :param if_metageneration_not_match:
            (Optional) See :ref:`using-if-metageneration-not-match`

        :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`

        :type soft_deleted: bool
        :param soft_deleted:
            (Optional) If True, looks for a soft-deleted object. Will only return
            the object metadata if the object exists and is in a soft-deleted state.
            :attr:`generation` is required to be set on the blob if ``soft_deleted`` is set to True.
            See: https://cloud.google.com/storage/docs/soft-delete
        Ú
projection©r   r   r   r   NÚsoftDeleted)r   r   )Úquery_paramsÚheadersÚtimeoutÚretryÚ_target_object)rd   rj   Ú _add_generation_match_parametersrf   Ú_add_etag_match_headersÚ_get_resourcer]   Ú_set_properties)rW   r`   rm   r   r   r   r   r   r   rr   rs   Úsoft_deletedrp   rq   Úapi_responses                  r+   Úreloadz_PropertyMixin.reloadØ   s°   € ðD ×%Ñ% fÓ-ˆØ×)Ñ)ˆð &0ˆ�\Ñ"Ü(ØØ 3Ø$;Ø$;Ø(Cõ	
ð Ð#Ø*6ˆL˜Ñ'Ø×*Ñ*Ó,ˆÜØ =ÐDUõ	
ð ×+Ñ+Ø�I‰IØ%ØØØØð ,ó 
ˆð 	×Ñ˜\Õ*r*   c                 óX   — | j                   j                  |«       || j                  |<   y)aµ  Update field of this object's properties.

        This method will only update the field provided and will not
        touch the other fields.

        It **will not** reload the properties from the server. The behavior is
        local only and syncing occurs via :meth:`patch`.

        :type name: str
        :param name: The field name to update.

        :type value: object
        :param value: The value being updated.
        N)rV   ÚaddrT   )rW   rO   Úvalues      r+   Ú_patch_propertyz_PropertyMixin._patch_property6  s&   € ð 	�‰×Ñ˜$ÔØ!&ˆ×Ñ˜Òr*   c                 ó0   — || _         t        «       | _        y)z±Set the properties for the current object.

        :type value: dict or :class:`google.cloud.storage.batch._FutureDict`
        :param value: The properties to be set.
        N)rT   rU   rV   )rW   r~   s     r+   rx   z_PropertyMixin._set_propertiesH  s   € ð !ˆÔä›ˆ�r*   Fc	                 ó2  — | j                  |«      }| j                  }	d|	d<   |r||	d<   t        |	||||¬«       | j                  D �
ci c]  }
|
| j                  |
   “Œ }}
|j                  | j                  ||	| ||¬«      }| j                  |«       yc c}
w )aj  Sends all changed properties in a PATCH request.

        Updates the ``_properties`` with the response from the backend.

        If :attr:`user_project` is set, bills the API request to that project.

        :type client: :class:`~google.cloud.storage.client.Client` or
                      ``NoneType``
        :param client: the client to use. If not passed, falls back to the
                       ``client`` stored on the current object.

        :type if_generation_match: long
        :param if_generation_match:
            (Optional) See :ref:`using-if-generation-match`

        :type if_generation_not_match: long
        :param if_generation_not_match:
            (Optional) See :ref:`using-if-generation-not-match`

        :type if_metageneration_match: long
        :param if_metageneration_match:
            (Optional) See :ref:`using-if-metageneration-match`

        :type if_metageneration_not_match: long
        :param if_metageneration_not_match:
            (Optional) See :ref:`using-if-metageneration-not-match`

        :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`

        :type override_unlocked_retention: bool
        :param override_unlocked_retention:
            (Optional) override_unlocked_retention must be set to True if the operation includes
            a retention property that changes the mode from Unlocked to Locked, reduces the
            retainUntilTime, or removes the retention configuration from the object. See:
            https://cloud.google.com/storage/docs/json_api/v1/objects/patch
        Úfullrm   ÚoverrideUnlockedRetentionrn   )rp   rt   rr   rs   N)rd   rj   ru   rV   rT   Ú_patch_resourcer]   rx   )rW   r`   r   r   r   r   rr   rs   Úoverride_unlocked_retentionrp   ÚkeyÚupdate_propertiesrz   s                r+   Úpatchz_PropertyMixin.patchR  sÀ   € ðl ×%Ñ% fÓ-ˆØ×)Ñ)ˆð &,ˆ�\Ñ"Ù&Ø8SˆLÐ4Ñ5Ü(ØØ 3Ø$;Ø$;Ø(Cõ	
ð DHÇ=Á=ÖQ¸C˜S $×"2Ñ"2°3Ñ"7Ñ7ÐQÐÐQð ×-Ñ-Ø�I‰IØØ%ØØØð .ó 
ˆð 	×Ñ˜\Õ*ùò Rs   ÁBc	                 óî   — | j                  |«      }| j                  }	d|	d<   |r||	d<   t        |	||||¬«       |j                  | j                  | j
                  |	||| ¬«      }
| j                  |
«       y)a`  Sends all properties in a PUT request.

        Updates the ``_properties`` with the response from the backend.

        If :attr:`user_project` is set, bills the API request to that project.

        :type client: :class:`~google.cloud.storage.client.Client` or
                      ``NoneType``
        :param client: the client to use. If not passed, falls back to the
                       ``client`` stored on the current object.

        :type if_generation_match: long
        :param if_generation_match:
            (Optional) See :ref:`using-if-generation-match`

        :type if_generation_not_match: long
        :param if_generation_not_match:
            (Optional) See :ref:`using-if-generation-not-match`

        :type if_metageneration_match: long
        :param if_metageneration_match:
            (Optional) See :ref:`using-if-metageneration-match`

        :type if_metageneration_not_match: long
        :param if_metageneration_not_match:
            (Optional) See :ref:`using-if-metageneration-not-match`

        :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`

        :type override_unlocked_retention: bool
        :param override_unlocked_retention:
            (Optional) override_unlocked_retention must be set to True if the operation includes
            a retention property that changes the mode from Unlocked to Locked, reduces the
            retainUntilTime, or removes the retention configuration from the object. See:
            https://cloud.google.com/storage/docs/json_api/v1/objects/patch
        r‚   rm   rƒ   rn   )rp   rr   rs   rt   N)rd   rj   ru   Ú_put_resourcer]   rT   rx   )rW   r`   r   r   r   r   rr   rs   r…   rp   rz   s              r+   Úupdatez_PropertyMixin.update£  s’   € ðl ×%Ñ% fÓ-ˆà×)Ñ)ˆØ%+ˆ�\Ñ"Ù&Ø8SˆLÐ4Ñ5Ü(ØØ 3Ø$;Ø$;Ø(Cõ	
ð ×+Ñ+Ø�I‰IØ×ÑØ%ØØØð ,ó 
ˆð 	×Ñ˜\Õ*r*   r$   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__rX   Úpropertyr]   r`   rb   rd   rf   rj   r	   r
   r{   r   rx   r   rˆ   r‹   r)   r*   r+   rR   rR   ”   sÛ   „ ñ
óð
 ñ"ó ð"ð ñ"ó ð"ð ñ"ó ð"òò
ð ñó ðð ØØØØ Ø $Ø $Ø$(Ø ØØó\+ò|'ò$ð Ø Ø $Ø $Ø$(Ø Ø7Ø$)óO+ðf Ø Ø $Ø $Ø$(Ø Ø7Ø$)ôL+r*   rR   c                 ó0   ‡ — ˆ fd„}ˆ fd„}t        ||«      S )zHCreate a property descriptor around the :class:`_PropertyMixin` helpers.c                 ó:   •— | j                   j                  ‰«      S )zScalar property getter.)rT   r'   )rW   Ú	fieldnames    €r+   Ú_getterz!_scalar_property.<locals>._getterõ  s   ø€ à×Ñ×#Ñ# IÓ.Ð.r*   c                 ó*   •— | j                  ‰|«       y)zScalar property setter.N)r   )rW   r~   r“   s     €r+   Ú_setterz!_scalar_property.<locals>._setterù  s   ø€ à×Ñ˜Y¨Õ.r*   )r�   )r“   r”   r–   s   `  r+   Ú_scalar_propertyr—   ò  s   ø€ ô/ô/ô �G˜WÓ%Ð%r*   c                 ó¦   — | j                  |«      }t        |«      dkD  r2|j                  |«       | j                  |«      }t        |«      dkD  rŒ1yy)a¯  Read blocks from a buffer and update a hash with them.

    :type buffer_object: bytes buffer
    :param buffer_object: Buffer containing bytes used to update a hash object.

    :type hash_obj: object that implements update
    :param hash_obj: A hash object (MD5 or CRC32-C).

    :type digest_block_size: int
    :param digest_block_size: The block size to write to the hash.
                              Defaults to 8192.
    r   N)ÚreadÚlenr‹   )Úbuffer_objectÚhash_objÚdigest_block_sizeÚblocks       r+   Ú_write_buffer_to_hashrŸ      sJ   € ð ×ÑÐ0Ó1€Eä
ˆe‹*�qŠ.Ø�‰˜Ôà×"Ñ"Ð#4Ó5ˆô ˆe‹*�q�.r*   c                 óx   — t        «       }t        | |«       |j                  «       }t        j                  |«      S )a  Get MD5 hash of bytes (as base64).

    :type buffer_object: bytes buffer
    :param buffer_object: Buffer containing bytes used to compute an MD5
                          hash (as base64).

    :rtype: str
    :returns: A base64 encoded digest of the MD5 hash.
    )r   rŸ   ÚdigestÚbase64Ú	b64encode)r›   rœ   Údigest_bytess      r+   Ú_base64_md5hashr¥     s2   € ô ‹u€HÜ˜-¨Ô2Ø—?‘?Ó$€LÜ×Ñ˜LÓ)Ð)r*   c                 ó–   — t         D ]@  \  }}|j                  |«      }|€Œt        |t        «      r|g}dj	                  |«      | |<   ŒB y)zßAdd generation match parameters into the given parameters list.

    :type headers: dict
    :param headers: Headers dict.

    :type match_parameters: dict
    :param match_parameters: if*etag*match parameters to add.
    Nú, )Ú_ETAG_MATCH_PARAMETERSr'   Ú
isinstanceÚstrÚjoin)rq   Úmatch_parametersÚsnakecase_nameÚheader_namer~   s        r+   rv   rv   %  sR   € ô (>ò 4Ñ#ˆ˜Ø ×$Ñ$ ^Ó4ˆàÑÜ˜%¤Ô%Ø˜�Ø#'§9¡9¨UÓ#3ˆG�KÒ ñ4r*   c                 óÐ   — t         D ]]  \  }}|j                  |«      }|€Œt        | t        «      r| j	                  ||f«       Œ>t        | t
        «      r|| |<   ŒTt        d«      ‚ y)ab  Add generation match parameters into the given parameters list.

    :type parameters: list or dict
    :param parameters: Parameters list or dict.

    :type match_parameters: dict
    :param match_parameters: if*generation*match parameters to add.

    :raises: :exc:`ValueError` if ``parameters`` is not a ``list()``
             or a ``dict()``.
    Nz5`parameters` argument should be a dict() or a list().)Ú_GENERATION_MATCH_PARAMETERSr'   r©   ÚlistÚappendÚdictrN   )Ú
parametersr¬   r­   Úcamelcase_namer~   s        r+   ru   ru   7  sr   € ô +Gò Ñ&ˆ˜Ø ×$Ñ$ ^Ó4ˆàÑÜ˜*¤dÔ+Ø×!Ñ! >°5Ð"9Õ:ä˜J¬Ô-Ø-2�
˜>Ò*ô !ØKóð ñr*   c                  óî   — t        d„ | j                  «       D «       «      dkD  rM| j                  «       D �cg c]  }d|› d�‘Œ
 }}dj                  |dd «      }|d   }d|› d|› �}t	        |«      ‚yc c}w )	zéRaise ``ValueError`` exception if more than one parameter was set.

    :type error: :exc:`ValueError`
    :param error: Description of which fields were set

    :raises: :class:`~ValueError` containing the fields that were set
    c              3   ó$   K  — | ]  }|d u–— Œ
 y ­wr$   r)   )Ú.0Úargs     r+   ú	<genexpr>z._raise_if_more_than_one_set.<locals>.<genexpr>[  s   è ø€ Ò
6˜sˆ3�dŒ?Ñ
6ùs   ‚é   ú'r§   NrK   zPass at most one of z and )ÚsumÚvaluesÚkeysr«   rN   )ÚkwargsrO   Úescaped_keysÚkeys_but_lastÚlast_keyÚmsgs         r+   Ú_raise_if_more_than_one_setrÅ   S  s�   € ô Ñ
6 f§m¡m£oÔ
6Ó6¸Ò:Ø06·±³Ö>¨˜!˜D˜6 šÐ>ˆÐ>àŸ	™	 ,¨s°Ð"3Ó4ˆØ Ñ#ˆà$ ] O°5¸¸
ÐCˆä˜‹oÐð ;ùÚ>s   ¶A2c                 óZ   — t        | «      }|j                  r|j                  r| S |› d| › �S )a!  Helper to build bucket bound hostname URL.

    :type host: str
    :param host: Host name.

    :type scheme: str
    :param scheme: (Optional) Web scheme. If passed, use it
                   as a scheme in the result URL.

    :rtype: str
    :returns: A bucket bound hostname URL.
    z://)r   r:   r9   )Úhostr:   Ú	url_partss      r+   Ú_bucket_bound_hostname_urlrÉ   f  s4   € ô ˜“€IØ×Ò˜I×,Ò,ØˆàˆX�S˜˜ÐÐr*   c                 ó  — | �|�t        d«      ‚| �At        j                  | j                  | j                  | j
                  | j                  ¬«      S |�t        j                  |¬«      S t        j                  d¬«      S )a~  Convert google.api.core.Retry to google.resumable_media.RetryStrategy.

    Custom predicates are not translated.

    :type retry: google.api_core.Retry
    :param retry: (Optional) The google.api_core.Retry object to translate.

    :type num_retries: int
    :param num_retries: (Optional) The number of retries desired. This is
        supported for backwards compatibility and is mutually exclusive with
        `retry`.

    :rtype: google.resumable_media.RetryStrategy
    :returns: A RetryStrategy with all applicable attributes copied from input,
              or a RetryStrategy with max_retries set to 0 if None was input.
    z6num_retries and retry arguments are mutually exclusive)Ú	max_sleepÚmax_cumulative_retryÚinitial_delayÚ
multiplier)Úmax_retriesr   )rN   r   ÚRetryStrategyÚ_maximumÚ	_deadlineÚ_initialÚ_multiplier)rs   Únum_retriess     r+   Ú(_api_core_retry_to_resumable_media_retryrÖ   z  s|   € ð$ Ð˜[Ð4ÜÐQÓRÐRà	Ð	Ü×,Ñ,Ø—n‘nØ!&§¡ØŸ.™.Ø×(Ñ(ô	
ð 	
ð 
Ð	 Ü×,Ñ,¸ÔEÐEä×,Ñ,¸Ô;Ð;r*   c                  ó.   — dt        t        «       «      z   S )Nzgccl-invocation-id/)rª   r   r)   r*   r+   Ú_get_invocation_idrØ   œ  s   € Ø ¤3¤u£w£<Ñ/Ð/r*   c                 óN   — | › dt        «       › �}|r|d|› �z  }dd| |||xs |dœS )a§  Get the headers for a request.

    :type user_agent: str
    :param user_agent: The user-agent for requests.

    :type command: str
    :param command:
        (Optional) Information about which interface for the operation was
        used, to be included in the X-Goog-API-Client header. Please leave
        as None unless otherwise directed.

    :rtype: dict
    :returns: The headers to be used for the request.
    ú z gccl-gcs-cmd/zapplication/jsonzgzip, deflate)ÚAcceptzAccept-Encodingz
User-AgentzX-Goog-API-Clientzcontent-typezx-upload-content-type)rØ   )Ú
user_agentÚcontent_typeÚx_upload_content_typeÚcommandÚx_goog_api_clients        r+   Ú_get_default_headersrá      sR   € ð( &˜, aÔ(:Ó(<Ð'=Ð>ÐáØ˜~¨g¨YÐ7Ñ7Ðð %Ø*Ø Ø.Ø$Ø!6Ò!F¸,ñð r*   )F)i    r$   )zapplication/json; charset=UTF-8NN)9r�   r¢   ÚdatetimeÚhashlibr   r%   Úurllib.parser   r   Úuuidr   Úgoogler   Úgoogle.authr   Úgoogle.cloud.storage.constantsr	   Úgoogle.cloud.storage.retryr
   r   r(   r/   Ú_API_VERSION_OVERRIDE_ENV_VARÚ_DEFAULT_UNIVERSE_DOMAINÚ_STORAGE_HOST_TEMPLATEÚformatr1   r0   r.   Ú_API_VERSIONr¨   r°   Ú_NUM_RETRIES_MESSAGEÚnowÚ_NOWÚtimezoneÚutcÚ_UTCr,   r2   r4   rA   rE   rI   rP   ÚobjectrR   r—   rŸ   r¥   rv   ru   rÅ   rÉ   rÖ   rØ   rá   r)   r*   r+   ú<module>rö      s>  ðñó
 Û Ý Û 	Ý !Ý #Ý å "Ý (Ý ;Ý 4Ý Pð 3Ð Ø >à!8Ð Ø Oà 6Ð Ø Oà+Ð à4Ð à3×:Ñ:Ø,ð ;ó Ð ð €àˆr�y‰yÐ6¸Ó=€Ø -ðÐ ð	 Ð ð ð ð ×Ñ×Ñ€Ø×Ñ×Ñ€ò:òòóòDòòô$[+�Vô [+ò|
&ó6ò**ò 4ò$ò8ó& ó(<òD0ð 3ØØô	 r*   