
    Ѯh|                         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	  G d de
      Z G d	 d
e
      Z G d de      Z G d de      Z G d de      Zy)z%Manage access to objects and buckets.    ) _add_generation_match_parameters)create_trace_span)_DEFAULT_TIMEOUT)DEFAULT_RETRY))DEFAULT_RETRY_IF_METAGENERATION_SPECIFIEDc                   f    e Zd ZdZdZdZdZddZd Zd Z	d	 Z
d
 Zd Zd Zd Zd Zd Zd Zd Zy)
_ACLEntitya  Class representing a set of roles for an entity.

    This is a helper class that you likely won't ever construct
    outside of using the factor methods on the :class:`ACL` object.

    :type entity_type: str
    :param entity_type: The type of entity (ie, 'group' or 'user').

    :type identifier: str
    :param identifier: (Optional) The ID or e-mail of the entity. For the special
                       entity types (like 'allUsers').
    READERWRITEROWNERNc                 @    || _         t        g       | _        || _        y N)
identifiersetrolestype)selfentity_typer   s      j/home/www/academy-backend.kofcorporation.com/venv/lib/python3.12/site-packages/google/cloud/storage/acl.py__init__z_ACLEntity.__init__*   s    $W
	    c                 h    | j                   st        | j                        S dj                  |       S )Nz{acl.type}-{acl.identifier})acl)r   strr   formatr   s    r   __str__z_ACLEntity.__str__/   s+    tyy>!077D7AAr   c                 F    d|  ddj                  | j                         dS )Nz<ACL Entity: z (z, z)>)joinr   r   s    r   __repr__z_ACLEntity.__repr__5   s%    tfBtyy'<&=R@@r   c                     | j                   S )zGet the list of roles permitted by this entity.

        :rtype: list of strings
        :returns: The list of roles associated with this entity.
        )r   r   s    r   	get_rolesz_ACLEntity.get_roles8   s     zzr   c                 :    | j                   j                  |       y)zoAdd a role to the entity.

        :type role: str
        :param role: The role to add to the entity.
        N)r   addr   roles     r   grantz_ACLEntity.grant@   s     	

tr   c                 X    || j                   v r| j                   j                  |       yy)zyRemove a role from the entity.

        :type role: str
        :param role: The role to remove from the entity.
        N)r   remover%   s     r   revokez_ACLEntity.revokeH   s'     4::JJd# r   c                 B    | j                  t        j                         y)z(Grant read access to the current entity.N)r'   r	   READER_ROLEr   s    r   
grant_readz_ACLEntity.grant_readQ       

:))*r   c                 B    | j                  t        j                         y)z)Grant write access to the current entity.N)r'   r	   WRITER_ROLEr   s    r   grant_writez_ACLEntity.grant_writeU   r.   r   c                 B    | j                  t        j                         y)z)Grant owner access to the current entity.N)r'   r	   
OWNER_ROLEr   s    r   grant_ownerz_ACLEntity.grant_ownerY   s    

:(()r   c                 B    | j                  t        j                         y)z+Revoke read access from the current entity.N)r*   r	   r,   r   s    r   revoke_readz_ACLEntity.revoke_read]       J**+r   c                 B    | j                  t        j                         y)z,Revoke write access from the current entity.N)r*   r	   r0   r   s    r   revoke_writez_ACLEntity.revoke_writea   r7   r   c                 B    | j                  t        j                         y)z,Revoke owner access from the current entity.N)r*   r	   r3   r   s    r   revoke_ownerz_ACLEntity.revoke_ownere   s    J))*r   r   )__name__
__module____qualname____doc__r,   r0   r3   r   r   r    r"   r'   r*   r-   r1   r4   r6   r9   r;    r   r   r	   r	      sV     KKJ 
BA$++*,,+r   r	   c                   >   e Zd ZdZdZdZdddddd	d
Z eg d      Z	 dZ	dZ
dZdZd ZefdZed        Zd Zd Zd Zd Zd%dZd Zd%dZd Zd Zd Zd Zd Zd Zed        Z d Z!dee"fd Z#ddddee$fd!Z%ddddddee$fd"Z&dddddee$fd#Z'dddddee$fd$Z(y)&ACLz7Container class representing a list of access controls.r   predefinedAclprojectPrivate
publicReadpublicReadWriteauthenticatedReadbucketOwnerReadbucketOwnerFullControl)zproject-privatezpublic-readzpublic-read-writezauthenticated-readzbucket-owner-readzbucket-owner-full-control)privaterD   rE   rF   rG   rH   rI   FNc                     i | _         y r   )entitiesr   s    r   r   zACL.__init__   s	    r   c                 B    | j                   s| j                  |       yy)zLoad if not already loaded.

        :type timeout: float or tuple
        :param timeout:
            (Optional) The amount of time, in seconds, to wait
            for the server response.  See: :ref:`configuring_timeouts`
        )timeoutN)loadedreload)r   rN   s     r   _ensure_loadedzACL._ensure_loaded   s     {{KKK( r   c                 z    | j                   j                  ||      }|r|| j                  vrt        d|       |S )a:  Ensures predefined is in list of predefined json values

        :type predefined: str
        :param predefined: name of a predefined acl

        :type predefined: str
        :param predefined: validated JSON name of predefined acl

        :raises: :exc: `ValueError`: If predefined is not a valid acl
        zInvalid predefined ACL: )PREDEFINED_XML_ACLSgetPREDEFINED_JSON_ACLS
