Ë
    daºi‡  ã                   ó<   — d dl mZ  G d„ de«      Z G d„ de«      Zy)é   )ÚBitbucketCloudBasec                   óJ   ‡ — e Zd Zˆ fd„Zd„ Z	 	 	 	 	 	 dd„Zdd„Zˆ fd„Zˆ xZS )ÚBranchRestrictionsc                 ó4   •— t        t        | �
  |g|¢­i |¤Ž y ©N)Úsuperr   Ú__init__)ÚselfÚurlÚargsÚkwargsÚ	__class__s       €úq/var/www/timesheet/venv/lib/python3.12/site-packages/atlassian/bitbucket/cloud/repositories/branchRestrictions.pyr	   zBranchRestrictions.__init__   s   ø€ ÜÔ  $Ñ0°ÐF°tÒF¸vÓFó    c                 ó.   — t        |fi | j                  ¤ŽS r   )ÚBranchRestrictionÚ_new_session_args)r
   Údatas     r   Ú__get_objectzBranchRestrictions.__get_object
   s   € Ü  Ñ@¨×)?Ñ)?Ñ@Ð@r   c                 óž   — |dk(  rd}|||dœ}|dk(  r||d<   |�||d<   |�||d<   |�||d<   | j                  | j                  d|¬	«      «      S )
a)  
        Add a new branch restriction.

        :param value:
        :param kind: string: One of require_tasks_to_be_completed, force, restrict_merges,
                             enforce_merge_checks, require_approvals_to_merge, delete,
                             require_all_dependencies_merged, push, require_passing_builds_to_merge,
                             reset_pullrequest_approvals_on_change, require_default_reviewer_approvals_to_merge
        :param branch_match_kind: string: branching_model or glob, if branching_model use
                                          param branch_type otherwise branch_pattern.
        :param branch_pattern: string: A glob specifying the branch this restriction should
                                       apply to (supports * as wildcard).
        :param branch_type: string: The branch type specifies the branches this restriction
                                    should apply to. One of: feature, bugfix, release, hotfix, development, production.
        :param users: List: List of user objects that are excluded from the restriction.
                            Minimal: {"username": "<username>"}
        :param groups: List: List of group objects that are excluded from the restriction.
                             Minimal: {"owner": {"username": "<teamname>"}, "slug": "<groupslug>"}

        :return: The created BranchRestriction object

        API docs:
        https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/branch-restrictions#post
        Úbranching_modelÚ )ÚkindÚbranch_match_kindÚpatternÚbranch_typeNÚusersÚgroupsÚvalue©r   )Ú_BranchRestrictions__get_objectÚpost)	r
   r   r   Úbranch_patternr   r   r   r   r   s	            r   ÚcreatezBranchRestrictions.create   s…   € ðD Ð 1Ò1ØˆNð Ø!2Ø%ñ
ˆð Ð 1Ò1Ø"-ˆD�ÑàÐØ!ˆD�‰MàÐØ#ˆD�‰NàÐØ!ˆD�‰Mà× Ñ  §¡¨4°d Ó!;Ó<Ð<r   c              #   óž   K  — i }|�||d<   |�||d<   |�||d<   |�||d<   | j                  d|¬«      D ]  }| j                  |«      –— Œ y­w)a8  
        Returns the list of branch restrictions in this repository.

        :param kind: string: Branch restrictions of this type
        :param pattern: string: Branch restrictions applied to branches of this pattern
        :param q: string: Query string to narrow down the response.
                          See https://developer.atlassian.com/bitbucket/api/2/reference/meta/filtering for details.
        :param sort: string: Name of a response property to sort results.
                             See https://developer.atlassian.com/bitbucket/api/2/reference/meta/filtering for details.

        :return: A generator for the BranchRestriction objects

        API docs: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/branch-restrictions#get
        Nr   r   ÚsortÚq)Úparams)Ú
_get_pagedr!   )r
   r   r   r'   r&   r(   Úbranch_restrictions          r   ÚeachzBranchRestrictions.eachF   s}   è ø€ ð ˆØÐØ!ˆF�6‰NØÐØ 'ˆF�9ÑØÐØ!ˆF�6‰NØˆ=ØˆF�3‰KØ"&§/¡/°$¸v /Ó"Fò 	8ÐØ×#Ñ#Ð$6Ó7Ó7ð	8ð 	ùs   ‚AAc                 óH   •— | j                  t        t        | �  |«      «      S )ai  
        Returns the branch restriction with the ID in this repository.

        :param id: string: The requested issue ID

        :return: The requested BranchRestriction objects

        API docs:
        https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/branch-restrictions/%7Bid%7D#get
        )r!   r   r   Úget)r
   Úidr   s     €r   r-   zBranchRestrictions.getc   s#   ø€ ð × Ñ ¤Ô'9¸4Ñ!DÀRÓ!HÓIÐIr   )ÚglobÚ*NNNN)NNNN)	Ú__name__Ú