ValueError)cls
predefineds     r   validate_predefinedzACL.validate_predefined   sE     ,,00ZH
*C,D,DD7
|DEEr   c                 F    | j                   j                          d| _        y)z@Remove all entities from the ACL, and clear the ``loaded`` flag.FN)rL   clearrO   r   s    r   resetz	ACL.reset   s    r   c              #      K   | j                          | j                  j                         D ]*  }|j                         D ]  }|st	        |      |d  , y w)N)entityr&   )rQ   rL   valuesr"   r   )r   r^   r&   s      r   __iter__zACL.__iter__   s\     mm**, 	@F((* @%([$??@	@s   AAAc                 (   |d   }|d   }|dk(  r| j                         }nB|dk(  r| j                         }n,d|v r(|j                  dd      \  }}| j                  ||      }t	        |t
              st        d|       |j                  |       |S )	a  Build an _ACLEntity object from a dictionary of data.

        An entity is a mutable object that represents a list of roles
        belonging to either a user or group or the special types for all
        users and all authenticated users.

        :type entity_dict: dict
        :param entity_dict: Dictionary full of data from an ACL lookup.

        :rtype: :class:`_ACLEntity`
        :returns: An Entity constructed from the dictionary.
        r^   r&   allUsersallAuthenticatedUsers-   r   r   zInvalid dictionary: )allall_authenticatedsplitr^   
isinstancer	   rV   r'   )r   entity_dictr^   r&   r   r   s         r   entity_from_dictzACL.entity_from_dict   s     X&6"ZXXZF..++-FF]&,ll3&:#K[[[Z[PF&*-3K=ABBTr   c                 P    | j                          t        |      | j                  v S )a  Returns whether or not this ACL has any entries for an entity.

        :type entity: :class:`_ACLEntity`
        :param entity: The entity to check for existence in this ACL.

        :rtype: bool
        :returns: True of the entity exists in the ACL.
        )rQ   r   rL   r   r^   s     r   
has_entityzACL.has_entity   s#     	6{dmm++r   c                 l    | j                          | j                  j                  t        |      |      S )a  Gets an entity object from the ACL.

        :type entity: :class:`_ACLEntity` or string
        :param entity: The entity to get lookup in the ACL.

        :type default: anything
        :param default: This value will be returned if the entity
                        doesn't exist.

        :rtype: :class:`_ACLEntity`
        :returns: The corresponding entity or the value provided
                  to ``default``.
        )rQ   rL   rT   r   )r   r^   defaults      r   
get_entityzACL.get_entity   s+     	}}  Vg66r   c                 T    | j                          || j                  t        |      <   y)zAdd an entity to the ACL.

        :type entity: :class:`_ACLEntity`
        :param entity: The entity to add to this ACL.
        N)rQ   rL   r   rn   s     r   
add_entityzACL.add_entity   s"     	%+c&k"r   c                     t        ||      }| j                  |      r| j                  |      }|S | j                  |       |S )a  Factory method for creating an Entity.

        If an entity with the same type and identifier already exists,
        this will return a reference to that entity.  If not, it will
        create a new one and add it to the list of known entities for
        this ACL.

        :type entity_type: str
        :param entity_type: The type of entity to create
                            (ie, ``user``, ``group``, etc)

        :type identifier: str
        :param identifier: The ID of the entity (if applicable).
                           This can be either an ID or an e-mail address.

        :rtype: :class:`_ACLEntity`
        :returns: A new Entity or a reference to an existing identical entity.
        rf   )r	   ro   rr   rt   )r   r   r   r^   s       r   r^   z
ACL.entity  sD    & 
K??6"__V,F  OOF#r   c                 (    | j                  d|      S )zFactory method for a user Entity.

        :type identifier: str
        :param identifier: An id or e-mail for this particular user.

        :rtype: :class:`_ACLEntity`
        :returns: An Entity corresponding to this user.
        userr   r^   r   r   s     r   rw   zACL.user  s     {{6j{99r   c                 (    | j                  d|      S )zFactory method for a group Entity.

        :type identifier: str
        :param identifier: An id or e-mail for this particular group.

        :rtype: :class:`_ACLEntity`
        :returns: An Entity corresponding to this group.
        grouprx   ry   rz   s     r   r|   z	ACL.group(  s     {{7z{::r   c                 (    | j                  d|      S )zFactory method for a domain Entity.

        :type domain: str
        :param domain: The domain for this entity.

        :rtype: :class:`_ACLEntity`
        :returns: An entity corresponding to this domain.
        domainrx   ry   )r   r~   s     r   r~   z
ACL.domain3  s     {{8{77r   c                 $    | j                  d      S )zFactory method for an Entity representing all users.

        :rtype: :class:`_ACLEntity`
        :returns: An entity representing all users.
        rb   ry   r   s    r   rg   zACL.all>  s     {{:&&r   c                 $    | j                  d      S )zFactory method for an Entity representing all authenticated users.

        :rtype: :class:`_ACLEntity`
        :returns: An entity representing all authenticated users.
        rc   ry   r   s    r   rh   zACL.all_authenticatedF  s     {{233r   c                 h    | j                          t        | j                  j                               S )zGet a list of all Entity objects.

        :rtype: list of :class:`_ACLEntity` objects
        :returns: A list of all Entity objects.
        )rQ   listrL   r_   r   s    r   get_entitieszACL.get_entitiesN  s(     	DMM((*++r   c                     t         )z&Abstract getter for the object client.)NotImplementedErrorr   s    r   clientz
ACL.clientW  s
     "!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 ACL.

        :rtype: :class:`google.cloud.storage.client.Client`
        :returns: The client passed in or the currently bound client.
        )r   )r   r   s     r   _require_clientzACL._require_client\  s     >[[Fr   c                    t        d      5  | j                  }| j                  |      }i }| j                  | j                  |d<   | j                  j                          |j                  ||||      }d| _        |j                  dd      D ]"  }| j                  | j                  |             $ 	 ddd       y# 1 sw Y   yxY w)	a  Reload the ACL data 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: (Optional) The client to use.  If not passed, falls back
                       to the ``client`` stored on the ACL's parent.
        :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: :class:`~google.api_core.retry.Retry`
        :param retry:
            (Optional) How to retry the RPC. See: :ref:`configuring_retries`
        zStorage.ACL.reloadnameNuserProjectquery_paramsrN   retryTitemsr@   )r   reload_pathr   user_projectrL   r[   _get_resourcerO   rT   rt   rl   )r   r   rN   r   pathr   foundentrys           r   rP   z
ACL.reloadk  s    $ $89 	>##D))&1FL  ,.2.?.?]+MM!(()	 ) E DK7B/ > 5 5e <=>%	> 	> 	>s   B(B??Cc
                    | j                  |      }ddi}
|g }||
| j                  <   | j                  | j                  |
d<   t        |
||||       | j                  }|j                  || j                  t        |      i|
||	      }| j                  j                          |j                  | j                  d      D ]"  }| j                  | j                  |             $ d| _        y)	a  Helper for :meth:`save` and :meth:`save_predefined`.

        :type acl: :class:`google.cloud.storage.acl.ACL`, or a compatible list.
        :param acl: The ACL object to save.  If left blank, this will save
                    current entries.

        :type predefined: str
        :param predefined: An identifier for a predefined ACL.  Must be one of the
            keys in :attr:`PREDEFINED_JSON_ACLS` If passed, `acl` must be None.

        :type client: :class:`~google.cloud.storage.client.Client` or
                      ``NoneType``
        :param client: (Optional) The client to use.  If not passed, falls back
                       to the ``client`` stored on the ACL's parent.

        :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`
        
projectionfullNr   )if_generation_matchif_generation_not_matchif_metageneration_matchif_metageneration_not_matchr   r@   T)r   _PREDEFINED_QUERY_PARAMr   r   	save_path_patch_resource_URL_PATH_ELEMr   rL   r[   rT   rt   rl   rO   )r   r   rX   r   r   r   r   r   rN   r   r   r   resultr   s                 r   _savez	ACL._save  s    h %%f-$f-!C9CL556(*.*;*;L'( 3$;$;(C	
 ~~''  $s),% ( 
 	ZZ 3 3R8 	:EOOD11%89	: r   c	                     t        d      5  || }|j                  }	nd}	|	r| j                  |d|||||||	       ddd       y# 1 sw Y   yxY w)a!  Save this ACL for the current bucket.

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

        :type acl: :class:`google.cloud.storage.acl.ACL`, or a compatible list.
        :param acl: The ACL object to save.  If left blank, this will save
                    current entries.

        :type client: :class:`~google.cloud.storage.client.Client` or
                      ``NoneType``
        :param client: (Optional) The client to use.  If not passed, falls back
                       to the ``client`` stored on the ACL's parent.

        :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`
        zStorage.ACL.saver   NTr   r   r   r   rN   r   )r   rO   r   )