__module__Ú__qualname__r	   r!   r$   r+   r-   Ú__classcell__©r   s   @r   r   r      s:   ø„ ôGòAð !ØØØØØó7=ór÷:Jð Jr   r   c                   ó®   ‡ — e Zd Zˆ fd„Zd„ Zˆ fd„Zed„ «       Zed„ «       Zed„ «       Z	ed„ «       Z
ed„ «       Zed	„ «       Zed
„ «       Zed„ «       Zˆ xZS )r   c                 ó:   •— t        t        | �
  d g|¢­|ddœ|¤Ž y )NÚbranchrestriction)r   Úexpected_type)r   r   r	   )r
   r   r   r   r   s       €r   r	   zBranchRestriction.__init__r   s&   ø€ ÜÔ Ñ/°Ðt°tÑtÀ$ÐViÑtÐmsÓtr   c                 óF   — | j                  | j                  d|¬«      «      S )a~  
        Update the branch restriction properties. Fields not present in the request body are ignored.

        :param kwargs: dict: The data to update.

        :return: The updated branch restriction

        API docs:
        https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/branch-restrictions/%7Bid%7D#put
        Nr    )Ú_update_dataÚput)r
   r   s     r   ÚupdatezBranchRestriction.updateu   s"   € ð × Ñ  §¡¨$°V Ó!<Ó=Ð=r   c                 ó*   •— t         t        | �  d«      S )a	  
        Delete the branch restriction.

        :return: The response on success

        API docs:
        https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/branch-restrictions/%7Bid%7D#delete
        N)r   r   Údelete)r
   r   s    €r   r?   zBranchRestriction.delete‚   s   ø€ ô Ô&¨Ñ4°TÓ:Ð:r   c                 ó6   — t        | j                  d«      «      S )zThe branch restriction idr.   )ÚstrÚget_data©r
   s    r   r.   zBranchRestriction.id�   s   € ô �4—=‘= Ó&Ó'Ð'r   c                 ó$   — | j                  d«      S )zThe branch restriction kindr   ©rB   rC   s    r   r   zBranchRestriction.kind’   s   € ð �}‰}˜VÓ$Ð$r   c                 ó$   — | j                  d«      S )z!The branch restriction match kindr   rE   rC   s    r   r   z#BranchRestriction.branch_match_kind—   s   € ð �}‰}Ð0Ó1Ð1r   c                 ó$   — | j                  d«      S )zThe branch restriction typer   rE   rC   s    r   r   zBranchRestriction.branch_typeœ   s   € ð �}‰}˜]Ó+Ð+r   c                 ó$   — | j                  d«      S )zThe branch restriction patternr   rE   rC   s    r   r   zBranchRestriction.pattern¡   s   € ð �}‰}˜YÓ'Ð'r   c                 ó$   — | j                  d«      S )zThe branch restriction usersr   rE   rC   s    r   r   zBranchRestriction.users¦   ó   € ð �}‰}˜WÓ%Ð%r   c                 ó$   — | j                  d«      S )zThe branch restriction groupsr   rE   rC   s    r   r   zBranchRestriction.groups«   s   € ð �}‰}˜XÓ&Ð&r   c                 ó$   — | j                  d«      S )zThe branch restriction valuer   rE   rC   s    r   r   zBranchRestriction.value°   rJ   r   )r1   r2   r3   r	   r=   r?   Úpropertyr.   r   r   r   r   r   r   r   r4   r5   s   @r   r   r   q   s³   ø„ ôuò>ô	;ð ñ(ó ð(ð ñ%ó ð%ð ñ2ó ð2ð ñ,ó ð,ð ñ(ó ð(ð ñ&ó ð&ð ñ'ó ð'ð ñ&ó ô&r   r   N)Úbaser   r   r   © r   r   ú<module>rP      s+   ðõ &ôhJÐ+ô hJôVB&Ð*õ B&r   