r   r   r   r   r   r   r   rN   r   save_to_backends
             r   savezACL.save  sj    b $67 	{"%**"&

(;,C,C0K#  
	 	 	s   0AAc	                     t        d      5  | j                  |      }| j                  d||||||||	       ddd       y# 1 sw Y   yxY w)a  Save this ACL for the current bucket using a predefined ACL.

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

        :type predefined: str
        :param predefined: An identifier for a predefined ACL.  Must be one
                           of the keys in :attr:`PREDEFINED_JSON_ACLS`
                           or :attr:`PREDEFINED_XML_ACLS` (which will be
                           aliased to the corresponding JSON name).
                           If passed, `acl` must be None.

        :type client: :class:`~google.cloud.storage.client.Client` or
                      ``NoneType``
        :param client: (Optional) The client to use.  If not passed, falls back
                       to the ``client`` stored on the ACL's parent.

        :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`
        zStorage.ACL.savePredefinedr   Nr   )r   rY   r   )	r   rX   r   r   r   r   r   rN   r   s	            r   save_predefinedzACL.save_predefined.  s_    h $@A 	11*=JJJ$7(?(?,G  
	 	 	s   ,AAc                 x    t        d      5  | j                  g |||||||       ddd       y# 1 sw Y   yxY w)I  Remove all ACL entries.

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

        Note that this won't actually remove *ALL* the rules, but it
        will remove all the non-default rules.  In short, you'll still
        have access to a bucket that you created even after you clear
        ACL rules with this method.

        :type client: :class:`~google.cloud.storage.client.Client` or
                      ``NoneType``
        :param client: (Optional) The client to use.  If not passed, falls back
                       to the ``client`` stored on the ACL's parent.

        :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`
        zStorage.ACL.clearr   r   r   r   r   r   rN   r   N)r   r   )r   r   r   r   r   r   rN   r   s           r   r[   z	ACL.clearp  sL    b $78 
	II$7(?(?,G  	
	 
	 
	s   09r   ))r<   r=   r>   r?   r   r   rS   	frozensetrU   rO   r   r   r   r   r   rQ   classmethodrY   r\   r`   rl   ro   rr   rt   r^   rw   r|   r~   rg   rh   r   propertyr   r   r   rP   r   r   r   r   r[   r@   r   r   rB   rB   j   s`   AN- ,#.1.%= %	

 F KIL &6 	)   
@@
,7",4	:	;	8'4, " " !*:- %>X ! $ $$( 7Ur   $ $$( 7CP   $ $$( 7@H   $ $$( 7;r   rB   c                   b     e Zd ZdZ fdZed        Zed        Zed        Zed        Z	 xZ
S )	BucketACLzAn ACL specifically for a bucket.

    :type bucket: :class:`google.cloud.storage.bucket.Bucket`
    :param bucket: The bucket to which this ACL relates.
    c                 8    t         t        |           || _        y r   )superr   r   bucket)r   r   	__class__s     r   r   zBucketACL.__init__  s    i')r   c                 .    | j                   j                  S )z&The client bound to this ACL's bucket.)r   r   r   s    r   r   zBucketACL.client  s     {{!!!r   c                 L    | j                   j                   d| j                   S )3Compute the path for GET API requests for this ACL./)r   r   r   r   s    r   r   zBucketACL.reload_path  s'     ++""#1T%8%8$9::r   c                 .    | j                   j                  S z5Compute the path for PATCH API requests for this ACL.)r   r   r   s    r   r   zBucketACL.save_path  s     {{r   c                 .    | j                   j                  S z?Compute the user project charged for API requests for this ACL.)r   r   r   s    r   r   zBucketACL.user_project  s     {{'''r   )r<   r=   r>   r?   r   r   r   r   r   r   __classcell__r   s   @r   r   r     s]     " " ; ;     ( (r   r   c                       e Zd ZdZdZdZy)DefaultObjectACLz9A class representing the default object ACL for a bucket.defaultObjectAclpredefinedDefaultObjectAclN)r<   r=   r>   r?   r   r   r@   r   r   r   r     s    C'N:r   r   c                        e Zd ZdZ fdZed        Zed        Zed        Zed        Z	dddddde
ef fd	Zddddde
ef fd		Zddddde
ef fd
	Z xZS )	ObjectACLzAn ACL specifically for a Cloud Storage object / blob.

    :type blob: :class:`google.cloud.storage.blob.Blob`
    :param blob: The blob that this ACL corresponds to.
    c                 8    t         t        |           || _        y r   )r   r   r   blob)r   r   r   s     r   r   zObjectACL.__init__  s    i')	r   c                 .    | j                   j                  S )z$The client bound to this ACL's blob.)r   r   r   s    r   r   zObjectACL.client  s     yyr   c                 4    | j                   j                   dS )r   z/aclr   r   r   s    r   r   zObjectACL.reload_path  s     ))..!&&r   c                 .    | j                   j                  S r   r   r   s    r   r   zObjectACL.save_path  s     yy~~r   c                 .    | j                   j                  S r   )r   r   r   s    r   r   zObjectACL.user_project  s     yy%%%r   Nc	           
      4    t         	|   ||||||||       y)a!  Save this ACL for the current object.

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

        :type acl: :class:`google.cloud.storage.acl.ACL`, or a compatible list.
        :param acl: The ACL object to save.  If left blank, this will save
                    current entries.

        :type client: :class:`~google.cloud.storage.client.Client` or
                      ``NoneType``
        :param client: (Optional) The client to use.  If not passed, falls back
                       to the ``client`` stored on the ACL's parent.

        :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`
        )r   r   r   r   r   r   rN   r   N)r   r   )
r   r   r   r   r   r   r   rN   r   r   s
            r   r   zObjectACL.save  s/    b 	 3$;$;(C 	 		
r   c	           
      4    t         	|   ||||||||       y)a  Save this ACL for the current object using a predefined ACL.

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

        :type predefined: str
        :param predefined: An identifier for a predefined ACL.  Must be one
                           of the keys in :attr:`PREDEFINED_JSON_ACLS`
                           or :attr:`PREDEFINED_XML_ACLS` (which will be
                           aliased to the corresponding JSON name).
                           If passed, `acl` must be None.

        :type client: :class:`~google.cloud.storage.client.Client` or
                      ``NoneType``
        :param client: (Optional) The client to use.  If not passed, falls back
                       to the ``client`` stored on the ACL's parent.

        :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`
        )rX   r   r   r   r   r   rN   r   N)r   r   )
r   rX   r   r   r   r   r   rN   r   r   s
            r   r   zObjectACL.save_predefined0  s0    h 	! 3$;$;(C 	  		
r   c           	      2    t         |   |||||||       y)r   r   N)r   r[   )	r   r   r   r   r   r   rN   r   r   s	           r   r[   zObjectACL.clearo  s,    b 	 3$;$;(C 	 	
r   )r<   r=   r>   r?   r   r   r   r   r   r   r   r   r   r   r[   r   r   s   @r   r   r     s         ' '   & &   $ $$( :
~   $ $$( =
B   $ $$( 9
 9
r   r   N)r?   google.cloud.storage._helpersr   +google.cloud.storage._opentelemetry_tracingr   google.cloud.storage.constantsr   google.cloud.storage.retryr   r   objectr	   rB   r   r   r   r@   r   r   <module>r      s^    , J I ; 4 PO+ O+dA	& A	H( (@;y ;S
 S
r   