Ë
    PU hqF ã                  óŠ  — d Z ddlmZ ddlZddlZddlZddlZddlZddlZ	ddl
Z
ddlZddlZddlZddlZddlZddlZddlmZ ddlmZ ddlmZmZ ddlmZ ddlmZ dd	lmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z& dd
l'm(Z(m)Z)m*Z* ddl+Z+ddl,m-Z. ddl/m0Z0 ddl+m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m7Z7 ddl8m9Z9 ddl:m;Z; ddl<m=Z=m>Z> ddl?m@Z@mAZA ddlBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmSZSmTZTmUZUmVZVmWZWmXZXmYZYmZZZm[Z[m\Z\m]Z]m^Z^m_Z_m`Z`maZambZbmcZcmdZdmeZemfZfmgZgmhZhmiZimjZjmkZkmlZl ddlmmnZnmoZompZp 	 ddlqmrZr  e	jè                  d«      Zueují                   e	jî                  «       «       d*d„Zxd*d„Zyd+d„Zz	 d,	 	 	 	 	 d-d„Z{ e$dde`¬«      Z| G d „ d!e}ee|   «      Z~ G d"„ d#«      Z G d$„ d%e3«      Z€ G d&„ d'e3«      Z� G d(„ d)«      Z‚y# es$ r Y Œ•w xY w).aA  Jira Client module.

This module implements a friendly (well, friendlier) interface between the raw JSON
responses from Jira and the Resource/dict abstractions provided by this library. Users
will construct a JIRA object as described below. Full API documentation can be found
at: https://jira.readthedocs.io/en/latest/.
é    )ÚannotationsN)ÚOrderedDict)ÚIterable)Ú	lru_cacheÚwraps)ÚBufferedReader)ÚNumber)
ÚAnyÚCallableÚGenericÚIteratorÚListÚLiteralÚSupportsIndexÚTypeVarÚno_type_checkÚoverload)Úparse_qsÚquoteÚurlparse)Úparse)ÚImage)ÚResponse)ÚAuthBase)ÚCaseInsensitiveDict)Úget_netrc_auth)ÚMultipartEncoder)Ú__version__)Ú	JIRAErrorÚNotJIRAInstanceError)ÚPrepareRequestForRetryÚResilientSession)*ÚAgileResourceÚ
AttachmentÚBoardÚCommentÚ	ComponentÚCustomerÚCustomFieldOptionÚ	DashboardÚDashboardGadgetÚDashboardItemPropertyÚDashboardItemPropertyKeyÚFieldÚFilterÚGroupÚIssueÚ	IssueLinkÚIssueLinkTypeÚIssuePropertyÚIssueSecurityLevelSchemeÚ	IssueTypeÚIssueTypeSchemeÚNotificationSchemeÚPermissionSchemeÚPriorityÚPrioritySchemeÚProjectÚ
RemoteLinkÚRequestTypeÚ
ResolutionÚResourceÚRoleÚSecurityLevelÚServiceDeskÚSprintÚStatusÚStatusCategoryÚUserÚVersionÚVotesÚWatchersÚWorkflowSchemeÚWorklog)Ú
json_loadsÚremove_empty_attributesÚthreaded_requests)ÚJWTAuthÚjirac                ó(   ‡ — t        ‰ «       ˆ fd„}|S )aS  A convenience decorator to check if the Jira instance is cloud.

    Checks if the client instance is talking to Cloud Jira. If it is, return
    the result of the called client method. If not, return None and log a
    warning.

    Args:
      client_method: The method that is being called by the client.

    Returns:
      Either the result of the wrapped function or None.

    Raises:
      JIRAError: In the case the error is not an HTTP error with a status code.
      NotJIRAInstanceError: In the case that the first argument to this method
       is not a `client.JIRA` instance.
    c                 ó¾   •— t        d„ | D «       «      }t        |t        «      st        |«      ‚|j                  r ‰| i |¤ŽS |j
                  j                  d«       y )Nc              3  ó    K  — | ]  }|–— Œ y ­w©N© ©Ú.0Úargs     úC/var/www/timesheet/venv/lib/python3.12/site-packages/jira/client.pyú	<genexpr>z4cloud_api.<locals>.check_if_cloud.<locals>.<genexpr>†   ó   è ø€ Ò, œÑ,ùó   ‚zIThis functionality is not available on Jira Data Center (Server) version.)ÚnextÚ
isinstanceÚJIRAr    Ú	_is_cloudÚlogÚwarning)ÚargsÚkwargsÚinstanceÚclient_methods      €rZ   Úcheck_if_cloudz!cloud_api.<locals>.check_if_cloudƒ   s]   ø€ ô Ñ, tÔ,Ó,ˆÜ˜(¤DÔ)Ü& xÓ0Ð0à×ÒÙ  $Ð1¨&Ñ1Ð1à�‰×ÑØWô	
ð ó    ©r   )rg   rh   s   ` rZ   Ú	cloud_apirk   o   s   ø€ ô$ 
ˆ-Ôôð Ðri   c                ó(   ‡ — t        ‰ «       ˆ fd„}|S )aK  A convenience decorator to inform if a client method is experimental.

    Indicates the path covered by the client method is experimental. If the path
    disappears or the method becomes disallowed, this logs an error and returns
    None. If another kind of exception is raised, this reraises.

    Raises:
      JIRAError: In the case the error is not an HTTP error with a status code.
      NotJIRAInstanceError: In the case that the first argument to this method is
       is not a `client.JIRA` instance.

    Returns:
      Either the result of the wrapped function or None.
    c                 óB  •— t        d„ | D «       «      }t        |t        «      st        |«      ‚	  ‰| i |¤ŽS # t        $ r]}t        |dd «      }|�H|j                  dv r:|j                  j                  d|j                  › d|j                  › �«       Y d }~y ‚ d }~ww xY w)Nc              3  ó    K  — | ]  }|–— Œ y ­wrU   rV   rW   s     rZ   r[   zFexperimental_atlassian_api.<locals>.is_experimental.<locals>.<genexpr>§   r\   r]   Úresponse)i•  é”  zFunctionality at path z# is/was experimental. Status Code: )
r^   r_   r`   r    r   ÚgetattrÚstatus_coderb   rc   Úurl)rd   re   rf   Úero   rg   s        €rZ   Úis_experimentalz3experimental_atlassian_api.<locals>.is_experimental¦   s©   ø€ ÜÑ, tÔ,Ó,ˆÜ˜(¤DÔ)Ü& xÓ0Ð0ð	Ù  $Ð1¨&Ñ1Ð1øÜò 		Ü˜q *¨dÓ3ˆHØÐ#¨×(<Ñ(<À
Ñ(JØ—‘×$Ñ$Ø,¨X¯\©\¨Nð ;$Ø$,×$8Ñ$8Ð#9ð;ôô àûð		ús   °8 ¸	BÁABÂBÂBrj   )rg   ru   s   ` rZ   Úexperimental_atlassian_apirv   •   s   ø€ ô 
ˆ-Ôôð$ Ðri   c                ó0   ‡ — t        ‰ «      dˆ fd„«       }|S )z›Decorator that converts Issue and Project resources to their keys when used as arguments.

    Args:
        func (Callable): the function to decorate
    c                 ó  •— g }| D ]q  }t        |t        t        f«      r|j                  |j                  «       Œ5t        |t
        «      r|j                  |j                  «       Œa|j                  |«       Œs  ‰|i |¤Ž}|S rU   )r_   r1   r<   ÚappendÚkeyr3   Úname)rd   re   Úarg_listrY   ÚresultÚfuncs        €rZ   Úwrapperz(translate_resource_args.<locals>.wrapperÂ   sr   ø€ àˆØò 	%ˆCÜ˜#¤¤wÐ/Ô0Ø—‘ §¡Õ(Ü˜C¤Ô/Ø—‘ §¡Õ)à—‘ Õ$ð	%ñ �xÐ* 6Ñ*ˆØˆri   )rd   r
   re   r
   Úreturnr
   rj   )r~   r   s   ` rZ   Útranslate_resource_argsr�   »   s"   ø€ ô ˆ4ƒ[ô
ó ð
ð €Nri   c                ó   — | �d| iS d|iS )NÚfieldsrV   )rƒ   Ú	fieldargss     rZ   Ú_field_workerr…   Ò   s    € ð ÐØ˜&Ð!Ð!Ø�iÐ Ð ri   ÚResourceTypeT)ÚcontravariantÚboundc                  ó|   ‡ — e Zd Z	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 dd„Zd	d„Zd
ˆ fd„Zedd„«       Zedd„«       Zd„ Zˆ xZS )Ú
ResultListc                óü   — |�t         j                  | |«       nt         j                  | «       || _        || _        || _        |�|n
t        | «      | _        |rt        |«      ng | _        | j                  | _        y)aN  Results List.

        Args:
            iterable (Iterable): [description]. Defaults to None.
            _startAt (int): Start page. Defaults to 0.
            _maxResults (int): Max results per page. Defaults to 0.
            _total (Optional[int]): Total results from query. Defaults to 0.
            _isLast (Optional[bool]): True to mark this page is the last page? (Default: ``None``).
             see `The official API docs <https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#expansion:~:text=for%20all%20operations.-,isLast,-indicates%20whether%20the>`_
        N)	ÚlistÚ__init__ÚstartAtÚ
maxResultsÚisLastÚlenÚtotalÚiterableÚcurrent)Úselfr“   Ú_startAtÚ_maxResultsÚ_totalÚ_isLasts         rZ   r�   zResultList.__init__Þ   se   € ð$ ÐÜ�M‰M˜$ Õ)ä�M‰M˜$ÔàˆŒØ%ˆŒàˆŒØ%Ð1‘V´s¸4³yˆŒ
á>F¬D°¬NÈBˆŒØ—|‘|ˆ�ri   c                ó¢   — | xj                   dz  c_         | j                   | j                  kD  rt        ‚| j                  | j                   dz
     S ©Né   )r”   r’   ÚStopIterationr“   ©r•   s    rZ   Ú__next__zResultList.__next__þ   s>   € Ø�Š˜Ñ�Ø�<‰<˜$Ÿ*™*Ò$ÜÐà—=‘= §¡°Ñ!1Ñ2Ð2ri   c                ó    •— t         ‰| �  «       S rU   )ÚsuperÚ__iter__)r•   Ú	__class__s    €rZ   r¢   zResultList.__iter__  s   ø€ Ü‰wÑÓ!Ð!ri   c                 ó   — y rU   rV   )r•   Úis     rZ   Ú__getitem__zResultList.__getitem__  s   € Ø=@ri   c                 ó   — y rU   rV   )r•   Úss     rZ   r¦   zResultList.__getitem__  s   € Ø;>ri   c                ó.   — t         j                  | |«      S rU   )rŒ   r¦   )r•   Úslice_or_indexs     rZ   r¦   zResultList.__getitem__  s   € Ü×Ñ  nÓ5Ð5ri   )Nr   r   NN)r“   r   r–   Úintr—   r«   r˜   ú
int | Noner™   úbool | Noner€   ÚNone)r€   r†   )r€   zIterator[ResourceType])r¥   r   r€   r†   )r¨   Úslicer€   úlist[ResourceType])	Ú__name__Ú
__module__Ú__qualname__r�   rŸ   r¢   r   r¦   Ú__classcell__)r£   s   @rZ   rŠ   rŠ   Ý   s�   ø„ ð "ØØØ!Ø#ð$àð$ð ð$ð ð	$ð
 ð$ð ð$ð 
ó$ó@3õ"ð Ú@ó Ø@ØÚ>ó Ø>ö6ri   rŠ   c                  ó$   — e Zd Zd„ Zd„ Zd„ Zd„ Zy)ÚQshGeneratorc                ó   — || _         y rU   )Úcontext_path)r•   r¸   s     rZ   r�   zQshGenerator.__init__  s
   € Ø(ˆÕri   c                óˆ   — | j                  |«      }t        j                  |j                  d«      «      j	                  «       S )Nzutf-8)Ú_generate_qshÚhashlibÚsha256ÚencodeÚ	hexdigest)r•   ÚreqÚqshs      rZ   Ú__call__zQshGenerator.__call__  s3   € Ø× Ñ  Ó%ˆÜ�~‰~˜cŸj™j¨Ó1Ó2×<Ñ<Ó>Ð>ri   c           
     ó   ‡— t        |j                  «      }t        | j                  «      dkD  r"|j                  t        | j                  «      d  n|j                  }t        |j                  d¬«      }|D �ci c]&  }|dj                  | j                  ||   «      «      “Œ( c}Šdj                  ˆfd„t        ‰j                  «       «      D «       «      }|j                  j                  «       › d|› d|› �}|S c c}w )Nrœ   T)Úkeep_blank_valuesú,ú&c              3  ó2   •K  — | ]  }|› d ‰|   › �–— Œ y­w)ú=NrV   )rX   rz   Újoineds     €rZ   r[   z-QshGenerator._generate_qsh.<locals>.<genexpr>-  s    øè ø€ ÒQ°C˜C˜5  &¨¡+ Ô/ÑQùs   ƒ)r   rs   r‘   r¸   Úpathr   ÚqueryÚjoinÚ_sort_and_quote_valuesÚsortedÚkeysÚmethodÚupper)	r•   r¿   Úparse_resultrÉ   Úparamsrz   rÊ   rÀ   rÈ   s	           @rZ   rº   zQshGenerator._generate_qsh  sç   ø€ Ü §¡Ó(ˆô �4×$Ñ$Ó%¨Ò)ð ×Ñœc $×"3Ñ"3Ó4Ð6Ñ7à×"Ñ"ð 	ô ˜,×,Ñ,ÀÔEˆàOUö
ØHKˆC�—‘˜$×5Ñ5°f¸S±kÓBÓCÑCò
ˆð —‘ÓQ¼6À&Ç+Á+Ã-Ó;PÔQÓQˆà—‘×!Ñ!Ó#Ð$ A d V¨1¨U¨GÐ4ˆØˆ
ùò
s   Á8+C;c                óX   — t        |«      }|D �cg c]  }t        |d¬«      ‘Œ c}S c c}w )Nú~©Úsafe)rÍ   r   )r•   ÚvaluesÚordered_valuesÚvalues       rZ   rÌ   z#QshGenerator._sort_and_quote_values2  s&   € Ü ›ˆØ4BÖC¨5”�e #Ö&ÒCÐCùÒCs   �'N)r±   r²   r³   r�   rÁ   rº   rÌ   rV   ri   rZ   r¶   r¶     s   „ ò)ò?òó(Dri   r¶   c                  ón   — e Zd ZdZ	 	 	 	 	 	 dd„Zed„ «       Zd„ Zd„ Zdd„Z	d„ Z
dd„Zdd	„Zdd
„Zdd„Zy)ÚJiraCookieAuthz½Jira Cookie Authentication.

    Allows using cookie authentication as described by `jira api docs <https://developer.atlassian.com/server/jira/platform/cookie-based-authentication/>`_
    c                óJ   — || _         || _        || _        d| _        d| _        y)a  Cookie Based Authentication.

        Args:
            session (ResilientSession): The Session object to communicate with the API.
            session_api_url (str): The session api url to use.
            auth (Tuple[str, str]): The username, password tuple.
        r   rœ   N)Ú_sessionÚ_session_api_urlÚ_JiraCookieAuth__authÚ_retry_counter_401Ú_max_allowed_401_retries)r•   ÚsessionÚsession_api_urlÚauths       rZ   r�   zJiraCookieAuth.__init__=  s*   € ð  ˆŒØ /ˆÔØˆŒØ"#ˆÔØ()ˆÕ%ri   c                ó.   — | j                   j                  S rU   )rÝ   Úcookiesrž   s    rZ   ræ   zJiraCookieAuth.cookiesM  s   € à�}‰}×$Ñ$Ð$ri   c                ó.   — | xj                   dz  c_         y r›   ©rà   rž   s    rZ   Ú_increment_401_retry_counterz+JiraCookieAuth._increment_401_retry_counterQ  s   € Ø×Ò 1Ñ$Öri   c                ó   — d| _         y ©Nr   rè   rž   s    rZ   Ú_reset_401_retry_counterz'JiraCookieAuth._reset_401_retry_counterT  s
   € Ø"#ˆÕri   c                ó>   — |j                  d| j                  «       |S )Nro   )Úregister_hookÚ
handle_401©r•   Úrequests     rZ   rÁ   zJiraCookieAuth.__call__W  s   € Ø×Ñ˜j¨$¯/©/Ô:Øˆri   c                óÀ   — | j                   \  }}||dœ}| j                  j                  | j                  t	        j
                  |«      ¬«      }|j                  «        y)z›Initialise the Session object's cookies, so we can use the session cookie.

        Raises HTTPError if the post returns an erroring http response
        )ÚusernameÚpassword©ÚdataN)rß   rÝ   ÚpostrÞ   ÚjsonÚdumpsÚraise_for_status)r•   ró   rô   Úauthentication_dataÚrs        rZ   Úinit_sessionzJiraCookieAuth.init_session[  sY   € ð
 "Ÿ[™[Ñˆ�(Ø+3ÀÑJÐØ�M‰M×ÑØ×!Ñ!¬¯
©
Ð3FÓ(Gð ó 
ˆð 	
×ÑÕri   c                ó2  — |j                   dk(  rw| j                  | j                  k  r^t        j	                  d«       | j                  «        | j                  «        | j                  |j                  j                  «       «      }| j                  «        |S )zéRefresh cookies if the session cookie has expired. Then retry the request.

        Args:
            response (requests.Response): the response with the possible 401 to handle

        Returns:
            requests.Response
        i‘  z,Trying to refresh the cookie auth session...)rr   rà   rá   ÚLOGÚinforé   rý   Úprocess_original_requestrñ   Úcopyrì   )r•   ro   re   s      rZ   rï   zJiraCookieAuth.handle_401g  s{   € ð × Ñ  CÒ'Ø×'Ñ'¨$×*GÑ*GÒGä�H‰HÐCÔDØ×-Ñ-Ô/Ø×ÑÔØ×4Ñ4°X×5EÑ5E×5JÑ5JÓ5LÓMˆHØ×%Ñ%Ô'Øˆri   c                óF   — | j                  |«       | j                  |«      S rU   )Úupdate_cookiesÚsend_request©r•   Úoriginal_requests     rZ   r  z'JiraCookieAuth.process_original_request{  s#   € Ø×ÑÐ,Ô-Ø× Ñ Ð!1Ó2Ð2ri   c                óp   — d|j                   v r|j                   d= |j                  | j                  «       y )NÚCookie)ÚheadersÚprepare_cookiesræ   r  s     rZ   r  zJiraCookieAuth.update_cookies  s3   € ð Ð'×/Ñ/Ñ/Ø ×(Ñ(¨Ð2Ø×(Ñ(¨¯©Õ6ri   c                ó8   — | j                   j                  |«      S rU   )rÝ   Úsendrð   s     rZ   r  zJiraCookieAuth.send_request†  s   € Ø�}‰}×!Ñ! 'Ó*Ð*ri   N)râ   r"   rã   Ústrrä   útuple[str, str])rñ   úrequests.PreparedRequest)ro   úrequests.Responser€   r  )r  r  )r±   r²   r³   Ú__doc__r�   Úpropertyræ   ré   rì   rÁ   rý   rï   r  r  r  rV   ri   rZ   rÛ   rÛ   7  s`   „ ñð
*Ø'ð*Ø:=ð*ØETó*ð  ñ%ó ð%ò%ò$óò
óó(3ó7ô+ri   rÛ   c                  ó    — e Zd ZdZdd„Zdd„Zy)Ú	TokenAuthzBearer Token Authentication.c                ó   — || _         y rU   )Ú_token)r•   Útokens     rZ   r�   zTokenAuth.__init__�  s	   € àˆ�ri   c                ó>   — d| j                   › �|j                  d<   |S )NzBearer Úauthorization)r  r
  )r•   rü   s     rZ   rÁ   zTokenAuth.__call__‘  s    € à'.¨t¯{©{¨mÐ%<ˆ�	‰	�/Ñ"Øˆri   N)r  r  )rü   r  )r±   r²   r³   r  r�   rÁ   rV   ri   rZ   r  r  Š  s   „ Ù&óôri   r  c                  ó*  — e Zd ZdZi dd“dd“dd“dd	“d
d“dej
                  “dd“dd“dd“dd“dd“dd“dd“dd“dddddœ“d ed!i“ZdZej                  Z	ej                  Z
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dú	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dûd"„Zedüd#„«       Zd$„ Zedýd%„«       Zedþd&„«       Zdÿd'„Zd(„ Zd)„ Zd*„ Z�d d+„Zd,„ Zdd-de	df	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 �dd.„Z	 	 	 	 	 	 	 	 �dd/„Z�dd0„Zdýd1„Z	 �d	 	 	 	 	 �dd2„Ze�d�dd3„«       Z	 �d	 	 	 �d	d4„Z�d
d5„Z�d�dd6„Z �dd7„Z!�dd8„Z"e#	 �d	 	 	 	 	 	 	 �dd9„«       Z$�dd:„Z%�dd;„Z&e#	 	 	 	 �d	 	 	 	 	 �dd<„«       Z'�dd=„Z(�dd>„Z)�dd?„Z*	 �d	 �dd@„Z+�ddA„Z,e-e.	 	 	 �d	 	 	 	 	 	 	 	 	 �ddB„«       «       Z/e-e.	 	 	 �d	 	 	 	 	 	 	 	 	 	 	 �ddC„«       «       Z0e-e.	 	 	 	 	 	 �ddD„«       «       Z1	 	 	 	 	 	 �ddE„Z2	 	 	 	 	 	 	 	 �ddF„Z3	 	 	 	 	 	 	 	 	 	 �ddG„Z4e-e.�ddH„«       «       Z5e-e.�d dI„«       «       Z6e-e.	 	 	 	 	 	 �d!	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 �d"dJ„«       «       Z7�d#dK„Z8�d$dL„Z9�d%dM„Z:	 	 	 	 �d&	 	 	 	 	 	 	 	 	 �d'dN„Z;	 	 	 	 �d&	 	 	 	 	 	 	 �d(dO„Z<�d�d)dP„Z=	 	 	 �d*	 	 	 	 	 	 	 �d+dQ„Z>�d,dR„Z?�d-dS„Z@�d-dT„ZA	 	 	 �d	 	 	 	 	 	 	 	 	 �d.dU„ZB	 	 �d/	 	 	 	 	 �d0dV„ZC	 �d	 	 	 	 	 �d1dW„ZDdX„ ZE�d2dY„ZF�d3dZ„ZG�d4d[„ZHe	 �d/	 	 	 	 	 �d5d\„«       ZI�d6d]„ZJ	 	 �d7	 	 	 	 	 	 	 �d8d^„ZK	 	 �d7	 	 	 	 	 	 	 	 	 �d9d_„ZLdg dddf	 	 	 	 	 	 	 	 	 	 	 �d:d`„ZM�d;da„ZN�d<db„ZOe#�d=dc„«       ZPe#�d�d>dd„«       ZQe#	 �d	 	 	 	 	 	 	 �d?de„«       ZRe#	 	 �d@	 	 	 	 	 	 	 	 	 �dAdf„«       ZSe#�dBdg„«       ZTe#�dCdh„«       ZUe#�dDdi„«       ZV	 	 	 �d	 	 	 	 	 	 	 	 	 	 	 �dEdj„ZW�dFdk„ZXe#�dG�dHdl„«       ZY	 	 	 	 	 	 �dIdm„ZZe#	 	 	 �d	 	 	 	 	 	 	 	 	 �dJdn„«       Z[e#�dKdo„«       Z\e#	 	 	 	 �dLdp„«       Z]e#�dMdq„«       Z^e#�dNdr„«       Z_e#�dOds„«       Z`e#�dPdt„«       Zae#�dQdu„«       Zbe#�dBdv„«       Zce#�dRdw„«       Zde#�dSdx„«       Zee#�dSdy„«       Zfe#�dTdz„«       Zge#�dUd{„«       Zhe#	 	 	 	 	 	 	 	 	 �dV	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 �dWd|„«       Zie#�dXd}„«       Zje#�dYd~„«       Zke#�dZd„«       Zle#	 �d	 	 	 	 	 	 	 	 	 �d[d€„«       Zm�dd�„Zn�d\d‚„Zo�d]�d^dƒ„Zp�d_d„„Zq�d`d…„Zr	 	 �d7	 	 	 	 	 	 	 �dad†„Zs	 	 �d7	 	 	 	 	 	 	 	 	 �dbd‡„Zt�dcdˆ„Zu�d�ddd‰„Zv�dedŠ„Zw�dfd‹„Zx	 	 	 	 	 �dg	 	 	 	 	 	 	 	 	 	 	 �dhdŒ„Zy�did�„Zz�djdŽ„Z{�d�dkd�„Z|�d�dld�„Z}e#�dmd‘„«       Z~e#	 	 �d@	 	 	 	 	 	 	 	 	 	 	 �dnd’„«       Ze#�dod“„«       Z€e#�dpd”„«       Z�e#�dqd•„«       Z‚e#�drd–„«       Zƒe#�dsd—„«       Z„e#	 	 	 	 	 	 �dtd˜„«       Z…e#�dud™„«       Z†e#�dvdš„«       Z‡e#�dwd›„«       Zˆ�dxdœ„Z‰�dyd�„ZŠ	 	 	 	 	 	 	 	 �dz	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 �d{dž„Z‹�d|dŸ„ZŒ�d}d „Z��d}d¡„ZŽ�d~d¢„Z��dd£„Z��d€d¤„Z‘�d�d¥„Z’�d‚d¦„Z“�d�dƒd§„Z”	 	 �d7	 	 	 	 	 	 	 	 	 �d„d¨„Z•	 	 	 	 	 	 	 �d…	 	 	 	 	 	 	 	 	 	 	 	 	 �d†d©„Z–�d‡dª„Z—	 	 �d@	 	 	 	 	 	 	 	 	 	 	 �dˆd«„Z˜�d‰d¬„Z™�dŠd­„Zš�dŠd®„Z›e#ddd¯œ	 	 	 	 	 	 	 �d‹d°„«       Zœ	 	 	 	 	 	 �dŒ	 	 	 	 	 	 	 	 	 	 	 	 	 �d�d±„Z�	 	 	 	 �dŽ	 	 	 	 	 	 	 	 	 	 	 �d�d²„Zže#	 	 	 	 	 �d�	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 �d‘d³„«       ZŸ�dG�d’d´„Z �d�d“dµ„Z¡�dd¶„Z¢�dd·„Z£�d”d¸„Z¤�d•d¹„Z¥�d–dº„Z¦�d—d»„Z§�d˜d¼„Z¨	 �d	 �d™d½„Z©d¾„ Zªd¿„ Z«e¬�d�dšdÀ„«       Z­�d›dÁ„Z®�dœdÂ„Z¯dÃ„ Z°e	f�d�dÄ„Z±e	f�d�dÅ„Z²e	f�d�dÆ„Z³de	df	 	 	 	 	 	 	 �dždÇ„Z´	 �d	 	 	 	 	 �dŸdÈ„ZµdÉ„ Z¶�d dÊ„Z·�d¡dË„Z¸�d¢dÌ„Z¹�d£dÍ„Zº�d¤�d¥dÎ„Z»	 �d¦	 	 	 	 	 �d§dÏ„Z¼�d¨dÐ„Z½�d©dÑ„Z¾�d�dªdÒ„Z¿�d�d«dÓ„ZÀ	 �d	 	 	 	 	 �d¬dÔ„ZÁdÕ„ ZÂ eÃd¬Ö«      �d­d×„«       ZÄ eÃd¬Ö«      dØ„ «       ZÅ eÃd¬Ö«      �d®dÙ„«       ZÆ eÃd¬Ö«      dÚ„ «       ZÇ eÃd¬Ö«      dÛ„ «       ZÈ eÃd¬Ö«      �d¯dÜ„«       ZÉ eÃd¬Ö«      dÝ„ «       ZÊ eÃd¬Ö«      dÞ„ «       ZË eÃd¬Ö«      dß„ «       ZÌ eÃd¬Ö«      dà„ «       ZÍ�ddá„ZÎ�ddâ„ZÏ�d°dã„ZÐ	 	 	 	 	 	 	 	 	 	 	 �d±	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 �d²dä„ZÑ	 	 	 	 	 	 	 �d³	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 �d´då„ZÒ�dµdæ„ZÓ�d¶dç„ZÔ�d#dè„ZÕ�d·dé„ZÖ	 e#	 	 	 	 	 �d¸	 	 	 	 	 	 	 	 	 �d¹dê„«       Z×e#	 	 	 	 �dº	 	 	 	 	 	 	 	 	 	 	 �d»dë„«       ZØ	 �d¼	 	 	 	 	 	 	 �d½dì„ZÙ	 	 	 	 	 �dg	 	 	 	 	 	 	 	 	 	 	 	 	 �d¾dí„ZÚ�d¿dî„ZÛ�d¿dï„ZÜ�d¿dð„ZÝ�dÀdñ„ZÞ�dÁdò„Zßdó„ Zà	 	 	 	 �dÂ	 	 	 	 	 	 	 	 	 	 	 	 	 �dÃdô„Zá	 	 	 �d	 	 	 	 	 	 	 	 	 	 	 �dÄdõ„Zâ�dÅdö„Zã	 �d	 	 	 	 	 	 	 �dÆd÷„Zä	 	 �dG	 	 	 	 	 	 	 �dÇdø„Zå�dÈdù„Zæy(É  r`   a™  User interface to Jira.

    Clients interact with Jira by constructing an instance of this object and calling its methods.
    For addressable resources in Jira -- those with "self" links -- an appropriate subclass of
    :py:class:`jira.resources.Resource` will be returned with customized ``update()`` and ``delete()`` methods,
    along with attribute access to fields. This means that calls of the form ``issue.fields.summary`` will be resolved into the proper lookups to return
    the JSON value at that mapping. Methods that do not return resources will return a dict constructed from the JSON response or a scalar value;
    see each method's documentation for details on what that method returns.

    Without any arguments, this client will connect anonymously to the Jira instance started by the Atlassian Plugin SDK from one of the
    'atlas-run', ``atlas-debug`` or ``atlas-run-standalone`` commands. By default, this instance runs at ``http://localhost:2990/jira``.
    The ``options`` argument can be used to set the Jira instance to use.

    Authentication is handled with the ``basic_auth`` argument. If authentication is supplied (and is accepted by Jira), the client will remember it for subsequent requests.

    For quick command line access to a server, see the ``jirashell`` script included with this distribution.

    The easiest way to instantiate is using ``j = JIRA("https://jira.atlassian.com")``
    Úserverzhttp://localhost:2990/jiraÚauth_urlz/rest/auth/1/sessionr¸   ú/Ú	rest_pathÚapiÚrest_api_versionÚ2Úagile_rest_pathÚagile_rest_api_versionz1.0ÚverifyTÚ	resilientÚasyncFÚasync_workersé   Úclient_certNÚcheck_updateÚdelay_reloadr   r
  zno-cacheúapplication/jsonúno-check)zCache-ControlúContent-TypeúX-Atlassian-TokenÚdefault_batch_sizeéd   c                ó¶  — t        t        j                  «      | _        |€2i }|r.t	        |t
        «      rt        j                  dt        «       |}d}|r||d<   |r
||d<   ||d<   t        j                  |rt        j                  nt        j                  «       t        | _        t        j                   t"        j$                  «      | _        |r| j&                  d   j)                  |«       d|v rt        j                  |d   «      }|d= ni }| j&                  j)                  |«       | j&                  d   j)                  |«       d| _        t	        | j&                  d   t,        «      sJ ‚| j&                  d   j/                  d	«      r| j&                  d   dd
 | j&                  d<   t1        | j2                  «      j4                  }t7        |«      dkD  r|| j&                  d<   | j9                  «        t	        | j&                  d   t
        «      sJ ‚t;        |¬«      | _        | j?                  «        | jA                  «        | j<                  jB                  j)                  | j&                  d   «       d| j&                  v r2| j<                  jD                  j)                  | j&                  d   «       || j<                  _#        |r|| j<                  _$        |r| jK                  |«       nd|r | jL                  |Ž  nR|r| jO                  |«       n>|r| jQ                  |«       n*|r| jS                  |¬«       n|r| jU                  |«       d}	|| _+        |	r@| jY                  «       }|jZ                  €$|xs |xs |xs
 |xs |xs d}t]        d|› �«      ‚d| _/        |
r;| ja                  «       }	 t        |d   «      | _1        |ji                  d«      | _/        nd| _1        | j&                  d   r+t"        jj                  s| jm                  «        dt"        _5        i | _7        y# td        $ r#}| j                  jg                  d|«       |‚d}~ww xY w)a4  Construct a Jira client instance.

        Without any arguments, this client will connect anonymously to the Jira instance started by the Atlassian Plugin SDK from one
        of the 'atlas-run', ``atlas-debug`` or ``atlas-run-standalone`` commands.
        By default, this instance runs at ``http://localhost:2990/jira``. The ``options`` argument can be used to set the Jira instance to use.

        Authentication is handled with the ``basic_auth``  or ``token_auth`` argument.
        If authentication is supplied (and is accepted by Jira), the client will remember it for subsequent requests.

        For quick command line access to a server, see the ``jirashell`` script included with this distribution.

        The easiest way to instantiate is using ``j = JIRA("https://jira.atlasian.com")``

        Args:
            server (Optional[str]): The server address and context path to use. Defaults to ``http://localhost:2990/jira``.
            options (Optional[Dict[str, bool, Any]]): Specify the server and properties this client will use.
              Use a dict with any of the following properties:

                * server -- the server address and context path to use. Defaults to ``http://localhost:2990/jira``.
                * rest_path -- the root REST path to use. Defaults to ``api``, where the Jira REST resources live.
                * rest_api_version -- the version of the REST resources under rest_path to use. Defaults to ``2``.
                * agile_rest_path - the REST path to use for Jira Agile requests. Defaults to ``agile``.
                * verify (Union[bool, str]) -- Verify SSL certs. (Default: ``True``).
                  Or path to a CA_BUNDLE file or directory with certificates of trusted CAs, for the `requests` library to use.
                * client_cert (Union[str, Tuple[str,str]]) -- Path to file with both cert and key or a tuple of (cert,key), for the `requests` library to use for client side SSL.
                * check_update -- Check whether using the newest python-jira library version.
                * headers -- a dict to update the default headers the session uses for all API requests.

            basic_auth (Optional[Tuple[str, str]]): A tuple of username and password to use when establishing a session via HTTP BASIC authentication.

            token_auth (Optional[str]): A string containing the token necessary for (PAT) bearer token authorization.

            oauth (Optional[Any]): A dict of properties for OAuth authentication. The following properties are required:

                * access_token -- OAuth access token for the user
                * access_token_secret -- OAuth access token secret to sign with the key
                * consumer_key -- key of the OAuth application link defined in Jira
                * key_cert -- private key file to sign requests with (should be the pair of the public key supplied to Jira in the OAuth application link)
                * signature_method (Optional) -- The signature method to use with OAuth. Defaults to oauthlib.oauth1.SIGNATURE_HMAC_SHA1

            kerberos (bool): True to enable Kerberos authentication. (Default: ``False``)
            kerberos_options (Optional[Dict[str,str]]): A dict of properties for Kerberos authentication.
              The following properties are possible:

                * mutual_authentication -- string DISABLED or OPTIONAL.

                Example kerberos_options structure: ``{'mutual_authentication': 'DISABLED'}``

            jwt (Optional[Any]): A dict of properties for JWT authentication supported by Atlassian Connect.
              The following properties are required:

                * secret -- shared secret as delivered during 'installed' lifecycle event
                  (see https://developer.atlassian.com/static/connect/docs/latest/modules/lifecycle.html for details)
                * payload -- dict of fields to be inserted in the JWT payload, e.g. 'iss'

                Example jwt structure: ``{'secret': SHARED_SECRET, 'payload': {'iss': PLUGIN_KEY}}``

            validate (bool): True makes your credentials first to be validated. Remember that if you are accessing Jira as anonymous it will fail. (Default: ``False``).
            get_server_info (bool): True fetches server version info first to determine if some API calls are available. (Default: ``True``).
            async_ (bool): True enables async requests for those actions where we implemented it, like issue update() or delete(). (Default: ``False``).
            async_workers (int): Set the number of worker threads for async operations.
            timeout (Optional[Union[Union[float, int], Tuple[float, float]]]): Set a read/connect timeout for the underlying calls to Jira.
              Obviously this means that you cannot rely on the return code when this is enabled.
            max_retries (int): Sets the amount Retries for the HTTP sessions initiated by the client. (Default: ``3``)
            proxies (Optional[Any]): Sets the proxies for the HTTP session.
            auth (Optional[Tuple[str,str]]): Set a cookie auth token if this is required.
            logging (bool): True enables loglevel to info => else critical. (Default: ``True``)
            default_batch_sizes (Optional[Dict[Type[Resource], Optional[int]]]): Manually specify the batch-sizes for
              the paginated retrieval of different item types. `Resource` is used as a fallback for every item type not
              specified. If an item type is mapped to `None` no fallback occurs, instead the JIRA-backend will use its
              default batch-size. By default all Resources will be queried in batches of 100. E.g., setting this to
              ``{Issue: 500, Resource: None}`` will make :py:meth:`search_issues` query Issues in batches of 500, while
              every other item type's batch-size will be controlled by the backend. (Default: None)
        NzpOld API usage, use JIRA(url) or JIRA(options={'server': url}, when using dictionary always use named parameters.Ú r  r'  r(  r1  r
  r  éÿÿÿÿr   r¸   ©Útimeoutræ   )Úkerberos_optionsTÚ	anonymouszCan not log in with ÚversionNumberszinvalid server_info: %sÚdeploymentType)r   r   r   r+  )8ÚtupleÚsysÚversion_infoÚsys_version_infor_   ÚdictÚwarningsÚwarnÚDeprecationWarningrÿ   ÚsetLevelÚ_loggingÚINFOÚCRITICALrb   r  Údeepcopyr`   ÚDEFAULT_OPTIONSÚ_optionsÚupdateÚ_rankr  Úendswithr   Ú
server_urlrÉ   r‘   Ú
_try_magicr"   rÝ   Ú_add_client_cert_to_sessionÚ'_add_ssl_cert_verif_strategy_to_sessionr
  ræ   Úmax_retriesÚproxiesÚ_create_oauth_sessionÚ_create_http_basic_sessionÚ_create_jwt_sessionÚ_create_token_sessionÚ_create_kerberos_sessionÚ_create_cookie_authrä   râ   Úrawr   r;  Úserver_infoÚ_versionÚ	ExceptionÚerrorÚgetÚchecked_versionÚ_check_update_Ú_fields_cache_value)r•   r  ÚoptionsÚ
basic_authÚ
token_authÚoauthÚjwtÚkerberosr8  ÚvalidateÚget_server_infoÚasync_r(  ÚloggingrR  rS  r7  rä   Údefault_batch_sizesr
  r¸   ÚuserÚauth_methodÚsirt   s                            rZ   r�   zJIRA.__init__Ñ  s¾  € ôD !&¤c×&6Ñ&6Ó 7ˆÔØˆ?ØˆGÙœ* V¬TÔ2Ü—‘ð GÜ&ôð !�Ø�áØ &ˆG�HÑÙØ%ˆG�GÑØ'4ˆG�OÑ$ä�‰¡g”X—]’]´8×3DÑ3DÔEÜˆŒä(,¯©´d×6JÑ6JÓ(KˆŒáØ�M‰MÐ.Ñ/×6Ñ6Ð7JÔKà˜ÑÜ—i‘i ¨	Ñ 2Ó3ˆGØ˜	Ñ"àˆGà�‰×Ñ˜WÔ%Ø�‰�iÑ ×'Ñ'¨Ô0àˆŒ
ô ˜$Ÿ-™-¨Ñ1´3Ô7Ð7Ð7Ø�=‰=˜Ñ"×+Ñ+¨CÔ0Ø&*§m¡m°HÑ&=¸c¸rÐ&BˆD�M‰M˜(Ñ#ä §¡Ó0×5Ñ5ˆÜˆ|Ó˜qÒ Ø,8ˆD�M‰M˜.Ñ)à�‰Ôä˜$Ÿ-™-¨	Ñ2´DÔ9Ð9Ð9ô )°Ô9ˆŒà×(Ñ(Ô*à×4Ñ4Ô6à�‰×Ñ×$Ñ$ T§]¡]°9Ñ%=Ô>à˜Ÿ™Ñ%Ø�M‰M×!Ñ!×(Ñ(¨¯©°yÑ)AÔBà$/ˆ�‰Ô!áØ$+ˆD�M‰MÔ!ñ Ø×&Ñ& uÕ-ÙØ+ˆD×+Ñ+¨ZÒ8ÙØ×$Ñ$ SÕ)ÙØ×&Ñ& zÕ2ÙØ×)Ñ)Ð;KÐ)ÕLÙØ×$Ñ$ TÔ*àˆHàˆŒ	Ùð —<‘<“>ˆDØ�x‰xÐàÒQ˜ZÒQ¨3ÒQ°(ÒQ¸dÒQÀkð ô  Ð"6°{°mÐ DÓEÐEà"ˆÔÙà×!Ñ!Ó#ˆBðÜ % bÐ)9Ñ&:Ó ;�”ð #%§&¡&Ð)9Ó":ˆDÕà%ˆDŒMà�=‰=˜Ò(´×1EÒ1EØ×ÑÔ!Ø#'ŒDÔ à35ˆÕ øô ò Ø—‘—‘Ð8¸"Ô=Ø�ûðús   Î9P, Ð,	QÐ5QÑQc                óR   — | j                   s| j                  «        | j                   S )z9Cached dictionary of {Field Name: Field ID}. Lazy loaded.)rb  Ú_update_fields_cacherž   s    rZ   Ú_fields_cachezJIRA._fields_cache¤  s%   € ð ×'Ò'Ø×%Ñ%Ô'Ø×'Ñ'Ð'ri   c                ó~   — i | _         | j                  «       D ]#  }d|v sŒ|d   D ]  }|d   | j                   |<   Œ Œ% y)z/Update the cache used for `self._fields_cache`.ÚclauseNamesÚidN)rb  rƒ   )r•   Úfr{   s      rZ   rr  zJIRA._update_fields_cache«  sO   € à#%ˆÔ Ø—‘“ò 	=ˆAØ Ò!Ø˜mÑ,ò =�DØ56°t±W�D×,Ñ,¨TÒ2ñ=ñ	=ri   c                ó2   — t        | j                  d   «      S )zAReturn the server url.

        Returns:
            str
        r  )r  rJ  rž   s    rZ   rN  zJIRA.server_url³  s   € ô �4—=‘= Ñ*Ó+Ð+ri   c                ó   — | j                   dv S )z5Return whether we are on a Cloud based Jira instance.)ÚCloud)r;  rž   s    rZ   ra   zJIRA._is_cloud¼  s   € ð ×"Ñ" jÐ0Ð0ri   c                óº   — t        j                  dt        «       t        | j                   dj
                  di | j                  ¤Ž|¬«      | j                  _        y )NzOUse OAuth or Token based authentication instead of Cookie based Authentication.ú{server}{auth_url})râ   rã   rä   rV   )rA  rB  rC  rÛ   rÝ   ÚformatrJ  rä   )r•   rä   s     rZ   rY  zJIRA._create_cookie_authÁ  sK   € Ü�‰ð8äô	
ô
 ,Ø—M‘MØ7Ð0×7Ñ7ÑH¸$¿-¹-ÑHØô
ˆ�‰Õri   c                ób  — 	 t        j                  dd¬«      j                  «       }|d   d   }t        |«      t        t        «      kD  r!t        j                  dt        › d|› d�«       y	y	# t         j                  $ r Y y	t        $ r%}| j                  j                  |«       Y d	}~y	d	}~ww xY w)
z8Check if the current version of the library is outdated.z&https://pypi.python.org/pypi/jira/jsong5^ºI @r6  r   Úversionz3You are running an outdated version of Jira Python z. Current version is z.. Do not file any bugs against older versions.N)Úrequestsr_  rø   Úparse_versionr   rA  rB  ÚRequestExceptionr]  rb   rc   )r•   rö   Úreleased_versionrt   s       rZ   ra  zJIRA._check_update_Í  s¯   € ð	 Ü—<‘<Ø8À%ôç‰d‹fð ð  $ F™|¨IÑ6ÐÜÐ-Ó.´¼{Ó1KÒKÜ—‘ØIÌ+ÈÐVkÐl|Ðk}ð  ~lð  mõð Løô ×(Ñ(ò 	ÙÜò 	 Ø�H‰H×Ñ˜Q×Ñûð	 ús   ‚A(A, Á,B.ÂB.Â	B)Â)B.c                ó$   — | j                  «        y)zDestructor for JIRA instance.N©Úcloserž   s    rZ   Ú__del__zJIRA.__del__Þ  s   € à�
‰
�ri   c                ór   — t        | dd «      }|�	 |j                  «        d | _        y y # t        $ r Y Œw xY w)NrÝ   )rq   r†  Ú	TypeErrorrÝ   )r•   râ   s     rZ   r†  z
JIRA.closeâ  sH   € Ü˜$ 
¨DÓ1ˆØÐðØ—‘”ð !ˆD�Mð øô ò ñ ð	ús   ‘* ª	6µ6c                ó^   — d|v r)| j                   j                  d«       t        d|› �«      ‚y)Nz<!-- SecurityTokenMissing -->zGot SecurityTokenMissingzSecurityTokenMissing: T)rb   rc   r   )r•   Úcontents     rZ   Ú_check_for_html_errorzJIRA._check_for_html_errorî  s5   € ð +¨gÑ5Ø�H‰H×ÑÐ7Ô8ÜÐ4°W°IÐ>Ó?Ð?Øri   c                ór   — d}| j                  «       D �cg c]  }|d   |k(  r|d   d   ‘Œ c}d   }|S c c}w )NrD   r{   ÚschemaÚcustomIdr   ©rƒ   )r•   Úsprint_field_namerw  Úsprint_field_ids       rZ   Ú_get_sprint_field_idzJIRA._get_sprint_field_idö  sU   € Ø$Ðð —[‘[“]ö
àØ�‰yÐ-Ò-ð ˆh‰K˜
Ó#ò
ð ñ	ˆð
 Ðùò
s   •4é2   c	                óÆ  ‡— d}	d}
| j                   d   r$	 ddlm} |}
| j                   j	                  d«      }	dˆfd„} |«       }|r||d<   |r||d<   n| j                  |«      x}r||d<   | j                  ||||¬	«      }| j                  |||«      }|}	 t        |t        «      rW|j	                  d«      }|�t        |«      n|}|j	                  dd«      }|j	                  dd«      }|j	                  dd«      }nd}d
}d}d}|�sº|xs t        |«      }�#||k  r| j                  j                  d|||«       |xs |xs d|z   }|
�ñ|sï|�ít        |«      |k  rßg } |
| j                  |	¬«      }t        |||«      D ]p  } |«       }||d<   ||d<   | j!                  |«      }|r&|j#                  |t%        j&                  |«      ¬«      n|j	                  ||¬«      }|j)                  |«       Œr |D ]D  }|j+                  «       }t-        |«      }|sŒ!| j                  |||«      }|j/                  |«       ŒF |
€„|s‚|�||k  r{t        |«      |k(  rm |«       }||d<   ||d<   | j                  ||||¬	«      }|r*| j                  |||«      }|j/                  |«       ||z  }nn|
€|s|�||k  rt        |«      |k(  rŒmt1        |||||«      S # t        $ r Y �ŒÁw xY w)a»  Fetch from a paginated end point.

        Args:
            item_type (Type[Resource]): Type of single item. ResultList of such items will be returned.
            items_key (Optional[str]): Path to the items in JSON returned from server. Set it to None, if response is an array, and not a JSON object.
            request_path (str): path in request URL
            startAt (int): index of the first record to be fetched. (Default: ``0``)
            maxResults (int): Maximum number of items to return. If maxResults evaluates as False, it will try to get all items in batches. (Default:50)
            params (Dict[str, Any]): Params to be used in all requests. Should not contain startAt and maxResults, as they will be added for each request created from this function.
            base (str): base URL to use for the requests.
            use_post (bool): Use POST endpoint instead of GET endpoint.

        Returns:
            ResultList
        Nr'  r   )ÚFuturesSessionr(  c                 óx   •— ‰ r6t        j                  t        j                  ‰ j                  «       «      «      S i S rU   )rø   Úloadsrù   r  ©rÒ   s   €rZ   Újson_paramsz&JIRA._fetch_pages.<locals>.json_params$  s(   ø€ á<B”4—:‘:œdŸj™j¨¯©«Ó7Ó8ÐJÈÐJri   rŽ   r�   )rÒ   ÚbaseÚuse_postTr’   r�   Frœ   zP'batch_size' set to %s, but only received %s items in batch. Falling back to %s.)râ   Úmax_workersrõ   r™  ©r€   údict[str, Any])rJ  Úrequests_futures.sessionsr–  ÚImportErrorr_  Ú_get_batch_sizeÚ	_get_jsonÚ_get_items_from_pager_   r@  r«   r‘   rb   rc   rÝ   ÚrangeÚ_get_urlr÷   rø   rù   ry   r}   rM   ÚextendrŠ   )r•   Ú	item_typeÚ	items_keyÚrequest_pathrŽ   r�   rÒ   r›  rœ  r(  Úasync_classr–  rš  Úpage_paramsÚ
batch_sizeÚresourceÚnext_items_pageÚitemsr’   Úis_lastÚstart_at_from_responseÚmax_results_from_responseÚ	page_sizeÚ
page_startÚasync_fetchesÚfuture_sessionÚstart_indexrs   rü   Úfuturero   s         `                        rZ   Ú_fetch_pageszJIRA._fetch_pagesÿ  s‰  ø€ ð4 ˆØˆØ�=‰=˜Ò!ðÝDà,�ð !ŸM™M×-Ñ-¨oÓ>ˆMõ	Kñ "“mˆáØ%,ˆK˜	Ñ"ÙØ(2ˆK˜Ò%Ø×/Ñ/°	Ó:Ð:ˆZÐ:Ø(2ˆK˜Ñ%à—>‘>Ø °4À(ð "ó 
ˆð ×3Ñ3°I¸yÈ(ÓSˆØˆàÜ˜(¤DÔ)Ø Ÿ™ WÓ-�Ø&+Ð&7œ˜Eœ
¸U�ð #Ÿ,™, x°Ó7�Ø)1¯©°iÀÓ)CÐ&Ø,4¯L©L¸ÀqÓ,IÑ)ð �Ø�Ø)*Ð&Ø,-Ð)ò Ø5ÒC¼¸U»�	ØÐ)¨i¸*Ò.DØ—H‘H×$Ñ$ØjØ"Ø!Ø!ô	ð &ÒDÐ)?ÒDÀ1È	ÑQ�
àÐ+Ù#ØÐ*¬s°5«z¸EÒ/Aà$&�MÙ%0Ø $§¡¸=ô&�Nô (-¨Z¸À	Ó'Jò 
0˜Ù&1£m˜Ø1<˜ IÑ.Ø4=˜ LÑ1Ø"Ÿm™m¨LÓ9˜ñ  (ð +×/Ñ/°¼$¿*¹*À[Ó:QÐ/ÔRà!/×!3Ñ!3°CÀÐ!3Ó!Lð ð
 &×,Ñ,¨QÕ/ð
0ð #0ò :˜Ø#)§=¡=£?˜Ü#-¨hÓ#7˜Ú#Ø.2×.GÑ.GØ )¨9°hó/˜Oð "ŸL™L¨Õ9ð:ð  Ð'Ù#Ø˜¨*°uÒ*<Ü˜OÓ,°	Ò9ñ $›ð  ð .8�K 	Ñ*Ø09�K Ñ-à#Ÿ~™~Ø$¨[¸tÈhð  .ó  �Hñ  Ø*.×*CÑ*CØ% y°(ó+˜ð Ÿ™ _Ô5Ø" iÑ/™
ð ð-  Ð'Ù#Ø˜¨*°uÒ*<Ü˜OÓ,°	Ó9ô* ØÐ-Ð/HÈ%ÐQXóð øôO ò Úðús   –K Ë	K ËK c                óð   — 	 |r||   n|D �cg c]   } || j                   | j                  |«      ‘Œ" c}S c c}w # t        $ r2}t        t        |«      dz   t	        j
                  |«      z   «      ‚d }~ww xY w)Nz : )rJ  rÝ   ÚKeyErrorr  rø   rù   )r•   r¨  r©  r®  Úraw_issue_jsonrt   s         rZ   r¤  zJIRA._get_items_from_page�  s|   € ð	Bñ ?H x°	Ò':ÈXöð #ñ ˜$Ÿ-™-¨¯©¸ÕGòð ùò øô
 ò 	Bäœ3˜q›6 E™>¬D¯J©J°xÓ,@Ñ@ÓAÐAûð	Bús!   ‚: �%5²: µ: º	A5Á-A0Á0A5c                ó|   — | j                   d   }	 ||   }|S # t        $ r |j                  t        d«      }Y |S w xY w)aš  Return the batch size for the given resource type from the options.

        Check if specified item-type has a mapped batch-size, else try to fallback to batch-size assigned to `Resource`, else fallback to Backend-determined batch-size.

        Returns:
           Optional[int]: The batch size to use. When the configured batch size is None, the batch size should be determined by the JIRA-Backend.
        r1  N)rJ  r¼  r_  r@   )r•   r¨  Úbatch_sizesÚitem_type_batch_sizes       rZ   r¢  zJIRA._get_batch_size   sX   € ð 9=¿¹Ø ñ9
ˆð	CØ#.¨yÑ#9Ð ð $Ð#øô ò 	Cà#.§?¡?´8¸TÓ#BÑ Ø#Ð#ð	Cús   ‘ ˜;º;c                ó   — | j                   S )z+Get the server this client is connected to.)rN  rž   s    rZ   Úclient_infozJIRA.client_info´  s   € à�‰Ðri   c                ój   — t        || j                  | j                  «      }|j                  |«       |S )a  Find Resource object for any addressable resource on the server.

        This method is a universal resource locator for any REST-ful resource in Jira. The argument ``resource_format`` is a string of
        the form ``resource``, ``resource/{0}``, ``resource/{0}/sub``, ``resource/{0}/sub/{1}``, etc.
        The format placeholders will be populated from the ``ids`` argument if present. The existing authentication session will be used.

        The return value is an untyped Resource object, which will not support specialized :py:meth:`.Resource.update` or :py:meth:`.Resource.delete` behavior.
        Moreover, it will not know to return an issue Resource if the client uses the resource issue path.
        For this reason, it is intended to support resources that are not included in the standard Atlassian REST API.

        Args:
            resource_format (str): the subpath to the resource string
            ids (Optional[Tuple]): values to substitute in the ``resource_format`` string
        Returns:
            Resource
        )r@   rJ  rÝ   Úfind)r•   Úresource_formatÚidsr®  s       rZ   rÄ  z	JIRA.findº  s+   € ô& ˜O¨T¯]©]¸D¿M¹MÓJˆØ�‰�cÔØˆri   c                ó  — t        | j                  d«      rk| j                  j                  dt	        | j                  j
                  «      › d|› d�«       t        j                  | j                  j
                  |¬«       yy)z­Execute all asynchronous jobs and wait for them to finish. By default it will run on 10 threads.

        Args:
            size (int): number of threads to run on.
        Ú_async_jobszExecuting asynchronous z jobs found in queue by using z threads...)ÚsizeN)ÚhasattrrÝ   rb   r   r‘   rÈ  rO   Úmap)r•   rÉ  s     rZ   Úasync_dozJIRA.async_doÑ  si   € ô �4—=‘= -Ô0Ø�H‰H�M‰MØ)¬#¨d¯m©m×.GÑ.GÓ*HÐ)IÐIgÐhlÐgmÐmxÐyôô ×!Ñ! $§-¡-×";Ñ";À$ÖGð	 1ri   c                ó:   — i }|�||d<   | j                  d|¬«      S )zÝReturn the mutable server application properties.

        Args:
            key (Optional[str]): the single property to return a value for
        Returns:
            Union[Dict[str, str], List[Dict[str, str]]]
        rz   zapplication-propertiesr™  ©r£  )r•   rz   rÒ   s      rZ   Úapplication_propertieszJIRA.application_propertiesá  s+   € ð ˆØˆ?ØˆF�5‰MØ�~‰~Ð6¸vˆ~ÓFÐFri   c                ó”   — | j                  d|z   «      }||dœ}| j                  j                  |t        j                  |«      ¬«      S )z Set the application property.

        Args:
            key (str): key of the property to set
            value (str): value to assign to the property
        zapplication-properties/)rv  rÙ   rõ   )Ú_get_latest_urlrÝ   Úputrø   rù   )r•   rz   rÙ   rs   Úpayloads        rZ   Úset_application_propertyzJIRA.set_application_propertyð  sG   € ð ×"Ñ"Ð#<¸sÑ#BÓCˆØ uÑ-ˆØ�}‰}× Ñ  ¬4¯:©:°gÓ+>Ð Ó?Ð?ri   c                ó  — |  |rt        | d«      r| j                  S | j                  dz   }| j                  j	                  |«      }t        |«      }d|v r&t        |t        «      r|d   | _        | j                  S g | _        | j                  S )zaList of application links.

        Returns:
            List[Dict]: json, or empty list
        Ú_applicationlinksz*/rest/applinks/latest/listApplicationlinksrŒ   )rÊ  rÖ  rN  rÝ   r_  rM   r_   r@  )r•   Úcachedrs   rü   Úos        rZ   ÚapplicationlinkszJIRA.applicationlinksû  sŽ   € ñ 	á”g˜dÐ$7Ô8Ø×)Ñ)Ð)ð �o‰oÐ LÑLˆà�M‰M×Ñ˜cÓ"ˆä�q‹MˆØ�Q‰;œ: a¬Ô.Ø%& v¡YˆDÔ"ð ×%Ñ%Ð%ð &(ˆDÔ"Ø×%Ñ%Ð%ri   c                ó.   — | j                  t        |«      S )z©Get an attachment Resource from the server for the specified ID.

        Args:
            id (str): The Attachment ID

        Returns:
            Attachment
        )Ú_find_for_resourcer$   ©r•   rv  s     rZ   Ú
attachmentzJIRA.attachment  ó   € ð ×&Ñ&¤z°2Ó6Ð6ri   c                ó$   — | j                  d«      S )zQGet the attachment metadata.

        Return:
            Dict[str, int]
        zattachment/metarÎ  rž   s    rZ   Úattachment_metazJIRA.attachment_meta  s   € ð �~‰~Ð/Ó0Ð0ri   c                óv  ‡‡‡— d}t        |t        «      rt        |d«      Šd}nI|Št        |t        «      r7|j                  dk7  r(| j
                  j                  d|j                  z  «       |Š‰s9t        ‰t        «      r)t        j                  j                  ‰j                  «      Š	 	 dˆˆfd„Š G ˆfd„dt        «      }| j                  d|› d	�«      }	  ‰«       \  }}| j                  j                  ||| |«       ¬
«      }	|r‰j                  «        	 t!        |	«      }
|
rt        |
t"        «      st%        d|
› d�«      ‚t'        | j(                  | j                  t        |
t*        «      r|
d   n|
«      }|j,                  dk(  rt%        dd|	› d|› �z   «      ‚|S # |r‰j                  «        w w xY w)aQ  Attach an attachment to an issue and returns a Resource for it.

        The client will *not* attempt to open or validate the attachment; it expects a file-like object to be ready for its use.
        The user is still responsible for tidying up (e.g., closing the file, killing the socket, etc.)

        Args:
            issue (Union[str, int]): the issue to attach the attachment to
            attachment (Union[str,BufferedReader]): file-like object to attach to the issue, also works if it is a string with the filename.
            filename (str): optional name for the attached file. If omitted, the file object's ``name`` attribute is used.
              If you acquired the file-like object by any other method than ``open()``, make sure that a name is specified in one way or the other.

        Returns:
            Attachment
        FÚrbTz8%s was not opened in 'rb' mode, attaching file may fail.c                 ó€   •— ‰j                  d«       t        d‰‰dfi¬«      } t        | j                  ddœ«      }| |fS )z>Returns MultipartEncoder stream of attachment, and the header.r   Úfilezapplication/octet-streamr�  r.  )úcontent-typer0  )Úseekr   r   Úcontent_type)Úencoded_dataÚrequest_headersÚattachment_ioÚfnames     €€rZ   Ú&generate_multipartencoded_request_argszCJIRA.add_attachment.<locals>.generate_multipartencoded_request_argsL  sW   ø€ ð ×Ñ˜qÔ!Ü+Ø ¨Ð7QÐ RÐSôˆLô 2à$0×$=Ñ$=Ø)3ñóˆOð   Ð0Ð0ri   c                  ó,   •‡ — e Zd Z	 	 	 	 dˆ ˆfd„Zˆ xZS )ú6JIRA.add_attachment.<locals>.RetryableMultipartEncoderc                óJ   •—  ‰«       \  }}||d<   ||d<   t         ‰| �  |«      S )Nrö   r
  )r¡   Úprepare)r•   Úoriginal_request_kwargsrè  ré  r£   rì  s       €€rZ   rð  z>JIRA.add_attachment.<locals>.RetryableMultipartEncoder.prepare]  s9   ø€ ñ 1WÓ0XÑ-�˜oØ2>Ð'¨Ñ/Ø5DÐ'¨	Ñ2Ü‘w‘Ð'>Ó?Ð?ri   )rñ  r   r€   r   )r±   r²   r³   rð  r´   )r£   rì  s   @€rZ   ÚRetryableMultipartEncoderrî  \  s!   ù„ ð@Ø/Bð@à$÷@ò @ri   rò  úissue/z/attachments)rö   r
  Ú_prepare_retry_classzUnable to parse JSON: z. Failed to add attachment?r   zAdded empty attachment?!: z
Response: z
Attachment: )r€   z,tuple[MultipartEncoder, CaseInsensitiveDict])r_   r  Úopenr   Úmoderb   rc   r{   ÚosrÉ   Úbasenamer!   r¦  rÝ   r÷   r†  rM   r   r   r$   rJ  r   rÉ  )r•   ÚissuerÝ  ÚfilenameÚclose_attachmentrò  rs   rè  ré  rü   ÚjsÚjira_attachmentrê  rë  rì  s               @@@rZ   Úadd_attachmentzJIRA.add_attachment'  s¹  ú€ ð* !ÐÜ�j¤#Ô&Ü  ¨TÓ2ˆMØ#Ñà&ˆMÜ˜*¤nÔ5¸*¿/¹/ÈTÒ:QØ—‘× Ñ ØNØ —o‘oñ&ôð
 ˆÙœ M´>ÔBÜ—G‘G×$Ñ$ ]×%7Ñ%7Ó8ˆEð	1Ø8ö	1ö 	@Ô(>ô 	@ð �m‰m˜f U G¨<Ð8Ó9ˆð
	&Ù,RÓ,TÑ)ˆL˜/Ø—‘×"Ñ"ØØ!Ø'Ù%>Ó%@ð	 #ó ˆAñ  Ø×#Ñ#Õ%ä4>¸q³MˆÙœ B¬Ô1ÜÐ4°R°DÐ8SÐTÓUÐUÜ$Ø�M‰M˜4Ÿ=™=´:¸bÄ$Ô3G¨"¨Qª%ÈRó
ˆð ×Ñ 1Ò$ÜØ,Ø˜q˜c °Ð/@ÐAñBóð ð Ðøñ  Ø×#Ñ#Õ%ð  ús   Ã.F# Æ#F8c                ór   — | j                  dt        |«      z   «      }| j                  j                  |«      S )zŒDelete attachment by id.

        Args:
            id (str): ID of the attachment to delete

        Returns:
            Response
        zattachment/©r¦  r  rÝ   Údelete©r•   rv  rs   s      rZ   Údelete_attachmentzJIRA.delete_attachment  s0   € ð �m‰m˜M¬C°«GÑ3Ó4ˆØ�}‰}×#Ñ# CÓ(Ð(ri   c                ó.   — | j                  t        |«      S )zrGet a component Resource from the server.

        Args:
            id (str): ID of the component to get
        )rÛ  r'   rÜ  s     rZ   Ú	componentzJIRA.component�  s   € ð ×&Ñ&¤y°"Ó5Ð5ri   c                ó  — |||dœ}|�||d<   |�||d<   |�||d<   | j                  d«      }| j                  j                  |t        j                  |«      ¬«      }	t        | j                  | j                  t        |	«      ¬«      }
|
S )ap  Create a component inside a project and return a Resource for it.

        Args:
            name (str): name of the component
            project (str): key of the project to create the component in
            description (str): a description of the component
            leadUserName (Optional[str]): the username of the user responsible for this component
            assigneeType (Optional[str]): see the ComponentBean.AssigneeType class for valid values
            isAssigneeTypeValid (bool): True specifies whether the assignee type is acceptable (Default: ``False``)

        Returns:
            Component
        )r{   ÚprojectÚisAssigneeTypeValidÚdescriptionÚleadUserNameÚassigneeTyper  rõ   ©rZ  )r¦  rÝ   r÷   rø   rù   r'   rJ  rM   )r•   r{   r  r	  r
  r  r  rö   rs   rü   r  s              rZ   Úcreate_componentzJIRA.create_component•  s–   € ð0 ØØ#6ñ
ˆð
 Ð"Ø"-ˆD�ÑØÐ#Ø#/ˆD�Ñ ØÐ#Ø#/ˆD�Ñ à�m‰m˜KÓ(ˆØ�M‰M×Ñ˜s¬¯©°DÓ)9ÐÓ:ˆä˜dŸm™m¨T¯]©]Ä
È1ÃÔNˆ	ØÐri   c                óL   — | j                  dt        |«      z   dz   «      }|d   S )zyGet the count of related issues for a component.

        Args:
            id (str): ID of the component to use
        ú
component/ú/relatedIssueCountsÚ
issueCount©r£  r  )r•   rv  rö   s      rZ   Úcomponent_count_related_issuesz#JIRA.component_count_related_issues¾  s1   € ð  $Ÿ~™~Øœ3˜r›7Ñ"Ð%:Ñ:ó 
ˆð �LÑ!Ð!ri   c                ór   — | j                  dt        |«      z   «      }| j                  j                  |«      S )z‡Delete component by id.

        Args:
            id (str): ID of the component to use

        Returns:
            Response
        r  r   r  s      rZ   Údelete_componentzJIRA.delete_componentÉ  s0   € ð �m‰m˜L¬3¨r«7Ñ2Ó3ˆØ�}‰}×#Ñ# CÓ(Ð(ri   c                ó.   — | j                  t        |«      S )z¯Get a custom field option Resource from the server.

        Args:
            id (str): ID of the custom field to use

        Returns:
            CustomFieldOption
        )rÛ  r)   rÜ  s     rZ   Úcustom_field_optionzJIRA.custom_field_option×  s   € ð ×&Ñ&Ô'8¸"Ó=Ð=ri   c                óH   — i }|�||d<   | j                  t        dd|||«      S )aÞ  Return a ResultList of Dashboard resources and a ``total`` count.

        Args:
            filter (Optional[str]): either "favourite" or "my", the type of dashboards to return
            startAt (int): index of the first dashboard to return (Default: ``0``)
            maxResults (int): maximum number of dashboards to return. If maxResults set to False, it will try to get all items in batches. (Default: ``20``)

        Returns:
            ResultList[Dashboard]
        ÚfilterÚ
dashboardsÚ	dashboard)rº  r*   )r•   r  rŽ   r�   rÒ   s        rZ   r  zJIRA.dashboardsä  s>   € ð ˆØÐØ%ˆF�8ÑØ× Ñ ÜØØØØØó
ð 	
ri   c                óŽ   — | j                  t        |«      }|j                  j                  | j	                  |«      xs g «       |S )z›Get a dashboard Resource from the server.

        Args:
            id (str): ID of the dashboard to get.

        Returns:
            Dashboard
        )rÛ  r*   Úgadgetsr§  Údashboard_gadgets)r•   rv  r  s      rZ   r  zJIRA.dashboardý  s@   € ð ×+Ñ+¬I°rÓ:ˆ	Ø×Ñ× Ñ  ×!7Ñ!7¸Ó!;Ò!A¸rÔBØÐri   c                ó  — t        ||xs g |xs g |dœ«      }| j                  d«      }| j                  j                  |t	        j
                  |«      ¬«      }t        |«      }t        | j                  | j                  |¬«      S )a*  Create a new dashboard and return a dashboard resource for it.

        Args:
            name (str): Name of the new dashboard `required`.
            description (Optional[str]): Useful human-readable description of the new dashboard.
            edit_permissions (list | list[dict]): A list of permissions dicts `required`
                though can be an empty list.
            share_permissions (list | list[dict]): A list of permissions dicts `required`
                though can be an empty list.

        Returns:
            Dashboard
        ©r{   ÚeditPermissionsÚsharePermissionsr	  r  rõ   r  )	rN   r¦  rÝ   r÷   rø   rù   rM   r*   rJ  )	r•   r{   r	  Úedit_permissionsÚshare_permissionsrö   rs   rü   Úraw_dashboard_jsons	            rZ   Úcreate_dashboardzJIRA.create_dashboard
  s}   € ô,  7àØ#3Ò#9°rØ$5Ò$;¸Ø*ñ	ó 
ˆð �m‰m˜KÓ(ˆØ�M‰M×Ñ˜s¬¯©°DÓ)9ÐÓ:ˆä-7¸«]ÐÜ˜Ÿ™¨¯©Ð;MÔNÐNri   c                óø   — t        ||xs g |xs g |dœ«      }| j                  d«      }|› d|› d�}| j                  j                  ||¬«      }t	        |«      }	t        | j                  | j                  |	¬«      S )a2  Copy an existing dashboard.

        Args:
          id (str): The ``id`` of the ``Dashboard`` to copy.
          name (str): Name of the new dashboard `required`.
          description (Optional[str]): Useful human-readable description of the new dashboard.
          edit_permissions (list | list[dict]): A list of permissions dicts `required`
            though can be an empty list.
          share_permissions (list | list[dict]): A list of permissions dicts `required`
            though can be an empty list.

        Returns:
          Dashboard
        r   r  r  z/copy©rø   r  )rN   r¦  rÝ   r÷   rM   r*   rJ  )
r•   rv  r{   r	  r#  r$  rö   rs   rü   r%  s
             rZ   Úcopy_dashboardzJIRA.copy_dashboard.  s†   € ô0  7àØ#3Ò#9°rØ$5Ò$;¸Ø*ñ	ó 
ˆð �m‰m˜KÓ(ˆØ��Q�r�d˜%Ð ˆØ�M‰M×Ñ˜s¨ÐÓ.ˆä-7¸«]ÐÜ˜Ÿ™¨¯©Ð;MÔNÐNri   c                ó€   — |r|dz  nd}d|i}| j                  d|› d�«      }| j                  j                  ||¬«      S )a  Update the automatic refresh interval of a dashboard.

        Args:
          id (str): The ``id`` of the ``Dashboard`` to copy.
          minutes (int): The frequency of the dashboard automatic refresh in minutes.

        Returns:
          Response
        i`ê  NÚautomaticRefreshMszdashboards/z/automatic-refresh-msr(  )Ú_get_internal_urlrÝ   rÒ  )r•   rv  ÚminutesrÙ   rö   rs   s         rZ   Ú*update_dashboard_automatic_refresh_minutesz/JIRA.update_dashboard_automatic_refresh_minutesU  sO   € ñ& $+�˜%’°ˆØ$ eÐ,ˆà×$Ñ$ {°2°$Ð6KÐ%LÓMˆØ�}‰}× Ñ  ¨4Ð Ó0Ð0ri   c           	     ó>   — | j                  t        dd|› d|› d�«      S )a	  Return a ResultList of a Dashboard gadget's property keys.

        Args:
          dashboard_id (str): ID of dashboard.
          item_id (str): ID of dashboard item (``DashboardGadget``).

        Returns:
            ResultList[DashboardItemPropertyKey]
        rÎ   ú
dashboard/ú/items/ú/properties)rº  r-   )r•   Údashboard_idÚitem_ids      rZ   Údashboard_item_property_keysz!JIRA.dashboard_item_property_keysn  s/   € ð × Ñ Ü$ØØ˜˜ g¨g¨Y°kÐBó
ð 	
ri   c                ó8   — | j                  t        |||f«      }|S )aM  Get the item property for a specific dashboard item (DashboardGadget).

        Args:
          dashboard_id (str):  of the dashboard.
          item_id (str): ID of the item (``DashboardGadget``) on the dashboard.
          property_key (str): KEY of the gadget property.

        Returns:
            DashboardItemProperty
        )rÛ  r,   )r•   r3  r4  Úproperty_keyÚdashboard_item_propertys        rZ   r8  zJIRA.dashboard_item_property€  s)   € ð #'×"9Ñ"9Ü! L°'¸<Ð#Hó#
Ðð 'Ð&ri   c                óÜ   — | j                  d|› d|› d|› �«      }| j                  j                  ||¬«      }|j                  st	        |j
                  |¬«      ‚| j                  |||«      S )a‰  Set a dashboard item property.

        Args:
          dashboard_id (str): Dashboard id.
          item_id (str): ID of dashboard item (``DashboardGadget``) to add property_key to.
          property_key (str): The key of the property to set.
          value (dict[str, Any]): The dictionary containing the value of the property key.

        Returns:
          DashboardItemProperty
        r0  r1  ú/properties/r(  ©rr   rñ   )r¦  rÝ   rÒ  Úokr   rr   r8  )r•   r3  r4  r7  rÙ   rs   rü   s          rZ   Úset_dashboard_item_propertyz JIRA.set_dashboard_item_property’  sp   € ð �m‰mØ˜˜ g¨g¨Y°lÀ<À.ÐQó
ˆð �M‰M×Ñ˜c¨ÐÓ.ˆà�tŠtÜ¨¯©¸qÔAÐAØ×+Ñ+¨L¸'À<ÓPÐPri   c           	     ó  — g }| j                  t        dd|› d�«      }|D ]c  }| j                  ||j                  «      D ]B  }|j                  j                  | j                  ||j                  |j                  «      «       ŒD Œe |S )zèReturn a list of DashboardGadget resources for the specified dashboard.

        Args:
          dashboard_id (str): the ``dashboard_id`` of the dashboard to get gadgets for

        Returns:
          list[DashboardGadget]
        r  r0  ú/gadget)rº  r+   r5  rv  Úitem_propertiesry   r8  rz   )r•   r3  r  ÚgadgetÚdashboard_item_keys        rZ   r  zJIRA.dashboard_gadgets©  s›   € ð *,ˆØ×#Ñ#Ü˜Y¨*°\°NÀ'Ð(Jó
ˆð ò 	ˆFØ&*×&GÑ&GØ˜fŸi™ió'ò Ð"ð ×&Ñ&×-Ñ-Ø×0Ñ0Ø$ f§i¡iÐ1C×1GÑ1Góõñð	ð ˆri   c                ó0   — | j                  t        dd«      S )z”Return a ResultList of available DashboardGadget resources and a ``total`` count.

        Returns:
            ResultList[DashboardGadget]
        r  zdashboard/gadgets)rº  r+   rž   s    rZ   Úall_dashboard_gadgetszJIRA.all_dashboard_gadgetsÄ  s   € ð × Ñ ¤°)Ð=PÓQÐQri   c           	     óä   — t        ||||||dœ«      }| j                  d|› d�«      }	| j                  j                  |	|¬«      }
t	        |
«      }t        | j                  | j                  |¬«      S )aó  Add a gadget to a dashboard and return a ``DashboardGadget`` resource.

        Args:
          dashboard_id (str): The ``dashboard_id`` of the dashboard to add the gadget to `required`.
          color (str): The color of the gadget, should be one of: blue, red, yellow,
              green, cyan, purple, gray, or white.
          ignore_uri_and_module_key_validation (bool): Whether to ignore the
              validation of the module key and URI. For example, when a gadget is created
              that is part of an application that is not installed.
          module_key (str): The module to use in the gadget. Mutually exclusive with
              `uri`.
          position (dict[str, int]): A dictionary containing position information like -
              `{"column": 0, "row", 1}`.
          title (str): The title of the gadget.
          uri (str): The uri to the module to use in the gadget. Mutually exclusive
              with `module_key`.

        Returns:
          DashboardGadget
        )ÚcolorÚignoreUriAndModuleKeyValidationÚ
module_keyÚpositionÚtitleÚurir0  r?  r(  r  )rN   r¦  rÝ   r÷   rM   r+   rJ  )r•   r3  rF  Ú$ignore_uri_and_module_key_validationrH  rI  rJ  rK  rö   rs   rü   Úraw_gadget_jsons               rZ   Úadd_gadget_to_dashboardzJIRA.add_gadget_to_dashboardÎ  sx   € ô@ 'àØ3WØ(Ø$ØØñó	
ˆð �m‰m˜j¨¨°gÐ>Ó?ˆØ�M‰M×Ñ˜s¨ÐÓ.ˆä*4°Q«-ˆÜ˜tŸ}™}¨d¯m©mÀÔQÐQri   c                ó$   — | j                  d«      S )z^Return a list of all issue fields.

        Returns:
            List[Dict[str, Any]]
        ÚfieldrÎ  rž   s    rZ   rƒ   zJIRA.fields  s   € ð �~‰~˜gÓ&Ð&ri   c                ó.   — | j                  t        |«      S )z’Get a filter Resource from the server.

        Args:
            id (str): ID of the filter to get.

        Returns:
            Filter
        )rÛ  r/   rÜ  s     rZ   r  zJIRA.filter  ó   € ð ×&Ñ&¤v¨rÓ2Ð2ri   c                óŽ   — | j                  d«      }|D �cg c]#  }t        | j                  | j                  |«      ‘Œ% }}|S c c}w )z�Get a list of filter Resources which are the favourites of the currently authenticated user.

        Returns:
            List[Filter]
        zfilter/favourite)r£  r/   rJ  rÝ   )r•   Úr_jsonÚraw_filter_jsonÚfilterss       rZ   Úfavourite_filterszJIRA.favourite_filters  sO   € ð (,§~¡~Ð6HÓ'Iˆð $*ö
àô �4—=‘= $§-¡-°ÕAð
ˆð 
ð ˆùò	
ó   –(Ac                ó  — i }|�||d<   |�||d<   |�||d<   |�||d<   | j                  d«      }| j                  j                  |t        j                  |«      ¬«      }t        |«      }t        | j                  | j                  |¬«      S )a¥  Create a new filter and return a filter Resource for it.

        Args:
            name (str): name of the new filter
            description (str): Useful human-readable description of the new filter
            jql (str): query string that defines the filter
            favourite (Optional[bool]): True adds this filter to the current user's favorites (Default: ``None``)

        Returns:
            Filter
        r{   r	  ÚjqlÚ	favouriter  rõ   r  )r¦  rÝ   r÷   rø   rù   rM   r/   rJ  )	r•   r{   r	  rZ  r[  rö   rs   rü   rU  s	            rZ   Úcreate_filterzJIRA.create_filter#  s–   € ð$  "ˆØÐØˆD�‰LØÐ"Ø"-ˆD�ÑØˆ?ØˆD�‰KØÐ Ø )ˆD�ÑØ�m‰m˜HÓ%ˆØ�M‰M×Ñ˜s¬¯©°DÓ)9ÐÓ:ˆä*4°Q«-ˆÜ�d—m‘m T§]¡]¸ÔHÐHri   c                óì  — | j                  |«      }i }|xs |j                  |d<   |st        |d«      r|xs |j                  |d<   |xs |j                  |d<   |xs |j
                  |d<   | j                  d|› �«      }| j                  j                  |ddit        j                  |«      ¬«      }	t        j                  |	j                  «      }
t        | j                  | j                  |
¬	«      S )
a�  Update a filter and return a filter Resource for it.

        Args:
            name (Optional[str]): name of the new filter
            description (Optional[str]): Useful human-readable description of the new filter
            jql (Optional[str]): query string that defines the filter
            favourite (Optional[bool]): True to add this filter to the current user's favorites (Default: ``None``)

        r{   r	  rZ  r[  zfilter/rå  r-  ©r
  rö   r  )r  r{   rÊ  r	  rZ  r[  r¦  rÝ   rÒ  rø   rù   r˜  Útextr/   rJ  )r•   Ú	filter_idr{   r	  rZ  r[  r  rö   rs   rü   rU  s              rZ   Úupdate_filterzJIRA.update_filterD  sà   € ð" —‘˜YÓ'ˆØˆØÒ*˜vŸ{™{ˆˆV‰Ùœ' &¨-Ô8à"-Ò"C°×1CÑ1CˆD�ÑØÒ'˜VŸZ™ZˆˆU‰Ø%Ò9¨×)9Ñ)9ˆˆ[Ñà�m‰m˜g i [Ð1Ó2ˆØ�M‰M×ÑØ˜.Ð*<Ð=ÄDÇJÁJÈtÓDTð ó 
ˆô Ÿ*™* Q§V¡VÓ,ˆÜ�d—m‘m T§]¡]¸ÔHÐHri   c                ó~   — t        | j                  | j                  «      }i }|�||d<   |j                  ||¬«       |S )zâGet a group Resource from the server.

        Args:
            id (str): ID of the group to get
            expand (Optional[Any]): Extra information to fetch inside each resource

        Returns:
            Group
        Úexpandr™  )r0   rJ  rÝ   rÄ  )r•   rv  rc  ÚgrouprÒ   s        rZ   rd  z
JIRA.grouph  sB   € ô �d—m‘m T§]¡]Ó3ˆØˆØÐØ%ˆF�8ÑØ�
‰
�2˜fˆ
Ô%Øˆri   c                ó¨   — i }g }|�||d<   |�||d<   |�||d<   | j                  d|¬«      d   D ]  }|j                  |d   «       Œ t        |«      S )a_  Return a list of groups matching the specified criteria.

        Args:
            query (Optional[str]): filter groups by name with this string
            exclude (Optional[Any]): filter out groups by name with this string
            maxResults (int): maximum results to return. (Default: ``9999``)

        Returns:
            List[str]
        rÊ   Úexcluder�   zgroups/pickerr™  Úgroupsr{   )r£  ry   rÍ   )r•   rÊ   rf  r�   rÒ   rg  rd  s          rZ   rg  zJIRA.groupsz  sx   € ð  "$ˆØˆØÐØ#ˆF�7‰OØÐØ 'ˆF�9ÑØÐ!Ø#-ˆF�<Ñ Ø—^‘^ O¸F�^ÓCÀHÑMò 	)ˆEØ�M‰M˜% ™-Õ(ð	)ä�f‹~Ðri   c           
     ó¦  — | j                   dk  rt        d«      ‚|ddœ}| j                  d|¬«      }|d   d   }|d   d   }||d	z
  k  rb|d
|d	z   › d|dz   › d�dœ}| j                  d|¬«      }|d   d   D ]  }|d   d   j                  |«       Œ |d   d   }|d   d   }||d	z
  k  rŒbi }|d   d   D ]ô  }|j	                  d«      duxr |j	                  d«      dk7  }	|j	                  d«      duxr |j	                  d«      dk7  }
|j	                  d«      |j	                  d«      |j	                  d«      |j	                  d«      |j	                  dd«      |j	                  d«      |j	                  d«      dœ||	r|d   n#|
r|j	                  d«      n|j	                  d«      <   Œö t        t        |j                  «       d„ ¬«      «      S )z¢Return a hash or users with their information. Requires Jira 6.0 or will raise NotImplemented.

        Args:
            group (str): Name of the group.
        ©é   r   r   z_Group members is not implemented in Jira before version 6.0, upgrade the instance, if possible.Úusers)Ú	groupnamerc  rd  r™  rÉ  z	end-indexrœ   zusers[ú:r”  ú]r°  rv  Nr4  r{   Ú	accountIdÚdisplayNameÚemailAddressÚhiddenÚactiveÚtimezone)r{   rv  ro  ÚfullnameÚemailrs  rt  c                ó   — | d   S rë   rV   )Úts    rZ   ú<lambda>z$JIRA.group_members.<locals>.<lambda>É  s
   € ÀÀ!Á€ ri   )rz   )r\  ÚNotImplementedErrorr£  ry   r_  r   rÍ   r°  )r•   rd  rÒ   rü   rÉ  Ú	end_indexÚr2rn  r}   ÚhasIdÚhasNames              rZ   Úgroup_memberszJIRA.group_members–  s  € ð �=‰=˜9Ò$Ü%Øqóð ð  %°Ñ8ˆØ�N‰N˜7¨6ˆNÓ2ˆØ�‰z˜&Ñ!ˆØ�g‘J˜{Ñ+ˆ	à˜$ ™(Ò"à"Ø" 9¨q¡= /°°9¸r±>Ð2BÀ!ÐDñˆFð —‘ °�Ó7ˆBØ˜7™ GÑ,ò 1�Ø�'‘
˜7Ñ#×*Ñ*¨4Õ0ð1à˜7™ KÑ0ˆIØ�W‘:˜fÑ%ˆDð ˜$ ™(Ó"ð ˆØ�g‘J˜wÑ'ò 	ˆDð —H‘H˜T“N¨$Ð.ÒG°4·8±8¸D³>ÀRÑ3GˆEØ—h‘h˜vÓ&¨dÐ2ÒM°t·x±xÀÓ7GÈ2Ñ7MˆGð Ÿ™ Ó(Ø—h‘h˜t“nØ!ŸX™X kÓ2Ø ŸH™H ]Ó3ØŸ™ .°(Ó;ØŸ(™( 8Ó,Ø ŸH™H ZÓ0ñð ñ ð ˜’Jñ ð Ÿ™ &Ô)àŸ™ +Ó.òð	ô. œ6 &§,¡,£.±nÔEÓFÐFri   c                ó¨   — | j                  d«      }t        «       }||d<   t        j                  |«      }| j                  j                  ||¬«       y)z²Create a new group in Jira.

        Args:
            groupname (str): The name of the group you wish to create.

        Returns:
            bool: True if successful.
        rd  r{   rõ   T)rÑ  r   rø   rù   rÝ   r÷   )r•   rl  rs   ÚxrÓ  s        rZ   Ú	add_groupzJIRA.add_groupË  sM   € ð ×"Ñ" 7Ó+ˆô ‹Mˆàˆˆ&‰	ä—*‘*˜Q“-ˆà�‰×Ñ˜3 WÐÔ-àri   c                óh   — | j                  d«      }d|i}| j                  j                  ||¬«       y)zÈDelete a group from the Jira instance.

        Args:
            groupname (str): The group to be deleted from the Jira instance.

        Returns:
            bool: Returns True on success.
        rd  rl  r™  T©rÑ  rÝ   r  )r•   rl  rs   r�  s       rZ   Úremove_groupzJIRA.remove_groupâ  s8   € ð ×"Ñ" 7Ó+ˆØ˜)Ð$ˆØ�‰×Ñ˜S¨ÐÔ+Øri   c                ó¾   — t        |t        «      r|S t        | j                  | j                  «      }i }|�||d<   |�||d<   |�||d<   |j	                  ||¬«       |S )a²  Get an issue Resource from the server.

        Args:
            id (Union[Issue, str]): ID or key of the issue to get
            fields (Optional[str]): comma-separated string of issue fields to include in the results
            expand (Optional[str]): extra information to fetch inside each resource
            properties (Optional[str]): extra properties to fetch inside each result

        Returns:
            Issue
        rƒ   rc  Ú
propertiesr™  )r_   r1   rJ  rÝ   rÄ  )r•   rv  rƒ   rc  r‡  rù  rÒ   s          rZ   rù  z
JIRA.issueó  sq   € ô& �bœ%Ô ØˆIä�d—m‘m T§]¡]Ó3ˆàˆØÐØ%ˆF�8ÑØÐØ%ˆF�8ÑØÐ!Ø#-ˆF�<Ñ Ø�
‰
�2˜fˆ
Ô%Øˆri   c                óú  — t        |fi |¤Ž}|d   d   }d}t        |t        t        f«      r.| j	                  t        |«      «      j
                  }d|i|d   d<   |d   d   }t        |t        «      rd|i|d   d<   nKt        |t        «      r;d| j                  t        |«      |rt        |«      nd¬«      j
                  i|d   d<   | j                  d«      }| j                  j                  |t        j                  |«      ¬«      }t        |«      }	d	|	vr,t        |j                  ||t        j                  |«      ¬
«      ‚|r| j                  |	d	   «      S t!        | j"                  | j                  |	¬«      S )a×  Create a new issue and return an issue Resource for it.

        Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value is treated as the
        intended value for that field -- if the fields argument is used, all other keyword arguments will be ignored.

        By default, the client will immediately reload the issue Resource created by this method in order to return a complete Issue object to the caller;
        this behavior can be controlled through the 'prefetch' argument.

        Jira projects may contain many different issue types. Some issue screens have different requirements for fields in a new issue.
        This information is available through the 'createmeta' set of methods.
        Further examples are available here: https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Create+Issue

        Args:
            fields (Optional[Dict[str, Any]]): a dict containing field names and the values to use. If present, all other keyword arguments will be ignored
            prefetch (bool): True reloads the created issue Resource so all of its data is present in the value returned (Default: ``True``)

        Returns:
            Issue
        rƒ   r  Nrv  Ú	issuetype©r  rù  rõ   rz   )rr   ro   rs   r_  r  )r…   r_   r  r«   r  rv  Úissue_type_by_namer¦  rÝ   r÷   rø   rù   rM   r   rr   rù  r1   rJ  )
r•   rƒ   Úprefetchr„   rö   ÚpÚ
project_idrs   rü   r½  s
             rZ   Úcreate_issuezJIRA.create_issue  se  € ô2  -¨VÑA°yÑAˆà�‰N˜9Ñ%ˆàˆ
Ü�aœ#œs˜Ô$ØŸ™¤c¨!£fÓ-×0Ñ0ˆJØ)-¨zÐ(:ˆD�‰N˜9Ñ%à�‰N˜;Ñ'ˆÜ�aœÔØ+/°¨)ˆD�‰N˜;Ò'Ü˜œ3Ôà�d×-Ñ-Ü˜“F±z¤C¨
¤OÀtð .ó ç‘"ð+ˆD�‰N˜;Ñ'ð �m‰m˜GÓ$ˆØ�M‰M×Ñ˜s¬¯©°DÓ)9ÐÓ:ˆä# A›ˆØ˜Ñ&ÜØŸM™M°A¸3ÄTÇZÁZÐPTÓEUôð ñ Ø—:‘:˜n¨UÑ3Ó4Ð4ä˜Ÿ™¨¯©¸>ÔJÐJri   c                ó†  — dg i}|D ]Ý  }t        |«      }|d   d   }d}t        |t        t        f«      r.| j	                  t        |«      «      j
                  }d|i|d   d<   |d   d   }t        |t        «      rd|i|d   d<   nKt        |t        «      r;d| j                  t        |«      |rt        |«      nd¬«      j
                  i|d   d<   |d   j                  |«       Œß | j                  d«      }	 | j                  j                  |t        j                  |«      ¬	«      }	t        |	«      }
g }i }|
d   D ]  }|d   d   ||d   <   Œ t'        |«      D ]†  \  }}||v r|j                  d||   d|dœ«       Œ$|
d   j)                  d«      }|r| j+                  |d   «      }n"t-        | j.                  | j                  |¬«      }|j                  d|d|dœ«       Œˆ |S # t        $ rQ}|j                  d
k(  r6|j                   �*t        j"                  |j                   j$                  «      }
n‚ Y d}~�Œd}~ww xY w)a:  Bulk create new issues and return an issue Resource for each successfully created issue.

        See `create_issue` documentation for field information.

        Args:
            field_list (List[Dict[str, Any]]): a list of dicts each containing field names and the values to use. Each dict is an individual issue to create and is subject to its minimum requirements.
            prefetch (bool): True reloads the created issue Resource so all of its data is present in the value returned (Default: ``True``)

        Returns:
            List[Dict[str, Any]]
        ÚissueUpdatesrƒ   r  Nrv  r‰  rŠ  z
issue/bulkrõ   i�  ÚerrorsÚelementErrorsÚfailedElementNumberÚError)Ústatusr^  rù  Úinput_fieldsÚissuesr   rz   r  ÚSuccess)r–  rù  r^  r—  )r…   r_   r  r«   r  rv  r‹  ry   r¦  rÝ   r÷   rø   rù   rM   r   rr   ro   r˜  r_  Ú	enumerateÚpoprù  r1   rJ  )r•   Ú
field_listrŒ  rö   Ú
field_dictÚ
issue_datar�  rŽ  rs   rü   r½  ÚjeÚ
issue_listr’  r^  Úindexrƒ   rù  s                     rZ   Úcreate_issueszJIRA.create_issuesN  sk  € ð "0°Ð 4ˆØ$ò 	4ˆJÜ)6°zÓ)BˆJØ˜8Ñ$ YÑ/ˆAàˆJÜ˜!œc¤3˜ZÔ(Ø!Ÿ\™\¬#¨a«&Ó1×4Ñ4�
Ø37¸Ð2D�
˜8Ñ$ YÑ/à˜8Ñ$ [Ñ1ˆAÜ˜!œSÔ!Ø59¸1°I�
˜8Ñ$ [Ò1Ü˜AœsÔ#à˜$×1Ñ1Ü˜A›¹:¬¨J¬È4ð 2ó ç‘bð5�
˜8Ñ$ [Ñ1ð �Ñ ×'Ñ'¨
Õ3ð'	4ð* �m‰m˜LÓ)ˆð		Ø—‘×"Ñ" 3¬T¯Z©Z¸Ó-=Ð"Ó>ˆAÜ'¨›]ˆNð ˆ
ØˆØ# HÑ-ò 	TˆEØ38¸Ñ3IÈ(Ñ3SˆF�5Ð.Ñ/Ò0ð	Tä& zÓ2ò 	‰MˆE�6Ø˜‰Ø×!Ñ!à")Ø!'¨¡Ø!%Ø(.ñ	õð ' xÑ0×4Ñ4°QÓ7�ÙØ ŸJ™J u¨U¡|Ó4‘Eä! $§-¡-°·±ÀEÔJ�EØ×!Ñ!à"+Ø!&Ø!%Ø(.ñ	õð!	ð0 ÐøôC ò 	Ø�~‰~ Ò$¨¯©Ð)@Ü!%§¡¨B¯K©K×,<Ñ,<Ó!=‘àõ ûð	ús   Ã9;G& Ç&	I Ç/AH;È;I c                ó    — | j                   dz   }ddi}	 | j                  j                  ||¬«      }|j                  dk(  S # t        $ r Y yw xY w)z_Returns if the Jira instance supports service desk.

        Returns:
            bool
        z/rest/servicedeskapi/infoúX-ExperimentalApiúopt-in©r
  éÈ   F)rN  rÝ   r_  rr   r   )r•   rs   r
  rü   s       rZ   Úsupports_service_deskzJIRA.supports_service_desk›  s\   € ð �o‰oÐ ;Ñ;ˆØ&¨Ð1ˆð	Ø—‘×!Ñ! #¨wÐ!Ó7ˆAØ—=‘= CÑ'Ð'øÜò 	Ùð	ús   •+A Á	AÁAc           	     ó6  — | j                   dz   }ddi}| j                  j                  ||t        j                  ||dœ«      ¬«      }t        |«      }|j                  dk7  rt        |j                  |¬«      ‚t        | j                  | j                  |¬«      S )	zÖCreate a new customer and return an issue Resource for it.

        Args:
            email (str): Customer Email
            displayName (str): Customer display name

        Returns:
            Customer
        z/rest/servicedeskapi/customerr¤  r¥  )rv  rp  r^  éÉ   r;  r  )
rN  rÝ   r÷   rø   rù   rM   rr   r   r(   rJ  )r•   rv  rp  rs   r
  rü   Úraw_customer_jsons          rZ   Úcreate_customerzJIRA.create_customer©  sŽ   € ð �o‰oÐ ?Ñ?ˆØ&¨Ð1ˆØ�M‰M×ÑØØÜ—‘ e¸KÑHÓIð ó 
ˆô ' q›MÐà�=‰=˜CÒÜ¨¯©¸qÔAÐAÜ˜Ÿ™ t§}¡}Ð:KÔLÐLri   c                óä   — | j                   dz   }ddi}t        | j                  j                  ||¬«      «      }|d   D �cg c]#  }t	        | j
                  | j                  |«      ‘Œ% }}|S c c}w )z—Get a list of ServiceDesk Resources from the server visible to the current authenticated user.

        Returns:
            List[ServiceDesk]
        z /rest/servicedeskapi/servicedeskr¤  r¥  r¦  r×   )rN  rM   rÝ   r_  rC   rJ  )r•   rs   r
  rT  Úraw_project_jsonÚprojectss         rZ   Úservice_deskszJIRA.service_desksÁ  s}   € ð �o‰oÐ BÑBˆØ&¨Ð1ˆÜ˜DŸM™M×-Ñ-¨c¸7Ð-ÓCÓDˆð %+¨8Ñ$4ö
à ô ˜Ÿ™ t§}¡}Ð6FÕGð
ˆð 
ð ˆùò	
s   Á(A-c                ó.   — | j                  t        |«      S )z©Get a Service Desk Resource from the server.

        Args:
            id (str): ID or key of the Service Desk to get

        Returns:
            ServiceDesk
        )rÛ  rC   rÜ  s     rZ   Úservice_deskzJIRA.service_deskÐ  s   € ð ×&Ñ&¤{°BÓ7Ð7ri   c                ó~  — |}|d   }d}t        |t        t        f«      r| j                  |«      }nt        |t        «      r|}|j
                  |d<   |d   }t        |t        «      r||d<   n/t        |t        «      r| j                  ||«      j
                  |d<   | j                  dz   }ddi}| j                  j                  ||t        j                  |«      ¬«      }	t        |	«      }
d|
vrt        |	j                  |	¬	«      ‚|r| j                  |
d   «      S t!        | j"                  | j                  |
¬
«      S )aÎ  Create a new customer request and return an issue Resource for it.

        Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value is treated as the
        intended value for that field -- if the fields argument is used, all other keyword arguments will be ignored.

        By default, the client will immediately reload the issue Resource created by this method in order to return a complete Issue object to the caller;
        this behavior can be controlled through the 'prefetch' argument.

        Jira projects may contain many issue types. Some issue screens have different requirements for fields in a new issue.
        This information is available through the 'createmeta' set of methods.
        Further examples are available here: https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Create+Issue

        Args:
            fields (Dict[str, Any]): a dict containing field names and the values to use. If present, all other keyword arguments will be ignored
            prefetch (bool): True reloads the created issue Resource so all of its data is present in the value returned (Default: ``True``)

        Returns:
            Issue
        ÚserviceDeskIdNÚrequestTypeIdz/rest/servicedeskapi/requestr¤  r¥  r^  ÚissueKeyr;  r  )r_   r  r«   r²  rC   rv  Úrequest_type_by_namerN  rÝ   r÷   rø   rù   rM   r   rr   rù  r1   rJ  )r•   rƒ   rŒ  r„   rö   r�  r²  rs   r
  rü   r½  s              rZ   Úcreate_customer_requestzJIRA.create_customer_requestÛ  s%  € ð. ˆà�Ñ!ˆØˆä�aœ#œs˜Ô$Ø×,Ñ,¨QÓ/‰LÜ˜œ;Ô'ØˆLà ,§¡ˆˆ_Ñà�Ñ!ˆÜ�aœÔØ$%ˆD�Ò!Ü˜œ3ÔØ$(×$=Ñ$=¸lÈAÓ$N×$QÑ$QˆD�Ñ!à�o‰oÐ >Ñ>ˆØ&¨Ð1ˆØ�M‰M×Ñ˜s¨G¼$¿*¹*ÀTÓ:JÐÓKˆä# A›ˆØ˜^Ñ+Ü¨¯©¸qÔAÐAÙØ—:‘:˜n¨ZÑ8Ó9Ð9ä˜Ÿ™¨¯©¸>ÔJÐJri   c                ó†   — | j                   s| j                  dk  r&t        d| j                  › d| j                  › d�«      ‚y)zÓCheck whether Jira deployment supports the createmeta issuetypes endpoint.

        Raises:
            JIRAError: If the deployment does not support the API endpoint.

        Returns:
            None
        ©é   é   r   z"Unsupported JIRA deployment type: z or version: z. Use 'createmeta' instead.N)ra   r\  r   r;  rž   s    rZ   Ú_check_createmeta_issuetypesz!JIRA._check_createmeta_issuetypes  sO   € ð �>Š>˜TŸ]™]¨YÒ6ÜØ4°T×5HÑ5HÐ4IÈÐW[×WdÑWdÐVeð f,ð ,óð ð 7ri   c                óŽ   — t        j                  dt        d¬«       | j                  «        | j	                  d|› d�||dœ¬«      S )a®  Get the issue types metadata for a given project, required to create issues.

        .. deprecated:: 3.6.0
            Use :func:`project_issue_types` instead.

        This API was introduced in JIRA Server / DC 8.4 as a replacement for the more general purpose API 'createmeta'.
        For details see: https://confluence.atlassian.com/jiracore/createmeta-rest-endpoint-to-be-removed-975040986.html

        Args:
            projectIdOrKey (Union[str, int]): id or key of the project for which to get the metadata.
            startAt (int): Index of the first issue to return. (Default: ``0``)
            maxResults (int): Maximum number of issues to return.
              Total number of results is available in the ``total`` attribute of the returned :class:`ResultList`.
              If maxResults evaluates to False, it will try to get all issues in batches. (Default: ``50``)

        Returns:
            Dict[str, Any]
        zo'createmeta_issuetypes' is deprecated and will be removed in future releases.Use 'project_issue_types' instead.é   ©Ú
stacklevelúissue/createmeta/ú/issuetypes©rŽ   r�   r™  ©rA  rB  rC  r½  r£  )r•   ÚprojectIdOrKeyrŽ   r�   s       rZ   Úcreatemeta_issuetypeszJIRA.createmeta_issuetypes  sW   € ô0 	�‰ð1äØõ		
ð 	×)Ñ)Ô+Ø�~‰~Ø Ð/¨{Ð;à"Ø(ñð ó 
ð 	
ri   c                ó’   — t        j                  dt        d¬«       | j                  «        | j	                  d|› d|› �||dœ¬«      S )a  Get the field metadata for a given project and issue type, required to create issues.

        .. deprecated:: 3.6.0
            Use :func:`project_issue_fields` instead.

        This API was introduced in JIRA Server / DC 8.4 as a replacement for the more general purpose API 'createmeta'.
        For details see: https://confluence.atlassian.com/jiracore/createmeta-rest-endpoint-to-be-removed-975040986.html

        Args:
            projectIdOrKey (Union[str, int]): id or key of the project for which to get the metadata.
            issueTypeId (Union[str, int]): id of the issue type for which to get the metadata.
            startAt (int): Index of the first issue to return. (Default: ``0``)
            maxResults (int): Maximum number of issues to return.
              Total number of results is available in the ``total`` attribute of the returned :class:`ResultList`.
              If maxResults evaluates to False, it will try to get all issues in batches. (Default: ``50``)

        Returns:
            Dict[str, Any]
        zp'createmeta_fieldtypes' is deprecated and will be removed in future releases.Use 'project_issue_fields' instead.r¿  rÀ  rÂ  ú/issuetypes/rÄ  r™  rÅ  )r•   rÆ  ÚissueTypeIdrŽ   r�   s        rZ   Úcreatemeta_fieldtypeszJIRA.createmeta_fieldtypesF  s[   € ô4 	�‰ð2äØõ		
ð 	×)Ñ)Ô+Ø�~‰~Ø Ð/¨|¸K¸=ÐIà"Ø(ñð ó 
ð 	
ri   c                óp  — | j                   sS| j                  dk\  rt        d| j                  › d�«      ‚| j                  dk\  rt        j                  dt
        d¬«       i }|�||d<   |�&t        |t        «      r|j                  d	«      }||d
<   |�||d<   |�||d<   |�||d<   | j                  d|«      S )a"  Get the metadata required to create issues, optionally filtered by projects and issue types.

        Args:
            projectKeys (Optional[Union[Tuple[str, str], str]]): keys of the projects to filter the results with.
              Can be a single value or a comma-delimited string. May be combined with projectIds.
            projectIds (Union[List, Tuple[str, str]]): IDs of the projects to filter the results with.
              Can be a single value or a comma-delimited string. May be combined with projectKeys.
            issuetypeIds (Optional[List[str]]): IDs of the issue types to filter the results with.
              Can be a single value or a comma-delimited string. May be combined with issuetypeNames.
            issuetypeNames (Optional[str]): Names of the issue types to filter the results with.
              Can be a single value or a comma-delimited string. May be combined with issuetypeIds.
            expand (Optional[str]): extra information to fetch inside each resource.

        Returns:
            Dict[str, Any]
        )é	   r   r   zUnsupported JIRA version: z?. Use 'project_issue_types' and 'project_issue_fields' instead.rº  zƒThis API have been deprecated in JIRA 8.4 and is removed in JIRA 9.0. Use 'project_issue_types' and 'project_issue_fields' instead.r¿  rÀ  ÚprojectKeysrÄ   Ú
projectIdsÚissuetypeIdsÚissuetypeNamesrc  zissue/createmeta)
ra   r\  r   rA  rB  rC  r_   r  Úsplitr£  )r•   rÎ  rÏ  rÐ  rÑ  rc  rÒ   s          rZ   Ú
createmetazJIRA.createmetao  sæ   € ð0 �~Š~Ø�}‰} 	Ò)ÜØ0°·±°ð @Tð Tóð ð —‘ )Ò+Ü—‘ðTä&Ø õ	ð "$ˆØÐ"Ø$/ˆF�=Ñ!ØÐ!Ü˜*¤cÔ*Ø'×-Ñ-¨cÓ2�
Ø#-ˆF�<Ñ ØÐ#Ø%1ˆF�>Ñ"ØÐ%Ø'5ˆFÐ#Ñ$ØÐØ%ˆF�8ÑØ�~‰~Ð0°&Ó9Ð9ri   c                óJ   — | j                   r|j                  S |j                  S )a  Get the unique identifier depending on the deployment type.

        - Cloud: 'accountId'
        - Self Hosted: 'name' (equivalent to username).

        Args:
            user (User): a User object

        Returns:
            str: the User's unique identifier.
        )ra   ro  r{   )r•   rn  s     rZ   Ú_get_user_identifierzJIRA._get_user_identifier¤  s   € ð "&§¢ˆt�~‰~Ð>°T·Y±YÐ>ri   c                ó¦  — |dv r|S 	 | j                   r| j                  |d¬«      }n| j                  |d¬«      }t        |«      dk  rt        d|› d�«      ‚g }t        |«      dkD  r$|D �cg c]  }| j	                  |«      |k(  sŒ|‘Œ }}|r|d   n|d   }| j	                  |«      S c c}w # t
        $ r}t        t        |«      «      ‚d	}~ww xY w)
a‘  Internal method for translating a user search (str) to an id.

        Return None and -1 unchanged.

        This function uses :py:meth:`JIRA.search_users` to find the user and then using :py:meth:`JIRA._get_user_identifier` extracts
        the relevant identifier property depending on whether the instance is a Cloud or self-hosted Instance.

        Args:
            user (Optional[str]): The search term used for finding a user. None, '-1' and -1 are equivalent to 'Unassigned'.

        Raises:
            JIRAError: If any error occurs.

        Returns:
            Optional[str]: The Jira user's identifier. Or "-1" and None unchanged.
        )Nr5  z-1é   )rÊ   r�   )rn  r�   rœ   zNo matching user found for: 'ú'r   N)ra   Úsearch_usersr‘   r   rÕ  r]  r  )r•   rn  rk  ÚmatchesÚuÚuser_objrt   s          rZ   Ú_get_user_idzJIRA._get_user_id²  sè   € ð" Ð#Ñ#ØˆKð	$à�~Š~Ø×)Ñ)°ÀÐ)ÓD‘à×)Ñ)¨tÀÐ)ÓC�ä�5‹z˜AŠ~ÜÐ"?À¸vÀQÐ GÓHÐHàˆGÜ�5‹z˜AŠ~Ø&+ÖT ¨t×/HÑ/HÈÓ/KÈtÓ/Sš1ÐT�ÐTÙ%,�w˜q’z°%¸±(ˆHð ×(Ñ(¨Ó2Ð2ùò Uøô ò 	$ÜœC ›FÓ#Ð#ûð	$ús0   ˆA$B. Á,B)ÂB)Â
B. Â)B. Â.	CÂ7CÃCc                óØ   — | j                  d|› d�«      }| j                  |«      }| j                  rd|ind|i}| j                  j	                  |t        j                  |«      ¬«       y)a  Assign an issue to a user.

        Args:
            issue (Union[int, str]): the issue ID or key to assign
            assignee (str): the user to assign the issue to. None will set it to unassigned. -1 will set it to Automatic.

        Returns:
            bool
        ró  z	/assigneero  r{   rõ   T)rÑ  rÝ  ra   rÝ   rÒ  rø   rù   )r•   rù  Úassigneers   Úuser_idrÓ  s         rZ   Úassign_issuezJIRA.assign_issueÙ  sg   € ð ×"Ñ" V¨E¨7°)Ð#<Ó=ˆØ×#Ñ# HÓ-ˆØ,0¯NªN�; Ñ(ÀÈÐ@QˆØ�‰×Ñ˜#¤D§J¡J¨wÓ$7ÐÔ8Øri   c                ó²   — i }|�||d<   | j                  d|› d�|¬«      }|d   D �cg c]#  }t        | j                  | j                  |«      ‘Œ% }}|S c c}w )aA  Get a list of comment Resources of the issue provided.

        Args:
            issue (Union[int, str]): the issue ID or key to get the comments from
            expand (Optional[str]): extra information to fetch for each comment such as renderedBody and properties.

        Returns:
            List[Comment]
        rc  ró  ú/commentr™  Úcomments)r£  r&   rJ  rÝ   )r•   rù  rc  rÒ   rT  Úraw_comment_jsonrä  s          rZ   rä  zJIRA.commentsê  sv   € ð ˆØÐØ%ˆF�8ÑØ—‘ &¨¨¨xÐ 8À�ÓHˆð %+¨:Ñ$6ö
à ô �D—M‘M 4§=¡=Ð2BÕCð
ˆð 
ð ˆùò	
ó   ¨(Ac                ó6   — | j                  t        ||f|¬«      S )at  Get a comment Resource from the server for the specified ID.

        Args:
            issue (Union[int, str]): the issue ID or key to get the comment from
            comment (str): ID of the comment to get
            expand (Optional[str]): extra information to fetch for each comment such as renderedBody and properties.

        Returns:
            Comment
        ©rc  )rÛ  r&   )r•   rù  Úcommentrc  s       rZ   ré  zJIRA.comment 	  s!   € ð ×&Ñ&¤w°¸Ð0@ÈÐ&ÓPÐPri   c                ó(  — d|i}|rdd|idœg|d<   |�||d<   | j                  dt        |«      z   dz   «      }| j                  j                  |t	        j
                  |«      ¬	«      }t        | j                  | j                  t        |«      ¬
«      S )a  Add a comment from the current authenticated user on the specified issue and return a Resource for it.

        Args:
            issue (Union[str, int, jira.resources.Issue]): ID or key of the issue to add the comment to
            body (str): Text of the comment to add
            visibility (Optional[Dict[str, str]]): a dict containing two entries: "type" and "value".
              "type" is 'role' (or 'group' if the Jira server has configured comment visibility for groups)
              "value" is the name of the role (or group) to which viewing of this comment will be restricted.
            is_internal (bool): True marks the comment as 'Internal' in Jira Service Desk (Default: ``False``)

        Returns:
            Comment: the created comment
        Úbodyzsd.public.commentÚinternal)rz   rÙ   r‡  Ú
visibilityró  rã  rõ   r  )	r¦  r  rÝ   r÷   rø   rù   r&   rJ  rM   )r•   rù  rë  rí  Úis_internalrö   rs   rü   s           rZ   Úadd_commentzJIRA.add_comment	  s”   € ð* !'¨˜~ˆáà+°zÀ;Ð6OÑPð"ˆD�Ñð Ð!Ø!+ˆD�Ñà�m‰m˜H¤s¨5£zÑ1°JÑ>Ó?ˆØ�M‰M×Ñ˜s¬¯©°DÓ)9ÐÓ:ˆä�t—}‘} d§m¡m¼ÀA»ÔGÐGri   c                óB   — | j                  dt        |«      z   dz   «      S )zÁGet the edit metadata for an issue.

        Args:
            issue (Union[str, int]): the issue to get metadata for

        Returns:
            Dict[str, Dict[str, Dict[str, Any]]]
        ró  z	/editmetar  ©r•   rù  s     rZ   ÚeditmetazJIRA.editmeta4	  s!   € ð �~‰~˜h¬¨U«Ñ3°kÑAÓBÐBri   c                ó¬   — | j                  dt        |«      z   dz   «      }|D �cg c]#  }t        | j                  | j                  |«      ‘Œ% }}|S c c}w )zÁGet a list of remote link Resources from an issue.

        Args:
            issue (Union[str, int]): the issue to get remote links from

        Returns:
            List[RemoteLink]
        ró  ú/remotelink)r£  r  r=   rJ  rÝ   )r•   rù  rT  Úraw_remotelink_jsonÚremote_linkss        rZ   rö  zJIRA.remote_links@	  s^   € ð —‘ ¬3¨u«:Ñ 5¸Ñ EÓFˆð (.ö
à#ô �t—}‘} d§m¡mÐ5HÕIð
ˆð 
ð Ðùò	
s   ¥(Ac                ó2   — | j                  t        ||f«      S )zßGet a remote link Resource from the server.

        Args:
            issue (Union[str, int]): the issue holding the remote link
            id (str): ID of the remote link

        Returns:
            RemoteLink
        )rÛ  r=   ©r•   rù  rv  s      rZ   Úremote_linkzJIRA.remote_linkQ	  s   € ð ×&Ñ&¤z°E¸2°;Ó?Ð?ri   c                ó  — 	 | j                  «       }i }t        |t        «      r‘|j                  r…t        |«      |j                  «       dœ|d<   |D ]R  }	|	d   d   |j                  d   k(  sŒd	j                  |	d   d
   |j                  d
   «      |d<   |	d   d   ddœ|d<    n d|vrt        d«      ‚|�||d<   |�||d<   ||d<   |�||d<   t        |t        «      r`|j                  rT|D ]O  }	|	d   d   | j                  k(  sŒd	j                  |	d   d
   |j                  d
   «      |d<   |	d   d   ddœ|d<    n | j!                  dt        |«      z   dz   «      }
| j"                  j%                  |
t'        j(                  |«      ¬«      }t+        | j                  | j"                  t-        |«      ¬«      }|S # t        $ rA}g }t        j                  d|j                  › d|j
                  › �t        «       Y d}~�Œïd}~ww xY w)a<  Add a remote link from an issue to an external application and returns a remote link Resource for it.

        ``destination`` should be a dict containing at least ``url`` to the linked external URL and ``title`` to display for the link inside Jira.

        For definitions of the allowable fields for ``destination`` and the keyword arguments ``globalId``, ``application`` and ``relationship``,
        see https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+for+Remote+Issue+Links.

        Args:
            issue (str): the issue to add the remote link to
            destination (Union[Issue, Dict[str, Any]]): the link details to add (see the above link for details)
            globalId (Optional[str]): unique ID for the link (see the above link for details)
            application (Optional[Dict[str,Any]]): application information for the link (see the above link for details)
            relationship (Optional[str]): relationship description for the link (see the above link for details)

        Returns:
            RemoteLink: the added remote link
        zXUnable to gather applicationlinks; you will not be able to add links to remote issues: (z) N)rJ  rs   ÚobjectÚapplicationÚ
displayUrlr  zappId={}&issueId={}rv  ÚglobalIdr{   zcom.atlassian.jira)r{   Útypez(Unable to identify the issue to link to.Úrelationshipró  rô  rõ   r  )rÙ  r   rA  rB  rr   r_  ÚWarningr_   r1   rZ  r  Ú	permalinkrJ  r}  rz  rN  r¦  rÝ   r÷   rø   rù   r=   rM   )r•   rù  Údestinationrþ  rü  r   rÙ  rt   rö   r�  rs   rü   rù  s                rZ   Úadd_remote_linkzJIRA.add_remote_link`	  sJ  € ð2	Ø+/×+@Ñ+@Ó+BÐð  "ˆÜ�k¤5Ô)¨k¯oªoÜ'*¨;Ó'7À×@UÑ@UÓ@WÑXˆD�‰NØ%ò 
�Ø�]Ñ# LÑ1°[×5IÑ5IÈ(Ñ5SÓSØ'<×'CÑ'CØ˜-Ñ(¨Ñ.Ø#Ÿ™¨Ñ-ó(�D˜Ñ$ð
 !" -Ñ 0°Ñ 8Ø 4ñ+�D˜Ñ'ñ ð
ð  Ñ%Ü)Ð*TÓUÐUàÐ#Ø#+��ZÑ ØÐ&Ø&1��]Ñ#Ø(ˆD�‰NàÐ#Ø#/ˆD�Ñ ô �k¤5Ô)¨k¯oªoØ%ò 
�Ø�]Ñ# LÑ1°T·_±_ÓDØ'<×'CÑ'CØ˜-Ñ(¨Ñ.Ø#Ÿ™¨Ñ-ó(�D˜Ñ$ð
 !" -Ñ 0°Ñ 8Ø 4ñ+�D˜Ñ'ñ ð
ð �m‰m˜H¤s¨5£zÑ1°MÑAÓBˆØ�M‰M×Ñ˜s¬¯©°DÓ)9ÐÓ:ˆä  §¡°·±Ä:ÈaÃ=ÔQˆØÐøôq ò 
	Ø!Ðô
 �M‰Mð3Ø34·=±=°/ÀÀAÇFÁFÀ8ðMä÷ò ûð
	ús   ‚F< Æ<	HÇ6HÈHc                ó  — d|i}| j                  dt        |«      z   dz   «      }| j                  j                  |t	        j
                  |«      ¬«      }t        | j                  | j                  t        |«      ¬«      }|S )aý  Add a simple remote link from an issue to web resource.

        This avoids the admin access problems from add_remote_link by just using a simple object and presuming all fields are correct
        and not requiring more complex ``application`` data.

        ``object`` should be a dict containing at least ``url`` to the linked external URL and ``title`` to display for the link inside Jira

        For definitions of the allowable fields for ``object`` ,
        see https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+for+Remote+Issue+Links.

        Args:
            issue (str): the issue to add the remote link to
            object (Dict[str,Any]): the dictionary used to create remotelink data

        Returns:
            RemoteLink
        rû  ró  rô  rõ   r  )	r¦  r  rÝ   r÷   rø   rù   r=   rJ  rM   )r•   rù  rû  rö   rs   rü   Úsimple_links          rZ   Úadd_simple_linkzJIRA.add_simple_linkµ	  sl   € ð$ ˜&Ð!ˆØ�m‰m˜H¤s¨5£zÑ1°MÑAÓBˆØ�M‰M×Ñ˜s¬¯©°DÓ)9ÐÓ:ˆä  §¡°·±Ä:ÈaÃ=ÔQˆØÐri   c                ól   — i }|�||d<   |�||d<   | j                  dt        |«      z   dz   |¬«      d   S )a³  Get a list of the transitions available on the specified issue to the current user.

        Args:
            issue (Union[str, int, jira.resources.Issue]): ID or key of the issue to get the transitions from
            id (Optional[str]): if present, get only the transition matching this ID
            expand (Optional): extra information to fetch inside each transition

        Returns:
            Any: json of response
        ÚtransitionIdrc  ró  ú/transitionsr™  Útransitionsr  )r•   rù  rv  rc  rÒ   s        rZ   r  zJIRA.transitionsÏ	  sS   € ð ˆØˆ>Ø%'ˆF�>Ñ"ØÐØ%ˆF�8ÑØ�~‰~˜h¬¨U«Ñ3°nÑDÈVˆ~ÓTØñ
ð 	
ri   c                ó’   — | j                  |«      }d}|D ].  }|d   j                  «       |j                  «       k(  sŒ(|d   } |S  |S )aÕ  Get a transitionid available on the specified issue to the current user.

        Look at https://developer.atlassian.com/static/rest/jira/6.1.html#d2e1074 for json reference

        Args:
            issue (Union[str, int, jira.resources.Issue]): ID or key of the issue to get the transitions from
            transition_name (str): name of transition we are looking for

        Returns:
            Optional[int]: returns the id is found None when it's not
        Nr{   rv  )r  Úlower)r•   rù  Útransition_nameÚtransitions_jsonrv  Ú
transitions         rZ   Úfind_transitionid_by_namezJIRA.find_transitionid_by_nameä	  sa   € ð  ×+Ñ+¨EÓ2ÐØˆà*ò 	ˆJØ˜&Ñ!×'Ñ'Ó)¨_×-BÑ-BÓ-DÓDØ Ñ%�ØØˆ	ð		ð ˆ	ri   c                óD  — d}	 t        |«      }dd|ii}i }	|r
dd|iig|	d<   |r
dd|iig|	d	<   |s|r|	|d
<   |�||d<   ni }
|D ]
  }||   |
|<   Œ |
|d<   | j	                  dt        |«      z   dz   «      }| j                  j                  |t        j                  |«      ¬«      }	 t        |«      }|S # t        $ r% | j                  ||«      }|€t        d|› �«      ‚Y ŒÒw xY w# t        $ r1}| j                  j                  |› d|j                  › �«       |‚d}~ww xY w)aÀ  Perform a transition on an issue.

        Each keyword argument (other than the predefined ones) is treated as a field name and the argument's value is treated as the intended value for that field -- if the fields argument is used,
        all other keyword arguments will be ignored. Field values will be set on the issue as part of the transition process.

        Args:
            issue (Union[str, int, jira.resources.Issue]): ID or key of the issue to perform the transition on
            transition (str): ID or name of the transition to perform
            fields (Optional[Dict[str,Any]]): a dict containing field names and the values to use.
            comment (Optional[str]): String to add as comment to the issue when performing the transition.
            worklog (Optional[str]): String to add as time spent on the issue when performing the transition.
            **fieldargs: If present, all other keyword arguments will be ignored
        NzInvalid transition name. r  rv  Úaddrë  ré  Ú	timeSpentÚworklogrK  rƒ   ró  r
  rõ   ú
)r«   r]  r  r   r¦  r  rÝ   r÷   rø   rù   rM   Ú
ValueErrorrb   r^  r_  )r•   rù  r  rƒ   ré  r  r„   r	  rö   Úupdate_dictÚfields_dictrP  rs   rü   rT  rt   s                   rZ   Útransition_issuezJIRA.transition_issueû	  sv  € ð. $(ˆð	JÜ˜z›?ˆLð !-¨t°\Ð.BÐCˆØ&(ˆÙØ',¨v°wÐ.?Ð&@Ð%AˆK˜	Ñ"ÙØ',¨{¸GÐ.DÐ&EÐ%FˆK˜	Ñ"Ù‘gØ(ˆD�‰NØÐØ#ˆD�ŠNàˆKØ"ò 6�Ø%.¨uÑ%5�˜EÒ"ð6à(ˆD�‰Nà�m‰m˜H¤s¨5£zÑ1°NÑBÓCˆØ�M‰M×Ñ˜s¬¯©°DÓ)9ÐÓ:ˆð	Ü “]ˆFð ˆøô; ò 	Jà×9Ñ9¸%ÀÓLˆLØÐ#ÜÐ";¸J¸<Ð HÓIÐIñ $ð	Jûô4 ò 	Ø�H‰H�N‰N˜a˜S  1§6¡6 (Ð+Ô,ØˆGûð	ús)   „B4 Â'C% Â4+C"Ã!C"Ã%	DÃ.,DÄDc                ó.   — | j                  t        |«      S )z±Get a votes Resource from the server.

        Args:
            issue (Union[str, int]): ID or key of the issue to get the votes for
        Returns:
            Votes
        )rÛ  rI   rñ  s     rZ   Úvotesz
JIRA.votes5
  s   € ð ×&Ñ&¤u¨eÓ4Ð4ri   c                ó.   — | j                  t        |«      S )a  Get a IssueSecurityLevelScheme Resource from the server.

        Args:
            project (str): ID or key of the project to get the IssueSecurityLevelScheme for

        Returns:
            IssueSecurityLevelScheme: The issue security level scheme
        )rÛ  r5   ©r•   r  s     rZ   Ú#project_issue_security_level_schemez(JIRA.project_issue_security_level_scheme@
  s   € ð ×&Ñ&Ô'?ÀÓIÐIri   c                ó.   — | j                  t        |«      S )zêGet a NotificationScheme Resource from the server.

        Args:
            project (str): ID or key of the project to get the NotificationScheme for

        Returns:
            NotificationScheme: The notification scheme
        )rÛ  r8   r  s     rZ   Úproject_notification_schemez JIRA.project_notification_schemeN
  s   € ð ×&Ñ&Ô'9¸7ÓCÐCri   c                ó.   — | j                  t        |«      S )zâGet a PermissionScheme Resource from the server.

        Args:
            project (str): ID or key of the project to get the permissionscheme for

        Returns:
            PermissionScheme: The permission scheme
        )rÛ  r9   r  s     rZ   Úproject_permissionschemezJIRA.project_permissionschemeZ
  s   € ð ×&Ñ&Ô'7¸ÓAÐAri   c                ó.   — | j                  t        |«      S )zÚGet a PriorityScheme Resource from the server.

        Args:
            project (str): ID or key of the project to get the PriorityScheme for

        Returns:
            PriorityScheme: The priority scheme
        )rÛ  r;   r  s     rZ   Úproject_priority_schemezJIRA.project_priority_schemef
  ó   € ð ×&Ñ&¤~°wÓ?Ð?ri   c                ó.   — | j                  t        |«      S )zÚGet a WorkflowScheme Resource from the server.

        Args:
            project (str): ID or key of the project to get the WorkflowScheme for

        Returns:
            WorkflowScheme: The workflow scheme
        )rÛ  rK   r  s     rZ   Úproject_workflow_schemezJIRA.project_workflow_schemer
  r&  ri   c                óx   — | j                  dt        |«      z   dz   «      }| j                  j                  |«      S )zÅRegister a vote for the current authenticated user on an issue.

        Args:
            issue (Union[str, int]): ID or key of the issue to vote on

        Returns:
            Response
        ró  ú/votes)r¦  r  rÝ   r÷   ©r•   rù  rs   s      rZ   Úadd_votezJIRA.add_vote~
  s5   € ð �m‰m˜H¤s¨5£zÑ1°HÑ<Ó=ˆØ�}‰}×!Ñ! #Ó&Ð&ri   c                óz   — | j                  dt        |«      z   dz   «      }| j                  j                  |«       y)z¡Remove the current authenticated user's vote from an issue.

        Args:
            issue (Union[str, int]): ID or key of the issue to remove vote on
        ró  r*  Nr   r+  s      rZ   Úremove_votezJIRA.remove_vote‹
  s2   € ð �m‰m˜H¤s¨5£zÑ1°HÑ<Ó=ˆØ�‰×Ñ˜SÕ!ri   c                ó.   — | j                  t        |«      S )zÈGet a watchers Resource from the server for an issue.

        Args:
            issue (Union[str, int]): ID or key of the issue to get the watchers for

        Returns:
            Watchers
        )rÛ  rJ   rñ  s     rZ   ÚwatcherszJIRA.watchers•
  s   € ð ×&Ñ&¤x°Ó7Ð7ri   c                óÄ   — | j                  dt        |«      z   dz   «      }| j                  |«      }| j                  j	                  |t        j                  |«      ¬«      S )zóAdd a user to an issue's watchers list.

        Args:
            issue (Union[str, int]): ID or key of the issue affected
            watcher (str): name of the user to add to the watchers list

        Returns:
            Response
        ró  ú	/watchersrõ   )r¦  r  rÝ  rÝ   r÷   rø   rù   )r•   rù  Úwatcherrs   Ú
watcher_ids        rZ   Úadd_watcherzJIRA.add_watcher¡
  sS   € ð �m‰m˜H¤s¨5£zÑ1°KÑ?Ó@ˆà×&Ñ& wÓ/ˆ
Ø�}‰}×!Ñ! #¬D¯J©J°zÓ,BÐ!ÓCÐCri   c                óÊ   — | j                  dt        |«      z   dz   «      }| j                  |«      }| j                  rd|ind|i}| j                  j                  ||¬«      }|S )zúRemove a user from an issue's watch list.

        Args:
            issue (Union[str, int]): ID or key of the issue affected
            watcher (str): name of the user to remove from the watchers list

        Returns:
            Response
        ró  r2  ro  ró   r™  )r¦  r  rÝ  ra   rÝ   r  )r•   rù  r3  rs   rà  rÓ  r}   s          rZ   Úremove_watcherzJIRA.remove_watcher±
  se   € ð �m‰m˜H¤s¨5£zÑ1°KÑ?Ó@ˆà×#Ñ# GÓ,ˆØ,0¯NªN�; Ñ(ÀÈWÐ@UˆØ—‘×%Ñ% c°'Ð%Ó:ˆØˆri   c                ó²   — | j                  dt        |«      z   dz   «      }|d   D �cg c]#  }t        | j                  | j                  |«      ‘Œ% }}|S c c}w )zÑGet a list of worklog Resources from the server for an issue.

        Args:
            issue (Union[str, int]): ID or key of the issue to get worklogs from
        Returns:
            List[Worklog]
        ró  ú/worklogÚworklogs)r£  r  rL   rJ  rÝ   )r•   rù  rT  Úraw_worklog_jsonr:  s        rZ   r:  zJIRA.worklogsÃ
  sb   € ð —‘ ¬3¨u«:Ñ 5¸
Ñ BÓCˆð %+¨:Ñ$6ö
à ô �D—M‘M 4§=¡=Ð2BÕCð
ˆð 
ð ˆùò	
ræ  c                ó2   — | j                  t        ||f«      S )zñGet a specific worklog Resource from the server.

        Args:
            issue (Union[str, int]): ID or key of the issue to get the worklog from
            id (str): ID of the worklog to get

        Returns:
            Worklog
        )rÛ  rL   rø  s      rZ   r  zJIRA.worklogÓ
  s   € ð ×&Ñ&¤w°¸°Ó<Ð<ri   c                ó  — i }|�||d<   |�||d<   |�||d<   i }|�||d<   |�||d<   |�||d<   n|	r|	|d<   |
�|
|d<   |�5|j                   €|j                  d«      |d	<   n|j                  d
«      |d	<   |	�"|	| j                  dz   |	z   |	ddœ|d<   |d   |d<   | j                  d|› d�«      }| j                  j                  ||t        j                  |«      ¬«      }t        | j                  | j                  t        |«      «      S )aÛ  Add a new worklog entry on an issue and return a Resource for it.

        Args:
            issue (Union[str, int]): the issue to add the worklog to
            timeSpent (Optional[str]): a worklog entry with this amount of time spent, e.g. "2d"
            timeSpentSeconds (Optional[str]): a worklog entry with this amount of time spent in seconds
            adjustEstimate (Optional[str]):  allows the user to provide specific instructions to update the remaining time estimate of the issue.
              The value can either be ``new``, ``leave``, ``manual`` or ``auto`` (default).
            newEstimate (Optional[str]): the new value for the remaining estimate field. e.g. "2d"
            reduceBy (Optional[str]): the amount to reduce the remaining estimate by e.g. "2d"
            comment (Optional[str]): optional worklog comment
            started (Optional[datetime.datetime]): Moment when the work is logged, if not specified will default to now
            user (Optional[str]): the user ID or name to use for this worklog
            visibility (Optional[Dict[str,Any]]): Details about any restrictions in the visibility of the worklog.
              Optional when creating or updating a worklog. ::
                ```js
                {
                    "type": "group", # "group" or "role"
                    "value": "<string>",
                    "identifier": "<string>" # OPTIONAL
                }
                ```

        Returns:
            Worklog
        ÚadjustEstimateÚnewEstimateÚreduceByr  ÚtimeSpentSecondsré  rí  z%Y-%m-%dT%H:%M:%S.000+0000Ústartedz%Y-%m-%dT%H:%M:%S.000%zz/rest/api/latest/user?username=F)r{   r•   rp  rs  ÚauthorÚupdateAuthorró  r9  ©rÒ   rö   )ÚtzinfoÚstrftimeÚJIRA_BASE_URLr¦  rÝ   r÷   rø   rù   rL   rJ  rM   )r•   rù  r  rA  r>  r?  r@  ré  rB  rn  rí  rÒ   rö   rs   rü   s                  rZ   Úadd_worklogzJIRA.add_worklogà
  s[  € ðP ˆØÐ%Ø'5ˆFÐ#Ñ$ØÐ"Ø$/ˆF�=Ñ!ØÐØ!)ˆF�:Ñà!ˆØÐ Ø )ˆD�ÑØÐ'Ø'7ˆDÐ#Ñ$ØÐØ%ˆD�ŠOÙà"ˆD�‰OàÐ!Ø!+ˆD�ÑØÐà�~‰~Ð%Ø")×"2Ñ"2Ð3OÓ"P��Y’à")×"2Ñ"2Ð3LÓ"M��Y‘ØÐàØ×*Ñ*Ð-NÑNÐQUÑUØ#Øñ	ˆD�‰Nð $(¨¡>ˆD�Ñ à�m‰m˜f U G¨8Ð4Ó5ˆØ�M‰M×Ñ˜s¨6¼¿
¹
À4Ó8HÐÓIˆä�t—}‘} d§m¡m´ZÀ³]ÓCÐCri   c                ó„   — | j                  d|› d�«      }|d   D �cg c]  }| j                  ||d   «      ‘Œ }}|S c c}w )zÔGet a list of issue property Resource from the server for an issue.

        Args:
            issue (str): ID or key of the issue to get properties from

        Returns:
            List[IssueProperty]
        ró  r2  rÎ   rz   )r£  Úissue_property)r•   rù  rT  rz   r‡  s        rZ   Úissue_propertieszJIRA.issue_properties3  sO   € ð —‘ &¨¨¨{Ð ;Ó<ˆØHNÈvÉÖWÀ�d×)Ñ)¨%°°U±Õ<ÐWˆ
ÐWØÐùò Xs   �=c                ó2   — | j                  t        ||f«      S )zõGet a specific issue property Resource from the server.

        Args:
            issue (str): ID or key of the issue to get the property from
            key (str): Key of the property to get
        Returns:
            IssueProperty
        )rÛ  r4   )r•   rù  rz   s      rZ   rK  zJIRA.issue_propertyA  s   € ð ×&Ñ&¤}°u¸c°lÓCÐCri   c                ó�   — | j                  d|› d|› �«      }| j                  j                  |t        j                  |«      ¬«      S )a  Add or update a specific issue property Resource.

        Args:
            issue (str): ID or key of the issue to set the property to
            key (str): Key of the property to set
            data: The data to set for the property
        Returns:
            Response
        ró  r:  rõ   )r¦  rÝ   rÒ  rø   rù   )r•   rù  rz   rö   rs   s        rZ   Úadd_issue_propertyzJIRA.add_issue_propertyM  sB   € ð �m‰m˜f U G¨<¸°uÐ=Ó>ˆØ�}‰}× Ñ  ¬4¯:©:°dÓ+;Ð Ó<Ð<ri   c                ó†  — | j                  «       }||vr`| j                  j                  d«       |D ]@  }|j                  |k(  r|j                  } n#|j
                  |k(  sŒ0|j                  }||}} n d|id|id|i|dœ}| j                  d«      }| j                  j                  |t        j                  |«      ¬«      S )a  Create a link between two issues.

        Args:
            type (Union[str,IssueLinkType]): the type of link to create
            inwardIssue: the issue to link from
            outwardIssue: the issue to link to
            comment (Optional[Dict[str, Any]]):  a comment to add to the issues with the link. Should be a dict containing ``body`` and
              ``visibility`` fields: ``body`` being the text of the comment and ``visibility`` being a dict containing two entries:
              ``type`` and ``value``. ``type`` is ``role`` (or ``group`` if the Jira server has configured comment visibility for groups)
              and ``value`` is the name of the role (or group) to which viewing of this comment will be restricted.

        Returns:
            Response
        zKWarning: Specified issue link type is not present in the list of link typesr{   rz   )rÿ  ÚinwardIssueÚoutwardIssueré  Ú	issueLinkrõ   )Úissue_link_typesrb   rc   Úoutwardr{   Úinwardr¦  rÝ   r÷   rø   rù   )	r•   rÿ  rQ  rR  ré  rT  Últrö   rs   s	            rZ   Úcreate_issue_linkzJIRA.create_issue_link]  sÑ   € ð.  ×0Ñ0Ó2ÐàÐ'Ñ'Ø�H‰H×ÑØ]ôð 'ò 	�Ø—:‘: Ò%àŸ7™7�DÙØ—Y‘Y $Ó&àŸ7™7�DØ0<¸k �KÙð	ð ˜T�NØ! ;Ð/Ø" LÐ1Øñ	
ˆð �m‰m˜KÓ(ˆØ�}‰}×!Ñ! #¬D¯J©J°tÓ,<Ð!Ó=Ð=ri   c                óf   — | j                  d«      dz   |z   }| j                  j                  |«      S )znDelete a link between two issues.

        Args:
            id (str): ID of the issue link to delete
        rS  r  ©r¦  rÝ   r  r  s      rZ   Údelete_issue_linkzJIRA.delete_issue_linkŽ  s1   € ð �m‰m˜KÓ(¨3Ñ.°Ñ3ˆØ�}‰}×#Ñ# CÓ(Ð(ri   c                ó.   — | j                  t        |«      S )z�Get an issue link Resource from the server.

        Args:
            id (str): ID of the issue link to get

        Returns:
            IssueLink
        )rÛ  r2   rÜ  s     rZ   Ú
issue_linkzJIRA.issue_link—  ó   € ð ×&Ñ&¤y°"Ó5Ð5ri   c                óÐ   — t        | d«      r|rH| j                  d«      }|d   D �cg c]#  }t        | j                  | j                  |«      ‘Œ% c}| _        | j
                  S c c}w )zåGet a list of issue link type Resources from the server.

        Args:
            force (bool): True forces an update of the cached IssueLinkTypes. (Default: ``False``)

        Returns:
            List[IssueLinkType]
        zself._cached_issue_link_typesÚissueLinkTypeÚissueLinkTypes)rÊ  r£  r3   rJ  rÝ   Ú_cached_issue_link_types)r•   ÚforcerT  Úraw_link_jsons       rZ   rT  zJIRA.issue_link_types¤  sf   € ô �tÐ<Ô=ÁØ—^‘^ OÓ4ˆFð &,Ð,<Ñ%=ö-à!ô ˜dŸm™m¨T¯]©]¸MÕJò-ˆDÔ)ð ×,Ñ,Ð,ùò	-s   §(A#c                ó.   — | j                  t        |«      S )z«Get an issue link type Resource from the server.

        Args:
            id (str): ID of the issue link type to get

        Returns:
            IssueLinkType
        )rÛ  r3   rÜ  s     rZ   Úissue_link_typezJIRA.issue_link_typeµ  ó   € ð ×&Ñ&¤}°bÓ9Ð9ri   c                óŽ   — | j                  d«      }|D �cg c]#  }t        | j                  | j                  |«      ‘Œ% }}|S c c}w )zjGet a list of issue type Resources from the server.

        Returns:
            List[IssueType]
        r‰  ©r£  r6   rJ  rÝ   )r•   rT  Úraw_type_jsonÚissue_typess       rZ   rk  zJIRA.issue_typesÂ  sO   € ð —‘ Ó,ˆð "(ö
àô �d—m‘m T§]¡]°MÕBð
ˆð 
ð Ðùò	
rX  c                ób   — | j                  «        | j                  t        dd|› d�||¬«      }|S )a‡  Get a list of issue type Resources available in a given project from the server.

        This API was introduced in JIRA Server / DC 8.4 as a replacement for the more general purpose API 'createmeta'.
        For details see: https://confluence.atlassian.com/jiracore/createmeta-rest-endpoint-to-be-removed-975040986.html

        Args:
            project (str): ID or key of the project to query issue types from.
            startAt (int): Index of first issue type to return. (Default: ``0``)
            maxResults (int): Maximum number of issue types to return. (Default: ``50``)

        Returns:
            ResultList[IssueType]
        r×   rÂ  rÃ  rÄ  )r½  rº  r6   )r•   r  rŽ   r�   rk  s        rZ   Úproject_issue_typeszJIRA.project_issue_typesÏ  sE   € ð& 	×)Ñ)Ô+Ø×'Ñ'ÜØØ ˜y¨Ð4ØØ!ð (ó 
ˆð Ðri   c                óf   — | j                  «        | j                  t        dd|› d|› �||¬«      }|S )aÛ  Get a list of field type Resources available for a project and issue type from the server.

        This API was introduced in JIRA Server / DC 8.4 as a replacement for the more general purpose API 'createmeta'.
        For details see: https://confluence.atlassian.com/jiracore/createmeta-rest-endpoint-to-be-removed-975040986.html

        Args:
            project (str): ID or key of the project to query field types from.
            issue_type (str): ID of the issue type to query field types from.
            startAt (int): Index of first issue type to return. (Default: ``0``)
            maxResults (int): Maximum number of issue types to return. (Default: ``50``)

        Returns:
            ResultList[Field]
        r×   rÂ  rÉ  rÄ  )r½  rº  r.   )r•   r  Ú
issue_typerŽ   r�   rƒ   s         rZ   Úproject_issue_fieldszJIRA.project_issue_fieldsì  sH   € ð* 	×)Ñ)Ô+Ø×"Ñ"ÜØØ ˜y¨°Z°LÐAØØ!ð #ó 
ˆð ˆri   c                ó.   — | j                  t        |«      S )z�Get an issue type Resource from the server.

        Args:
            id (str): ID of the issue type to get

        Returns:
            IssueType
        )rÛ  r6   rÜ  s     rZ   ro  zJIRA.issue_type  r^  ri   c                ó(  — |r| j                  |d¬«      j                  }n| j                  «       }|D �cg c]  }|j                  |k(  sŒ|‘Œ }}t	        |«      dk(  r|d   S t	        |«      dk(  rt        d|› d�«      ‚t        d|› d�«      ‚c c}w )a  Get issue type by name.

        Args:
            name (str): Name of the issue type
            project (str): Key or ID of the project. If set, only issue types available for that project will be looked up.

        Returns:
            IssueType
        Ú
issueTypesrè  rœ   r   zIssue type 'ú' is unknown.z' appears more than once.)r  rs  rk  r{   r‘   r¼  )r•   r{   r  rk  ÚitÚmatching_issue_typess         rZ   r‹  zJIRA.issue_type_by_name  s¡   € ñ ØŸ,™, w°|˜,ÓD×OÑO‰Kà×*Ñ*Ó,ˆKà-8ÖL r¸B¿G¹GÀt»O¢ÐLÐÐLÜÐ#Ó$¨Ò)Ø'¨Ñ*Ð*ÜÐ%Ó&¨!Ò+Ü˜\¨$¨¨}Ð=Ó>Ð>ä˜\¨$¨Ð/HÐIÓJÐJùò  Ms   µBÁ
Bc                ó  — t        |d«      r|j                  }| j                  d|› d�z   }ddi}t        | j                  j                  ||¬«      «      }|d   D �cg c]#  }t        | j                  | j                  |«      ‘Œ% }}|S c c}w )zÆReturns request types supported by a service desk instance.

        Args:
            service_desk (ServiceDesk): The service desk instance.

        Returns:
            List[RequestType]
        rv  z!/rest/servicedeskapi/servicedesk/z/requesttyper¤  r¥  r¦  r×   )rÊ  rv  rN  rM   rÝ   r_  r>   rJ  )r•   r²  rs   r
  rT  rj  Úrequest_typess          rZ   rx  zJIRA.request_types-  s¡   € ô �< Ô&Ø'Ÿ?™?ˆLà�O‰OØ1°,°¸|ÐLñMð 	ð '¨Ð1ˆÜ˜DŸM™M×-Ñ-¨c¸7Ð-ÓCÓDˆð "(¨Ñ!1ö
àô ˜Ÿ™ t§}¡}°mÕDð
ˆð 
ð Ðùò	
s   Á(B	c                ó²   — | j                  |«      }	 |D �cg c]  }|j                  |k(  sŒ|‘Œ c}d   }|S c c}w # t        $ r t        d|› d�«      ‚w xY w)Nr   zRequest type 'rt  )rx  r{   Ú
IndexErrorr¼  )r•   r²  r{   rx  ÚrtÚrequest_types         rZ   r·  zJIRA.request_type_by_nameD  sj   € Ø×*Ñ*¨<Ó8ˆð	AØ)6ÖJ 2¸"¿'¹'ÀT»/šBÒJÈ1ÑMˆLð Ðùò KøÜò 	AÜ˜^¨D¨6°Ð?Ó@Ð@ð	Aús   “= —8¬8°= ¸= ½Ac                ór   — i }|�||d<   |�||d<   |�||d<   |�||d<   |�||d<   | j                  d|¬«      S )a”  Get a dict of all available permissions on the server.

        ``permissions`` is a comma-separated value list of permission keys that is
        required in Jira Cloud. For possible and allowable permission values, see
        https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-permission-schemes/#built-in-permissions

        Args:
            projectKey (Optional[str]): limit returned permissions to the specified project
            projectId (Optional[str]): limit returned permissions to the specified project
            issueKey (Optional[str]): limit returned permissions to the specified issue
            issueId (Optional[str]): limit returned permissions to the specified issue
            permissions (Optional[str]): limit returned permissions to the specified csv permission keys (cloud required field)

        Returns:
            Dict[str, Dict[str, Dict[str, str]]]
        Ú
projectKeyÚ	projectIdr¶  ÚissueIdÚpermissionsÚmypermissionsr™  rÎ  )r•   r~  r  r¶  r€  r�  rÒ   s          rZ   Úmy_permissionszJIRA.my_permissionsO  sl   € ð0 ˆØÐ!Ø#-ˆF�<Ñ ØÐ Ø"+ˆF�;ÑØÐØ!)ˆF�:ÑØÐØ 'ˆF�9ÑØÐ"Ø$/ˆF�=Ñ!à�~‰~˜o°fˆ~Ó=Ð=ri   c                óŽ   — | j                  d«      }|D �cg c]#  }t        | j                  | j                  |«      ‘Œ% }}|S c c}w )zgGet a list of priority Resources from the server.

        Returns:
            List[Priority]
        Úpriority)r£  r:   rJ  rÝ   )r•   rT  Úraw_priority_jsonÚ
prioritiess       rZ   r‡  zJIRA.prioritiesw  sP   € ð —‘ 
Ó+ˆð &,ö
à!ô �T—]‘] D§M¡MÐ3DÕEð
ˆ
ð 
ð Ðùò	
rX  c                ó.   — | j                  t        |«      S )z—Get a priority Resource from the server.

        Args:
            id (str): ID of the priority to get

        Returns:
            Priority
        )rÛ  r:   rÜ  s     rZ   r…  zJIRA.priority„  s   € ð ×&Ñ&¤x°Ó4Ð4ri   c                ó¤   — i }|�||d<   | j                  d|¬«      }|D �cg c]#  }t        | j                  | j                  |«      ‘Œ% }}|S c c}w )a  Get a list of project Resources from the server visible to the current authenticated user.

        Args:
            expand (Optional[str]): extra information to fetch for each project such as projectKeys and description.

        Returns:
            List[Project]
        rc  r  r™  )r£  r<   rJ  rÝ   )r•   rc  rÒ   rT  r®  r¯  s         rZ   r¯  zJIRA.projects‘  sh   € ð ˆØÐØ%ˆF�8ÑØ—‘ 	°&�Ó9ˆð %+ö
à ô �D—M‘M 4§=¡=Ð2BÕCð
ˆð 
ð ˆùò	
s   ¡(Ac                ó2   — | j                  t        ||¬«      S )a  Get a project Resource from the server.

        Args:
            id (str): ID or key of the project to get
            expand (Optional[str]): extra information to fetch for the project such as projectKeys and description.

        Returns:
            Project
        rè  )rÛ  r<   )r•   rv  rc  s      rZ   r  zJIRA.project¤  s   € ð ×&Ñ&¤w°¸6Ð&ÓBÐBri   c                ó0   — | j                  d|z   dz   «      S )z±Get a dict of all avatars for a project visible to the current authenticated user.

        Args:
            project (str): ID or key of the project to get avatars for
        úproject/z/avatarsrÎ  r  s     rZ   Úproject_avatarszJIRA.project_avatars±  s   € ð �~‰~˜j¨7Ñ2°ZÑ?Ó@Ð@ri   c                óF  — t         j                  j                  |«      }||k7  r|}||dœ}ddi}	|�||	d<   n| j                  |«      |	d<   | j	                  d|z   dz   «      }
| j
                  j                  |
||	|¬«      }t        |«      }|r| j                  ||«      S |S )aÆ  Register an image file as a project avatar.

        The avatar created is temporary and must be confirmed before it can be used.

        Avatar images are specified by a filename, size, and file object. By default, the client will attempt to autodetect the picture's content type
        this mechanism relies on libmagic and will not work out of the box on Windows systems
        (see `Their Documentation <https://filemagic.readthedocs.io/en/latest/guide.html>`_ for details on how to install support).

        The ``contentType`` argument can be used to explicitly set the value (note that Jira will reject any type other than the well-known ones for images, e.g. ``image/jpg``, ``image/png``, etc.)

        This method returns a dict of properties that can be used to crop a subarea of a larger image for use.
        This dict should be saved and passed to :py:meth:`confirm_project_avatar` to finish the avatar creation process.
        If you want to cut out the middleman and confirm the avatar with Jira's default cropping,
        pass the 'auto_confirm' argument with a truthy value and :py:meth:`confirm_project_avatar` will be called for you before this method returns.

        Args:
            project (str): ID or key of the project to create the avatar in
            filename (str): name of the avatar file
            size (int): size of the avatar file
            avatar_img (bytes): file-like object holding the avatar
            contentType (str): explicit specification for the avatar image's content-type
            auto_confirm (bool): True to automatically confirm the temporary avatar by calling :py:meth:`confirm_project_avatar` with the return value of this method. (Default: ``False``)

        )rú  rÉ  r0  r.  rå  rŒ  z/avatar/temporary©rÒ   r
  rö   )	r÷  rÉ   ÚgetsizeÚ_get_mime_typer¦  rÝ   r÷   rM   Úconfirm_project_avatar)r•   r  rú  rÉ  Ú
avatar_imgÚcontentTypeÚauto_confirmÚsize_from_filerÒ   r
  rs   rü   Úcropping_propertiess                rZ   Úcreate_temp_project_avatarzJIRA.create_temp_project_avatarº  s¼   € ôD Ÿ™Ÿ™¨Ó2ˆØ�>Ò!Ø!ˆDà4<ÀdÑ'Kˆà#6¸
Ð"CˆØÐ"Ø&1ˆG�NÒ#ð '+×&9Ñ&9¸*Ó&EˆG�NÑ#à�m‰m˜J¨Ñ0Ð3FÑFÓGˆØ�M‰M×Ñ˜s¨6¸7ÈÐÓTˆä.8¸«mÐÙØ×.Ñ.¨wÐ8KÓLÐLà&Ð&ri   c                óª   — |}| j                  d|z   dz   «      }| j                  j                  |t        j                  |«      ¬«      }t        |«      S )a�  Confirm the temporary avatar image previously uploaded with the specified cropping.

        After a successful registry with :py:meth:`create_temp_project_avatar`, use this method to confirm the avatar for use.
        The final avatar can be a subarea of the uploaded image, which is customized with the ``cropping_properties``:
        the return value of :py:meth:`create_temp_project_avatar` should be used for this argument.

        Args:
            project (str): ID or key of the project to confirm the avatar in
            cropping_properties (Dict[str,Any]): a dict of cropping properties from :py:meth:`create_temp_project_avatar`
        rŒ  ú/avatarrõ   ©r¦  rÝ   r÷   rø   rù   rM   )r•   r  r—  rö   rs   rü   s         rZ   r’  zJIRA.confirm_project_avatarò  sM   € ð #ˆØ�m‰m˜J¨Ñ0°9Ñ<Ó=ˆØ�M‰M×Ñ˜s¬¯©°DÓ)9ÐÓ:ˆä˜!‹}Ðri   c                óT   — | j                  d| j                  d|z   dz   «      |«       y)zªSet a project's avatar.

        Args:
            project (str): ID or key of the project to set the avatar on
            avatar (str): ID of the avatar to set
        NrŒ  rš  ©Ú_set_avatarr¦  )r•   r  Úavatars      rZ   Úset_project_avatarzJIRA.set_project_avatar  s*   € ð 	×Ñ˜˜tŸ}™}¨Z¸'Ñ-AÀIÑ-MÓNÐPVÕWri   c                ól   — | j                  d|z   dz   |z   «      }| j                  j                  |«      S )zÜDelete a project's avatar.

        Args:
            project (str): ID or key of the project to delete the avatar from
            avatar (str): ID of the avatar to delete

        Returns:
            Response
        rŒ  z/avatar/rZ  )r•   r  rŸ  rs   s       rZ   Údelete_project_avatarzJIRA.delete_project_avatar  s6   € ð �m‰m˜J¨Ñ0°:Ñ=ÀÑFÓGˆØ�}‰}×#Ñ# CÓ(Ð(ri   c                óš   — | j                  d|z   dz   «      }|D �cg c]#  }t        | j                  | j                  |«      ‘Œ% }}|S c c}w )zÈGet a list of component Resources present on a project.

        Args:
            project (str): ID or key of the project to get components from

        Returns:
            List[Component]
        rŒ  z/components)r£  r'   rJ  rÝ   )r•   r  rT  Úraw_comp_jsonÚ
componentss        rZ   Úproject_componentszJIRA.project_components  sY   € ð —‘ 
¨WÑ 4°}Ñ DÓEˆð "(ö
àô �d—m‘m T§]¡]°MÕBð
ˆ
ð 
ð Ðùò	
ó   œ(Ac                óš   — | j                  d|z   dz   «      }|D �cg c]#  }t        | j                  | j                  |«      ‘Œ% }}|S c c}w )zÂGet a list of version Resources present on a project.

        Args:
            project (str): ID or key of the project to get versions from

        Returns:
            List[Version]
        rŒ  z	/versions)r£  rH   rJ  rÝ   )r•   r  rT  Úraw_ver_jsonÚversionss        rZ   Úproject_versionszJIRA.project_versions-  sX   € ð —‘ 
¨WÑ 4°{Ñ BÓCˆð !'ö
àô �D—M‘M 4§=¡=°,Õ?ð
ˆð 
ð ˆùò	
r§  c                óZ   — | j                  |«      }|D ]  }|j                  |k(  sŒ|c S  y)a  Get a version Resource by its name present on a project.

        Args:
            project (str): ID or key of the project to get versions from
            version_name (str): name of the version to search for

        Returns:
            Optional[Version]
        N)r«  r{   )r•   r  Úversion_namerª  r  s        rZ   Úget_project_version_by_namez JIRA.get_project_version_by_name>  s9   € ð #'×"7Ñ"7¸Ó"@ˆØò 	ˆGØ�|‰|˜|Ó+Ø’ð	ð ri   c                óR   — | j                  ||«      }|r|j                  |¬«       yy)a  Rename a version Resource on a project.

        Args:
            project (str): ID or key of the project to get versions from
            old_name (str): old name of the version to rename
            new_name (str): new name of the version to rename
        )r{   N)r®  rK  )r•   r  Úold_nameÚnew_namer  s        rZ   Úrename_versionzJIRA.rename_versionQ  s,   € ð ×2Ñ2°7¸HÓEˆÙØ�N‰N ˆNÕ)ð ri   c                ó²   — d|z   dz   }| j                  |«      }i }|j                  «       D ](  \  }}i }|j                  d«      d   |d<   ||d<   |||<   Œ* |S )zÓGet a dict of role names to resource locations for a project.

        Args:
            project (str): ID or key of the project to get roles from

        Returns:
            Dict[str, Dict[str, str]]
        rŒ  z/roler  r5  rv  rs   )r£  r°  rÒ  )r•   r  rÉ   Ú
_rolesdictÚ	rolesdictÚkÚvÚtmps           rZ   Úproject_roleszJIRA.project_roles_  sw   € ð ˜GÑ# gÑ-ˆØ%)§^¡^°DÓ%9ˆ
Ø/1ˆ	à×$Ñ$Ó&ò 	‰DˆAˆqØ"$ˆCØŸ™ › RÑ(ˆC�‰IØˆC�‰JØˆI�aŠLð		ð
 Ðri   c                óX   — t        |t        «      r|› }| j                  t        ||f«      S )zÄGet a role Resource.

        Args:
            project (str): ID or key of the project to get the role from
            id (str): ID of the role to get

        Returns:
            Role
        )r_   r	   rÛ  rA   )r•   r  rv  s      rZ   Úproject_rolezJIRA.project_roleu  s,   € ô �bœ&Ô!Ø�4ˆBØ×&Ñ&¤t¨g°r¨]Ó;Ð;ri   c                óŽ   — | j                  d«      }|D �cg c]#  }t        | j                  | j                  |«      ‘Œ% }}|S c c}w )zkGet a list of resolution Resources from the server.

        Returns:
            List[Resolution]
        Ú
resolution)r£  r?   rJ  rÝ   )r•   rT  Úraw_res_jsonÚresolutionss       rZ   r¿  zJIRA.resolutions†  sO   € ð —‘ Ó-ˆð !'ö
àô �t—}‘} d§m¡m°\ÕBð
ˆð 
ð Ðùò	
rX  c                ó.   — | j                  t        |«      S )z�Get a resolution Resource from the server.

        Args:
            id (str): ID of the resolution to get

        Returns:
            Resolution
        )rÛ  r?   rÜ  s     rZ   r½  zJIRA.resolution“  rÞ  ri   c
           	     óÂ  — t        |t        «      r|j                  d«      }n|€dg}i }
| j                  rIt	        |«      D ];  \  }}|| j                  v sŒ||   |
| j                  |   <   | j                  |   ||<   Œ= ||||||dœ}|	r|j                  d«       |r7||d<   |st        j                  dt        «       | j                  d||	¬«      }|S | j                  t        d	d||||	¬
«      }|
rm|D ]h  }|
j                  «       D ]S  \  }}|j                  sŒ||j                  j                  di «      v sŒ2|j                  d   |   |j                  d   |<   ŒU Œj |S )aè  Get a :class:`~jira.client.ResultList` of issue Resources matching a JQL search string.

        Args:
            jql_str (str): The JQL search string.
            startAt (int): Index of the first issue to return. (Default: ``0``)
            maxResults (int): Maximum number of issues to return.
              Total number of results is available in the ``total`` attribute of the returned :class:`ResultList`.
              If maxResults evaluates to False, it will try to get all issues in batches. (Default: ``50``)
            validate_query (bool): True to validate the query. (Default: ``True``)
            fields (Optional[Union[str, List[str]]]): comma-separated string or list of issue fields to include in the results.
              Default is to include all fields.
            expand (Optional[str]): extra information to fetch inside each resource
            properties (Optional[str]): extra properties to fetch inside each result
            json_result (bool): True to return a JSON response. When set to False a :class:`ResultList` will be returned. (Default: ``False``)
            use_post (bool): True to use POST endpoint to fetch issues.

        Returns:
            Union[Dict,ResultList]: Dict if ``json_result=True``
        rÄ   ú*all)rZ  rŽ   ÚvalidateQueryrƒ   rc  r‡  r‡  r�   zGAll issues cannot be fetched at once, when json_result parameter is setÚsearch)rÒ   rœ  r˜  )rœ  rƒ   )r_   r  rÒ  rs  rš  r›  rA  rB  r  r£  rº  r1   r°  rZ  r_  )r•   Újql_strrŽ   r�   Úvalidate_queryrƒ   rc  r‡  Újson_resultrœ  Úuntranslater¥   rP  Úsearch_paramsrT  r˜  Úissr¶  r·  s                      rZ   Úsearch_issueszJIRA.search_issues   s¢  € ô> �fœcÔ"Ø—\‘\ #Ó&‰FØˆ^Ø�XˆFð ˆØ×ÒÜ% fÓ-ò :‘��5Ø˜D×.Ñ.Ò.Ø=CÀA¹Y�K × 2Ñ 2°5Ñ 9Ñ:Ø $× 2Ñ 2°5Ñ 9�F˜1’Ið:ð ØØ+ØØØ$ñ
ˆñ Ø×Ñ˜lÔ+ÙØ*4ˆM˜,Ñ'ÙÜ—‘Ø]Üôð &*§^¡^Ø ¸ð &4ó &ˆFð ˆMà×"Ñ"ÜØØØØØØð #ó 
ˆñ àò H�Ø'×-Ñ-Ó/ò H‘D�A�qØ—w“wØ §¡§¡¨H°bÓ 9Ò9Ø36·7±7¸8Ñ3DÀQÑ3G˜CŸG™G HÑ-¨aÒ0ñHðHð ˆri   c                ó.   — | j                  t        |«      S )z˜Get a security level Resource.

        Args:
            id (str): ID of the security level to get

        Returns:
            SecurityLevel
        )rÛ  rB   rÜ  s     rZ   Úsecurity_levelzJIRA.security_levelú  rg  ri   c                ó¬   — d}| j                  d«      }|s>|dk  r9| j                  j                  d«       |dz  }| j                  d«      }|s|dk  rŒ9|S )únGet a dict of server information for this Jira instance.

        Returns:
            Dict[str, Any]
        r   Ú
serverInfoé   z?Bug https://jira.atlassian.com/browse/JRA-59676 trying again...rœ   )r£  rb   rc   )r•   ÚretryÚjs      rZ   r[  zJIRA.server_info  s`   € ð ˆØ�N‰N˜<Ó(ˆÙ˜ š	Ø�H‰H×ÑØQôð �Q‰JˆEØ—‘˜|Ó,ˆAñ ˜ ›	ð ˆri   c                ó$   — | j                  d«      S )rÏ  ÚmyselfrÎ  rž   s    rZ   rÕ  zJIRA.myself  s   € ð �~‰~˜hÓ'Ð'ri   c                óŽ   — | j                  d«      }|D �cg c]#  }t        | j                  | j                  |«      ‘Œ% }}|S c c}w )zóGet a list of all status Resources from the server.

        Refer to :py:meth:`JIRA.issue_types_for_project` for getting statuses
        for a specific issue type within a specific project.

        Returns:
            List[Status]
        r–  )r£  rE   rJ  rÝ   )r•   rT  Úraw_stat_jsonÚstatusess       rZ   rØ  zJIRA.statuses"  sN   € ð —‘ Ó)ˆð "(ö
àô �4—=‘= $§-¡-°Õ?ð
ˆð 
ð ˆùò	
rX  c                ó–   — | j                  d|› d�«      }|D �cg c]#  }t        | j                  | j                  |«      ‘Œ% }}|S c c}w )a4  Get a list of issue types available within the project.

        Each project has a set of valid issue types and each issue type has a set of valid statuses.
        The valid statuses for a given issue type can be extracted via: `issue_type_x.statuses`

        Returns:
            List[IssueType]
        rŒ  z	/statusesri  )r•   rÆ  rT  r×  rk  s        rZ   Úissue_types_for_projectzJIRA.issue_types_for_project2  sY   € ð —‘ (¨>Ð*:¸)Ð DÓEˆð "(ö
àô �d—m‘m T§]¡]°MÕBð
ˆð 
ð Ðùò	
s   š(Ac                ó.   — | j                  t        |«      S )zšGet a status Resource from the server.

        Args:
            id (str): ID of the status resource to get

        Returns:
            Status
        )rÛ  rE   rÜ  s     rZ   r–  zJIRA.statusB  rR  ri   c                óŽ   — | j                  d«      }|D �cg c]#  }t        | j                  | j                  |«      ‘Œ% }}|S c c}w )ztGet a list of status category Resources from the server.

        Returns:
            List[StatusCategory]
        Ústatuscategory)r£  rF   rJ  rÝ   )r•   rT  r×  Ústatuscategoriess       rZ   rÞ  zJIRA.statuscategoriesO  sQ   € ð —‘Ð 0Ó1ˆð "(ö
àô ˜4Ÿ=™=¨$¯-©-¸ÕGð
Ðð 
ð  Ðùò	
rX  c                ó.   — | j                  t        |«      S )z´Get a status category Resource from the server.

        Args:
            id (int): ID of the status category resource to get

        Returns:
            StatusCategory
        )rÛ  rF   rÜ  s     rZ   rÝ  zJIRA.statuscategory\  s   € ð ×&Ñ&¤~°rÓ:Ð:ri   c                óž   — t        | j                  | j                  | j                  rdnd¬«      }i }|�||d<   |j	                  ||¬«       |S )zßGet a user Resource from the server.

        Args:
            id (str): ID of the user to get
            expand (Optional[Any]): Extra information to fetch inside each resource

        Returns:
            User
        ro  ró   )Ú_query_paramrc  r™  )rG   rJ  rÝ   ra   rÄ  )r•   rv  rc  rn  rÒ   s        rZ   rn  z	JIRA.useri  sS   € ô Ø�M‰MØ�M‰MØ(,¯ª™¸Jô
ˆð
 ˆØÐØ%ˆF�8ÑØ�	‰	�"˜Vˆ	Ô$Øˆri   c                ó@   — ||dœ}| j                  t        dd|||«      S )a=  Get a list of user Resources that match the search string and can be assigned issues for projects.

        Args:
            username (str): A string to match usernames against
            projectKeys (str): Comma-separated list of project keys to check for issue assignment permissions
            startAt (int): Index of the first user to return (Default: ``0``)
            maxResults (int): Maximum number of users to return. If maxResults evaluates as False, it will try to get all users in batches. (Default: ``50``)

        Returns:
            ResultList
        )ró   rÎ  Nz"user/assignable/multiProjectSearch)rº  rG   )r•   ró   rÎ  rŽ   r�   rÒ   s         rZ   Ú$search_assignable_users_for_projectsz)JIRA.search_assignable_users_for_projects~  s3   € ð$ '°{ÑCˆØ× Ñ ÜØØ0ØØØó
ð 	
ri   c                ó–   — |s|st        d«      ‚|�d|i}|�d|i}|�|d<   |�|d<   |�|d<   | j                  t        dd||«      S )	aw  Get a list of user Resources that match the search string for assigning or creating issues.

        "username" query parameter is deprecated in Jira Cloud; the expected parameter now is "query", which can just be the full email again.
        But the "user" parameter is kept for backwards compatibility, i.e. Jira Server/Data Center.

        This method is intended to find users that are eligible to create issues in a project or be assigned to an existing issue.
        When searching for eligible creators, specify a project. When searching for eligible assignees, specify an issue key.

        Args:
            username (Optional[str]): A string to match usernames against
            project (Optional[str]): Filter returned users by permission in this project (expected if a result will be used to create an issue)
            issueKey (Optional[str]): Filter returned users by this issue (expected if a result will be used to edit this issue)
            expand (Optional[Any]): Extra information to fetch inside each resource
            startAt (int): Index of the first user to return (Default: ``0``)
            maxResults (int): maximum number of users to return. If maxResults evaluates as False, it will try to get all items in batches. (Default: ``50``)
            query (Optional[str]): Search term. It can just be the email.

        Returns:
            ResultList
        z9Either 'username' or 'query' arguments must be specified.Nró   rÊ   r  r¶  rc  zuser/assignable/search©r  rº  rG   )	r•   ró   r  r¶  rc  rŽ   r�   rÊ   rÒ   s	            rZ   Ú"search_assignable_users_for_issuesz'JIRA.search_assignable_users_for_issuesš  s�   € ñ< ¡ÜØKóð ð ÐØ  (Ð+ˆFØÐØ˜uÐ%ˆFØÐØ 'ˆF�9ÑØÐØ!)ˆF�:ÑØÐØ%ˆF�8Ñà× Ñ ÜØØ$ØØØó
ð 	
ri   c                ó,   — | j                  dd|i¬«      S )z®Get a dict of avatars for the specified user.

        Args:
            username (str): the username to get avatars for

        Returns:
            Dict[str, Any]
        zuser/avatarsró   r™  rÎ  )r•   ró   s     rZ   Úuser_avatarszJIRA.user_avatarsÒ  s   € ð �~‰~˜n°jÀ(Ð5Kˆ~ÓLÐLri   c                ó€  — t         j                  j                  |«      }||k7  r|}t         j                  j                  |«      d   }|||dœ}ddi}	|�||	d<   n| j	                  |«      |	d<   | j                  d«      }
| j                  j                  |
||	|¬«      }t        |«      }|r| j                  ||«      S |S )aÏ  Register an image file as a user avatar.

        The avatar created is temporary and must be confirmed before it can be used.

        Avatar images are specified by a filename, size, and file object. By default, the client will attempt to autodetect the picture's content type:
        this mechanism relies on ``libmagic`` and will not work out of the box on Windows systems
        (see `Their Documentation <https://filemagic.readthedocs.io/en/latest/guide.html>`_ for details on how to install support).
        The ``contentType`` argument can be used to explicitly set the value
        (note that Jira will reject any type other than the well-known ones for images, e.g. ``image/jpg``, ``image/png``, etc.)

        This method returns a dict of properties that can be used to crop a subarea of a larger image for use.
        This dict should be saved and passed to :py:meth:`confirm_user_avatar` to finish the avatar creation process.
        If you want to cut out the middleman and confirm the avatar with Jira's default cropping, pass the ``auto_confirm`` argument with a truthy value and
        :py:meth:`confirm_user_avatar` will be called for you before this method returns.

        Args:
            user (str): User to register the avatar for
            filename (str): name of the avatar file
            size (int): size of the avatar file
            avatar_img (bytes): file-like object containing the avatar
            contentType (Optional[Any]): explicit specification for the avatar image's content-type
            auto_confirm (bool): True to automatically confirm the temporary avatar by calling
              :py:meth:`confirm_user_avatar` with the return value of this method. (Default: ``False``)

        rœ   )ró   rú  rÉ  r0  r.  rå  zuser/avatar/temporaryr�  )
r÷  rÉ   r�  rÒ  r‘  r¦  rÝ   r÷   rM   Úconfirm_user_avatar)r•   rn  rú  rÉ  r“  r”  r•  r–  rÒ   r
  rs   rü   r—  s                rZ   Úcreate_temp_user_avatarzJIRA.create_temp_user_avatarÝ  sÕ   € ôD Ÿ™Ÿ™¨Ó2ˆØ�>Ò!Ø!ˆDô —7‘7—=‘= Ó*¨1Ñ-ˆð Ø Øñ(
ˆð '¨
Ð3ˆØÐ"Ø&1ˆG�NÒ#ð '+×&9Ñ&9¸*Ó&EˆG�NÑ#à�m‰mÐ3Ó4ˆØ�M‰M×Ñ˜s¨6¸7ÈÐÓTˆä.8¸«mÐÙØ×+Ñ+¨DÐ2EÓFÐFà&Ð&ri   c                ó¤   — |}| j                  d«      }| j                  j                  |d|it        j                  |«      ¬«      }t        |«      S )ar  Confirm the temporary avatar image previously uploaded with the specified cropping.

        After a successful registry with :py:meth:`create_temp_user_avatar`, use this method to confirm the avatar for use.
        The final avatar can be a subarea of the uploaded image, which is customized with the ``cropping_properties``:
        the return value of :py:meth:`create_temp_user_avatar` should be used for this argument.

        Args:
            user (str): the user to confirm the avatar for
            cropping_properties (Dict[str,Any]): a dict of cropping properties from :py:meth:`create_temp_user_avatar`
        úuser/avatarró   rE  r›  )r•   rn  r—  rö   rs   rü   s         rZ   rê  zJIRA.confirm_user_avatar  sJ   € ð #ˆØ�m‰m˜MÓ*ˆØ�M‰M×Ñ˜s¨J¸Ð+=ÄDÇJÁJÈtÓDTÐÓUˆä˜!‹}Ðri   c                óJ   — | j                  d|i| j                  d«      |«      S )zÀSet a user's avatar.

        Args:
            username (str): the user to set the avatar for
            avatar (str): ID of the avatar to set

        Returns:
            Response
        ró   rí  r�  )r•   ró   rŸ  s      rZ   Úset_user_avatarzJIRA.set_user_avatar.  s,   € ð ×ÑØ˜Ð" D§M¡M°-Ó$@À&ó
ð 	
ri   c                ól   — d|i}| j                  d|z   «      }| j                  j                  ||¬«      S )zÊDelete a user's avatar.

        Args:
            username (str): the user to delete the avatar from
            avatar (str): ID of the avatar to remove

        Returns:
            Response
        ró   zuser/avatar/r™  rZ  )r•   ró   rŸ  rÒ   rs   s        rZ   Údelete_user_avatarzJIRA.delete_user_avatar<  s;   € ð ˜hÐ'ˆØ�m‰m˜N¨VÑ3Ó4ˆØ�}‰}×#Ñ# C°Ð#Ó7Ð7ri   )Úinternal_idÚ	global_idc               ó  — |du |du z  st        d«      ‚|�| j                  d|› d|› �«      }n:|�8t        j                  j	                  |d¬«      }| j                  d|› d|› �«      }| j
                  j                  «      S )aF  Delete remote link from issue by internalId or globalId.

        Args:
            issue (str): Key (or Issue) of Issue
            internal_id (Optional[str]): InternalID of the remote link to delete
            global_id (Optional[str]): GlobalID of the remote link to delete

        Returns:
            Response
        Nz1Must supply either 'internal_id' XOR 'global_id'.ró  z/remotelink/r4  rÕ   z/remotelink?globalId=)r  r¦  Úurllibr   r   rÝ   r  )r•   rù  rò  ró  rs   s        rZ   Údelete_remote_linkzJIRA.delete_remote_linkJ  s“   € ð$  Ð$¨°dÐ):Ò;ÜÐPÓQÐQàÐ"Ø—-‘- &¨¨¨|¸K¸=Ð IÓJ‰CØÐ"äŸ™×*Ñ*¨9¸2Ð*Ó>ˆIØ—-‘- &¨¨Ð/DÀYÀKÐ PÓQˆCà�}‰}×#Ñ# CÓ(Ð(ri   c                ób   — |s|st        d«      ‚||||dœ}| j                  t        dd|||«      S )a´  Get a list of user Resources that match the specified search string.

        "username" query parameter is deprecated in Jira Cloud; the expected parameter now is "query", which can just be the full email again.
        But the "user" parameter is kept for backwards compatibility, i.e. Jira Server/Data Center.

        Args:
            user (Optional[str]): a string to match usernames, name or email against.
            startAt (int): index of the first user to return.
            maxResults (int): maximum number of users to return. If maxResults evaluates as False, it will try to get all items in batches.
            includeActive (bool): True to include active users in the results. (Default: ``True``)
            includeInactive (bool): True to include inactive users in the results. (Default: ``False``)
            query (Optional[str]): Search term. It can just be the email.

        Returns:
            ResultList[User]
        z5Either 'user' or 'query' arguments must be specified.)ró   rÊ   ÚincludeActiveÚincludeInactiveNzuser/searchrå  )r•   rn  rŽ   r�   rø  rù  rÊ   rÒ   s           rZ   rÙ  zJIRA.search_usersh  sH   € ñ2 ™EÜÐTÓUÐUð ØØ*Ø.ñ	
ˆð × Ñ ¤ t¨]¸GÀZÐQWÓXÐXri   c                óv   — | j                   rdnd|i}|�||d<   |�||d<   | j                  t        dd|||«      S )a�  Get a list of user Resources that match a username string and have browse permission for the issue or project.

        Args:
            user (str): a string to match usernames against.
            issueKey (Optional[str]): find users with browse permission for this issue.
            projectKey (Optional[str]): find users with browse permission for this project.
            startAt (int): index of the first user to return. (Default: ``0``)
            maxResults (int): maximum number of users to return. If maxResults evaluates as False, it will try to get all items in batches. (Default: ``50``)

        Returns:
            ResultList
        rÊ   ró   Nr¶  r~  zuser/viewissue/search)ra   rº  rG   )r•   rn  r¶  r~  rŽ   r�   rÒ   s          rZ   Úsearch_allowed_users_for_issuez#JIRA.search_allowed_users_for_issue�  sW   € ð( "Ÿ^š^‘'°¸TÐBˆØÐØ!)ˆF�:ÑØÐ!Ø#-ˆF�<Ñ Ø× Ñ Ü�$Ð/°¸*Àfó
ð 	
ri   c                ó@  — ||||dœ}|�||d<   |�||d<   |�||d<   | j                  d«      }	| j                  j                  |	t        j                  |«      ¬«      }
t        j                  d«       t        | j                  | j                  t        |
«      ¬«      }|S )	au  Create a version in a project and return a Resource for it.

        Args:
            name (str): name of the version to create
            project (str): key of the project to create the version in
            description (str): a description of the version
            releaseDate (Optional[Any]): the release date assigned to the version
            startDate (Optional[Any]): The start date for the version
            archived (bool): True to create an archived version. (Default: ``False``)
            released (bool): True to create a released version. (Default: ``False``)

        Returns:
            Version
        )r{   r  ÚarchivedÚreleasedr	  ÚreleaseDateÚ	startDater  rõ   rœ   r  )
r¦  rÝ   r÷   rø   rù   ÚtimeÚsleeprH   rJ  rM   )r•   r{   r  r	  rÿ  r   rý  rþ  rö   rs   rü   r  s               rZ   Úcreate_versionzJIRA.create_version¬  s£   € ð4 ØØ Ø ñ	
ˆð Ð"Ø"-ˆD�ÑØÐ"Ø"-ˆD�ÑØÐ Ø )ˆD�Ñà�m‰m˜IÓ&ˆØ�M‰M×Ñ˜s¬¯©°DÓ)9ÐÓ:ˆä�
‰
�1ŒÜ˜$Ÿ-™-¨¯©¼JÀq»MÔJˆØˆri   c                ó  — i }|�||d<   n|�||d<   | j                  d|z   dz   «      }| j                  j                  |t        j                  |«      ¬«      }t        | j                  | j                  t        |«      ¬«      }|S )a*  Move a version within a project's ordered version list and return a new version Resource for it.

        One, but not both, of ``after`` and ``position`` must be specified.

        Args:
            id (str): ID of the version to move
            after (str): the self attribute of a version to place the specified version after (that is, higher in the list)
            position (Optional[str]): the absolute position to move this version to: must be one of ``First``, ``Last``, ``Earlier``, or ``Later``

        Returns:
            Version
        ÚafterrI  úversion/z/moverõ   r  )r¦  rÝ   r÷   rø   rù   rH   rJ  rM   )r•   rv  r  rI  rö   rs   rü   r  s           rZ   Úmove_versionzJIRA.move_versionÙ  s€   € ð ˆØÐØ!ˆD�ŠMØÐ!Ø'ˆD�Ñà�m‰m˜J¨™O¨gÑ5Ó6ˆØ�M‰M×Ñ˜s¬¯©°DÓ)9ÐÓ:ˆä˜$Ÿ-™-¨¯©¼JÀq»MÔJˆØˆri   c                ó~   — t        | j                  | j                  «      }i }|�||d<   |j                  ||¬«       |S )zØGet a version Resource.

        Args:
            id (str): ID of the version to get
            expand (Optional[Any]): extra information to fetch inside each resource

        Returns:
            Version
        rc  r™  )rH   rJ  rÝ   rÄ  )r•   rv  rc  r  rÒ   s        rZ   r  zJIRA.versionò  sB   € ô ˜$Ÿ-™-¨¯©Ó7ˆØˆØÐØ%ˆF�8ÑØ�‰�R ˆÔ'Øˆri   c                ó:   — | j                  d|z   dz   «      }|d= |S )z‘Get a dict of the counts of issues fixed and affected by a version.

        Args:
            id (str): the version to count issues for
        r  r  r•   rÎ  ©r•   rv  rT  s      rZ   Úversion_count_related_issuesz!JIRA.version_count_related_issues  s(   € ð "&§¡°
¸R±ÐBWÑ0WÓ!XˆØ�6ˆNØˆri   c                ó:   — | j                  d|z   dz   «      }|d   S )z†Get the number of unresolved issues for a version.

        Args:
            id (str): ID of the version to count issues for
        r  z/unresolvedIssueCountÚissuesUnresolvedCountrÎ  r
  s      rZ   Úversion_count_unresolved_issuesz$JIRA.version_count_unresolved_issues  s-   € ð "&§¡Ø˜‰OÐ5Ñ5ó"
ˆð Ð-Ñ.Ð.ri   c                óÈ   —  dj                   di | j                  ¤Ž}| j                  j                  |«      }t	        | j                  | j                  t        |«      «      }|S )zoGet a dict of the current authenticated user's session information.

        Returns:
            User
        r|  rV   )r}  rJ  rÝ   r_  rG   rM   )r•   rs   rü   rn  s       rZ   râ   zJIRA.session  sQ   € ð *Ð"×)Ñ)Ñ:¨D¯M©MÑ:ˆØ�M‰M×Ñ˜cÓ"ˆä�D—M‘M 4§=¡=´*¸Q³-Ó@ˆØˆri   c                óV   — | j                   dz   }| j                  j                  |«      S )zfDestroy the session of the current authenticated user.

        Returns:
            Response
        z/rest/auth/latest/session)rN  rÝ   r  ©r•   rs   s     rZ   Úkill_sessionzJIRA.kill_session&  s(   € ð �o‰oÐ ;Ñ;ˆØ�}‰}×#Ñ# CÓ(Ð(ri   c                óp   — | j                   s*| j                  dz   }| j                  j                  |«      S y)z­Destroy the user's current WebSudo session.

        Works only for non-cloud deployments, for others does nothing.

        Returns:
            Optional[Response]
        z/rest/auth/1/websudoN)ra   rN  rÝ   r  r  s     rZ   Úkill_websudozJIRA.kill_websudo0  s2   € ð �~Š~Ø—/‘/Ð$:Ñ:ˆCØ—=‘=×'Ñ'¨Ó,Ð,Øri   c                ó*   — ||f| j                   _        y)zÏCreates a basic http session.

        Args:
            username (str): Username for the session
            password (str): Password for the username

        Returns:
            ResilientSession
        N)rÝ   rä   )r•   ró   rô   s      rZ   rU  zJIRA._create_http_basic_session>  s   € ð '¨Ð1ˆ�‰Õri   c           	     ó¼  — ddl m} ddlm} 	 ddl m} |j                  d«      ||fD ]Y  }|€Œ ||d   |d   ||d	   |d
   ¬«      }|| j                  _
        	 | j                  «        t        j                  d|› �«        y  y # t
        $ r |}t        j                  d«       Y Œ“w xY w# t        $ r' t        j                  d|› d�dz   dz   «       ||u r‚ Y Œ²w xY w)Nr   )ÚSIGNATURE_HMAC_SHA1)ÚOAuth1)ÚSIGNATURE_RSAz8Fallback SHA 'SIGNATURE_RSA_SHA1' could not be imported.Úsignature_methodÚconsumer_keyÚkey_certÚaccess_tokenÚaccess_token_secret)Úrsa_keyr  Úresource_owner_keyÚresource_owner_secretz'OAuth1 succeeded with signature_method=z5Failed to create OAuth session with signature_method=z.
zAttempting fallback method(s).z@Consider specifying the signature via oauth['signature_method'].)Úoauthlib.oauth1r  Úrequests_oauthlibr  r  r¡  rE  Údebugr_  rÝ   rä   rÕ  r   Ú	exception)r•   rf  ÚDEFAULT_SHAr  ÚFALLBACK_SHAÚsha_typeÚoauth_instances          rZ   rT  zJIRA._create_oauth_sessionJ  s  € ÝFÝ,ð	WÝEð
 Ÿ™Ð#5Ó6¸À\ÐRò 	ˆHØÐØÙ#Ø�nÑ%Ø˜jÑ)Ø!)Ø#(¨Ñ#8Ø&+Ð,AÑ&BôˆNð "0ˆD�M‰MÔðØ—‘”Ü—‘Ð!HÈÈ
ÐSÔTÙñ	øô	 ò 	WØ&ˆLÜ�N‰NÐUÖVð	Wûô& ò Ü×"Ñ"ØKÈHÈ:ÐUXÐYØ6ñ7àXñYôð
 ˜|Ñ+Øñ ,ðús#   ŽB Á(B+Â B(Â'B(Â+-CÃCc                óÐ   — |€i }ddl m}m}m} |j	                  dd«      dk(  r|}n(|j	                  d«      dk(  r|}nt        d|d   z  «      ‚ ||¬«      | j                  _        y )Nr   )ÚDISABLEDÚOPTIONALÚHTTPKerberosAuthÚmutual_authenticationr,  r+  z+Unknown value for mutual_authentication: %s)r.  )Úrequests_kerberosr+  r,  r-  r_  r  rÝ   rä   )r•   r8  r+  r,  r-  r.  s         rZ   rX  zJIRA._create_kerberos_sessionl  s€   € ð Ð#Ø!ÐçJÑJà×ÑÐ 7¸ÓDÈ
ÒRØ$,Ñ!Ø×!Ñ!Ð"9Ó:¸jÒHØ$,Ñ!äØ=Ø"Ð#:Ñ;ñ<óð ñ
 .Ø"7ô
ˆ�‰Õri   c                óD   — | j                   d   }|| j                  _        y)uF  Adds the client certificate to the session.

        If configured through the constructor.

        https://docs.python-requests.org/en/master/user/advanced/#client-side-certificates
        - str: a single file (containing the private key and the certificate)
        - Tuple[str,str] a tuple of both filesâ€™ paths
        r*  N)rJ  rÝ   Úcert)r•   r*  s     rZ   rP  z JIRA._add_client_cert_to_sessionƒ  s   € ð .2¯]©]¸=Ñ-IˆØ(ˆ�‰Õri   c                óD   — | j                   d   }|| j                  _        y)a;  Adds verification strategy for host SSL certificates.

        If configured through the constructor.

        https://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification
        - str: Path to a `CA_BUNDLE` file or directory with certificates of trusted CAs.
        - bool: True/False
        r%  N)rJ  rÝ   r%  )r•   Ússl_certs     rZ   rQ  z,JIRA._add_ssl_cert_verif_strategy_to_session�  s   € ð  $Ÿ}™}¨XÑ6ˆØ'ˆ�‰Õri   c                ó’   — t         j                   j                  «       }| �|| z  }t        j                  |j	                  «       «      S rU   )ÚdatetimeÚutcnowÚcalendarÚtimegmÚ	timetuple)Údtrx  s     rZ   Ú
_timestampzJIRA._timestamp›  s9   € ä×Ñ×$Ñ$Ó&ˆØˆ>Ø�‰GˆAÜ�‰˜qŸ{™{›}Ó-Ð-ri   c                óÂ  — 	 t        |d   d¬«      }|j	                  d«       |j                  dd„ «       |j                  dd	„ «       |j                  d
t        | j                  d   «      «       |d   j                  «       D ]  }|j                  |d   |d   «       Œ || j                  _
        y # t        $ r"}| j                  j                  d«       |‚d }~ww xY w)NÚsecretÚHS256)Úalgz(JWT authentication requires requests_jwtzJWT %sÚiatc                ó*   — t         j                  «       S rU   )r`   r;  ©r¿   s    rZ   ry  z*JIRA._create_jwt_session.<locals>.<lambda>ª  s   € ¬d¯o©oÓ.?€ ri   Úexpc                óT   — t         j                  t        j                  d¬«      «      S )NrÑ  )r-  )r`   r;  r5  Ú	timedeltarB  s    rZ   ry  z*JIRA._create_jwt_session.<locals>.<lambda>¬  s   € œtŸ™¬x×/AÑ/AÈ!Ô/LÓM€ ri   rÀ   r¸   rÓ  r   rœ   )rP   Ú	NameErrorrb   r^  Úset_header_formatÚ	add_fieldr¶   rJ  r°  rÝ   rä   )r•   rg  Újwt_authrt   rw  s        rZ   rV  zJIRA._create_jwt_session¢  sÔ   € ð	Ü˜s 8™}°'Ô:ˆHð 	×"Ñ" 8Ô,à×Ñ˜5Ñ"?Ô@Ø×ÑØÑMô	
ð 	×Ñ˜5¤,¨t¯}©}¸^Ñ/LÓ"MÔNØ�Y‘×%Ñ%Ó'ò 	+ˆAØ×Ñ˜q ™t Q q¡TÕ*ð	+à%ˆ�‰Õøô ò 	Ø�H‰H�N‰NÐEÔFØˆGûð	ús   ‚B3 Â3	CÂ<CÃCc                ó8   — t        |«      | j                  _        y)zhCreates token-based session.

        Header structure: "authorization": "Bearer <token_auth>".
        N)r  rÝ   rä   )r•   re  s     rZ   rW  zJIRA._create_token_session³  s   € ô
 ' zÓ2ˆ�‰Õri   c                ól   — d|i}| j                   j                  ||t        j                  |«      ¬«      S )Nrv  rE  )rÝ   rÒ  rø   rù   )r•   rÒ   rs   rŸ  rö   s        rZ   rž  zJIRA._set_avatarº  s0   € Ø�fˆ~ˆØ�}‰}× Ñ  ¨V¼$¿*¹*ÀTÓ:JÐ ÓKÐKri   c                ó„   — | j                   j                  «       }|j                  |dddœ«        |j                  di |¤ŽS )aX  Returns the full internal api url based on Jira base url and the path provided.

        Using the API version specified during the __init__.

        Args:
          path (str): The subpath desired.
          base (Optional[str]): The base url which should be prepended to the path

        Returns:
          str: Fully qualified URL
        Úlatestrì  )rÉ   r!  r  rV   ©rJ  r  rK  r}  ©r•   rÉ   r›  rc  s       rZ   r,  zJIRA._get_internal_url¾  sB   € ð —-‘-×$Ñ$Ó&ˆØ�‰Ø¨xÀjÑQô	
ð ˆt�{‰{Ñ%˜WÑ%Ð%ri   c                ó€   — | j                   j                  «       }|j                  d|i«        |j                  di |¤ŽS )aQ  Returns the full url based on Jira base url and the path provided.

        Using the API version specified during the __init__.

        Args:
            path (str): The subpath desired.
            base (Optional[str]): The base url which should be prepended to the path

        Returns:
            str: Fully qualified URL
        rÉ   rV   rN  rO  s       rZ   r¦  zJIRA._get_urlÐ  s:   € ð —-‘-×$Ñ$Ó&ˆØ�‰˜ �~Ô&Øˆt�{‰{Ñ%˜WÑ%Ð%ri   c                ó‚   — | j                   j                  «       }|j                  |ddœ«        |j                  di |¤ŽS )a;  Returns the full url based on Jira base url and the path provided.

        Using the latest API endpoint.

        Args:
            path (str): The subpath desired.
            base (Optional[str]): The base url which should be prepended to the path

        Returns:
            str: Fully qualified URL
        rM  )rÉ   r!  rV   rN  rO  s       rZ   rÑ  zJIRA._get_latest_urlà  s;   € ð —-‘-×$Ñ$Ó&ˆØ�‰ ¸(ÑCÔDØˆt�{‰{Ñ%˜WÑ%Ð%ri   c                ób  — | j                  ||«      }|r0| j                  j                  |t        j                  |«      ¬«      n| j                  j                  ||¬«      }	 t        |«      }|S # t        $ r5}| j                  j                  |› d|r|j                  n|› �«       |‚d}~ww xY w)a¨  Get the json for a given path and params.

        Args:
            path (str): The subpath required
            params (Optional[Dict[str, Any]]): Parameters to filter the json query.
            base (Optional[str]): The Base Jira URL, defaults to the instance base.
            use_post (bool): Use POST endpoint instead of GET endpoint.

        Returns:
            Union[Dict[str, Any], List[Dict[str, str]]]
        rõ   r™  r  N)r¦  rÝ   r÷   rø   rù   r_  rM   r  rb   r^  r_  )	r•   rÉ   rÒ   r›  rœ  rs   rü   rT  rt   s	            rZ   r£  zJIRA._get_jsonð  s§   € ð$ �m‰m˜D $Ó'ˆñ ð �M‰M×Ñ˜s¬¯©°FÓ);ÐÔ<à—‘×"Ñ" 3¨vÐ"Ó6ð 	
ð
	Ü “]ˆFð ˆøô ò 	Ø�H‰H�N‰N˜a˜S ©Q 1§6¢6°AÐ"6Ð7Ô8ØˆGûð	ús   Á#A0 Á0	B.Á90B)Â)B.c                ó¨   —  || j                   | j                  «      }i }|�||d<   |j                  ||¬«       |st        d|t	        |«      «      ‚|S )a  Uses the find method of the provided Resource class.

        Args:
            resource_cls (Any): Any instance of :py:class`Resource`
            ids (Union[Tuple[str, str], int, str]): The arguments to the Resource's ``find()``
            expand ([type], optional): The value for the expand property in the Resource's ``find()`` params. Defaults to None.

        Raises:
            JIRAError: If the Resource cannot be found

        Returns:
            Any: A class of the same type as ``resource_cls``
        rc  )rv  rÒ   zUnable to find resource %s(%s))rJ  rÝ   rÄ  r   r  )r•   Úresource_clsrÆ  rc  r®  rÒ   s         rZ   rÛ  zJIRA._find_for_resource  sZ   € ñ&   §¡¨t¯}©}Ó=ˆØˆØÐØ%ˆF�8ÑØ�‰˜ VˆÔ,ÙÜÐ<¸lÌCÐPSËHÓUÐUØˆri   c                ó  ‡— 	 dd l }dd l}	 |j                  |j                  ¬«      Šˆfd„}|j	                  | |«      | _        ‰| _        y # t        $ r
 d | _        Y y t        $ r
 d | _        Y y w xY w# t        $ r
 d | _        Y y w xY w)Nr   )Úflagsc                ó&   •— ‰j                  «        y rU   r…  )r�  Ú_magics    €rZ   Úcleanupz JIRA._try_magic.<locals>.cleanup6  s   ø€ Ø—L‘L•Nri   )
ÚweakrefÚmagicÚMagicÚMAGIC_MIME_TYPEÚrefÚ_magic_weakrefrX  r‰  ÚAttributeErrorr¡  )r•   rZ  r[  rY  rX  s       @rZ   rO  zJIRA._try_magic+  s†   ø€ ð	#Ûãð#ØŸ™¨5×+@Ñ+@˜ÓA�ô#ð '.§k¡k°$¸Ó&@�Ô#Ø$�•øÜò #Ø"�–Ü!ò #Ø"�–ð#ûô ò 	ØˆDŽKð	ús(   ƒA3 Œ?A ÁA0ÁA0Á/A0Á3BÂBc                ó"  — | j                   �| j                   j                  |«      S 	 t        j                  dt	        j
                  |«      j                  z   «      d   S # t        t        f$ r | j                  j                  d«       Y yw xY w)z«Get the MIME type for a given stream of bytes.

        Args:
            buff (bytes): Stream of bytes

        Returns:
            Optional[str]: the MIME type
        Nzf.r   z]Couldn't detect content type of avatar image. Specify the 'contentType' parameter explicitly.)rX  Ú	id_bufferÚ	mimetypesÚ
guess_typer   rõ  r}  ÚOSErrorr‰  rb   rc   )r•   Úbuffs     rZ   r‘  zJIRA._get_mime_type@  sƒ   € ð �;‰;Ð"Ø—;‘;×(Ñ(¨Ó.Ð.ð	Ü×'Ñ'¨¬u¯z©z¸$Ó/?×/FÑ/FÑ(FÓGÈÑJÐJøÜœÐ#ò 	Ø�H‰H×ÑðDôñ ð	ús   ©7A! Á!*BÂBc                ó:  — | j                   dkD  r‚| j                  d«      }d|i}d|i}| j                  j                  d| j	                  |«      j
                  › �«       | j                  j                  ||t        j                  |«      ¬«       yt        d«      ‚)	z‰Rename a Jira user.

        Args:
            old_user (str): Old username login
            new_user (str): New username login
        ri  rn  r{   ró   z	renaming rE  z<Support for renaming users in Jira < 6.0.0 has been removed.N)r\  rÑ  rb   r$  rn  rq  rÝ   rÒ  rø   rù   rz  )r•   Úold_userÚnew_userrs   rÓ  rÒ   s         rZ   Úrename_userzJIRA.rename_userT  s�   € ð �=‰=˜9Ò$Ø×&Ñ& vÓ.ˆCØ˜xÐ(ˆGØ  (Ð+ˆFð �H‰H�N‰N˜Y t§y¡y°Ó':×'GÑ'GÐ&HÐIÔJà�M‰M×Ñ˜c¨&´t·z±zÀ'Ó7JÐÕKä%ØQóð ri   c                óÚ   — | j                  d|› �«      }| j                  j                  |«      }d|j                  cxk  rdk  ry | j                  j                  |j                  «       y)z˜Deletes a Jira User.

        Args:
            username (str): Username to delete

        Returns:
            bool: Success of user deletion
        zuser/?username=r§  i+  TF)rÑ  rÝ   r  rr   rb   r^  )r•   ró   rs   rü   s       rZ   Údelete_userzJIRA.delete_useri  s_   € ð ×"Ñ" _°X°JÐ#?Ó@ˆà�M‰M× Ñ  Ó%ˆØ�!—-‘-Ô& 3Ò&Øð 'à�‰�‰�q—}‘}Ô%Øri   c                óØ  — | j                   �rdt        | «      vr^| j                  «       }|j                  €t	        d«      ‚dj                  |j                  d   d   |j                  d   d   «      | _        | j                  d   d	|› �z   }	 t        j                  || j                  d
dœ| j                  j                  i ¬«      }|j                  dk(  ry| j                  j                  d|› d|j                  › �«       |j                  S | j"                  dz   }d| j                  d   d<   | j%                  |«      }dd|j&                  |j(                  |j*                  |j&                  dœ}	 | j                  j                  || j                  d   |¬«      }|j                  dk(  ry| j                  j                  d|› d|j                  › �«       |j                  S # t        $ r7}| j                  j!                  d|› d|› �«       t	        d|› d|› �«      ‚d}~ww xY w# t        $ r7}| j                  j!                  d|› d|› �«       t	        d|› d|› �«      ‚d}~ww xY w)z–Disable/deactivate the user.

        Args:
            username (str): User to be deactivated.

        Returns:
            Union[str, int]
        Ú
authCookieNzCan not log in!z{}={}râ   r{   rÙ   r  z*/admin/rest/um/1/user/deactivate?username=r-  )r	  r/  )r
  rS  rö   r§  TzGot response from deactivating z: zError Deactivating z /secure/admin/user/EditUser.jspaz0application/x-www-form-urlencoded; charset=UTF-8r
  r/  ÚtrueÚdialog)ÚinlineÚ	decoratorró   ÚfullNamerv  ÚeditNamer^  )ra   Úvarsrâ   rZ  r   r}  rn  rJ  r€  r÷   rÝ   rS  rr   rb   rc   r]  r^  rN  rn  r{   rp  rq  )r•   ró   rn  rs   rü   rt   ÚuserInfos          rZ   Údeactivate_userzJIRA.deactivate_userz  s{  € ð �>‹>ð ¤4¨£:Ñ-Ø—|‘|“~�Ø—8‘8Ð#Ü#Ð$5Ó6Ð6Ø")§.¡.Ø—H‘H˜YÑ'¨Ñ/Ø—H‘H˜YÑ'¨Ñ0ó#�”ð
 —‘˜hÑ'Ø>¸x¸jÐIñJð ðGÜ—M‘MØà"&§/¡/Ø(:ñð !ŸM™M×1Ñ1Øô�ð —=‘= CÒ'ØØ—‘× Ñ Ø5°h°Z¸rÀ!Ç-Á-ÀÐQôð —}‘}Ð$ð
 —/‘/Ð$FÑFˆCð Cð �M‰M˜)Ñ$Øñð —9‘9˜XÓ&ˆDà Ø%Ø ŸI™IØ ×,Ñ,Ø×*Ñ*Ø ŸI™IñˆHðGØ—M‘M×&Ñ&Ø §¡¨yÑ!9Àð 'ó �ð —=‘= CÒ'ØØ—‘× Ñ Ø5°h°Z¸rÀ!Ç-Á-ÀÐQôð —}‘}Ð$øô5 ò GØ—‘—‘Ð!4°X°J¸bÀÀÐDÔEÜÐ"5°h°Z¸rÀ!ÀÐ EÓFÐFûðGûô6 ò GØ—‘—‘Ð!4°X°J¸bÀÀÐDÔEÜÐ"5°h°Z¸rÀ!ÀÐ EÓFÐFûðGús=   ÂA	G& Ã6G& Å4:H) Æ/6H) Ç&	H&Ç/2H!È!H&È)	I)È22I$É$I)c                óV  — |rdnd}| j                   dz   }| j                  j                  || j                  d   ¬«      }|j                  dk(  ry|j
                  j                  d«      s|sy|j
                  j                  d	«      r| j                  j                  d
«       y|j
                  j                  d«      s|rM| j                  j                  || j                  d   |ddœ¬«      }|j
                  j                  d	«      dk7  ry| j                  j                  d«       y)a&  Start jira re-indexing. Returns True if reindexing is in progress or not needed, or False.

        If you call reindex() without any parameters it will perform a background reindex only if Jira thinks it should do it.

        Args:
            force (bool): True to reindex even if Jira doesn't say this is needed. (Default: ``False``)
            background (bool): True to reindex in background, slower but does not impact the users. (Default: ``True``)

        Returns:
            bool: True if reindexing is in progress or not needed
        Ú
backgroundÚstoptheworldz$/secure/admin/jira/IndexReIndex.jspar
  r¦  i÷  z-To perform the re-index now, please go to theTzAll issues are being re-indexedz$Jira re-indexing is already running.zRe-Index)ÚindexingStrategyÚreindex©r
  rÒ   r5  z'Failed to reindex jira, probably a bug.F)rN  rÝ   r_  rJ  rr   r_  rÄ  rb   rc   r÷   r^  )r•   rc  ry  r{  rs   rü   s         rZ   r|  zJIRA.reindexÃ  s   € ñ ,6™<¸>ÐØ�o‰oÐ FÑFˆà�M‰M×Ñ˜c¨4¯=©=¸Ñ+CÐÓDˆØ�=‰=˜CÒàð —‘—‘ÐKÔLÙàà�6‰6�;‰;Ð8Ô9Ø�H‰H×ÑÐCÔDØà�6‰6�;‰;ÐFÔGÉ5Ø—‘×"Ñ"ØØŸ™ iÑ0Ø,<ÈÑTð #ó ˆAð
 �v‰v�{‰{Ð<Ó=ÀÒCØà�‰�‰Ð@ÔAØri   c                óø  — | j                   r9| j                  dz   }t        j                  d|i«      }d| j                  d   d<   n| j                  dz   }d|i}	 | j
                  j                  || j                  d   |¬«      }|j                  d	k(  ry
| j                  j                  d|j                  › d�«       |j                  S # t        $ r&}| j                  j                  d|«       Y d}~yd}~ww xY w)aµ  Will call jira export to backup as zipped xml. Returning with success does not mean that the backup process finished.

        Args:
            filename (str): the filename for the backup (Default: "backup.zip")
            attachments (bool): True to also backup attachments (Default: ``False``)

        Returns:
            Union[bool, int]: Returns True if successful else it returns the statuscode of the Response or False
        z/rest/backup/1/export/runbackupÚcbAttachmentsÚXMLHttpRequestr
  zX-Requested-Withz/secure/admin/XmlBackup.jsparú  r^  r§  TzGot z response from calling backup.zI see %sNF)ra   rN  rø   rù   rJ  rÝ   r÷   rr   rb   rc   r]  r^  )r•   rú  Úattachmentsrs   rÓ  rü   rt   s          rZ   ÚbackupzJIRA.backupï  sä   € ð �>Š>Ø—/‘/Ð$EÑEˆCÜ—j‘j /°;Ð!?Ó@ˆGØ;KˆD�M‰M˜)Ñ$Ð%7Ò8à—/‘/Ð$BÑBˆCØ! 8Ð,ˆGð	*Ø—‘×"Ñ" 3°·±¸iÑ0HÈwÐ"ÓWˆAØ�}‰} Ò#ØØ�H‰H×Ñ˜t A§M¡M ?Ð2PÐQÔRØ—=‘=Ð øÜò 	*Ø�H‰H�N‰N˜: q×)Ð)Øûð	*ús   Á:C
 Â4C
 Ã
	C9ÃC4Ã4C9c                ó€  — t        t        j                  «       dz  «      }| j                  r| j                  d|z  z   }n| j                  j                  d«       y| j                  j                  || j                  d   ¬«      }	 t        j                  |j                  «      S # t        $ rŽ ddlm} i }	 |j                  |j                  «      }n;# |j                   $ r)}| j                  j                  d|› �«       Y d}~Y yd}~ww xY w|j#                  «       D ]  }|j                  |«      ||<   Œ |cY S w xY w)	z¤Return status of cloud backup as a dict.

        Is there a way to get progress for Server version?

        Returns:
            Optional[Dict[str, Any]]
        iè  z/rest/obm/1.0/getprogress?_=%iú5This functionality is not available in Server versionNr
  r¦  r   zHUnable to find backup info. You probably need to initiate a new backup. )r«   r  ra   rN  rb   rc   rÝ   r_  rJ  rø   r˜  r_  r]  Údefusedxml.ElementTreeÚElementTreeÚ
fromstringÚ
ParseErrorrÎ   )	r•   Ú
epoch_timers   rü   ÚetreeÚprogressÚrootÚper¶  s	            rZ   Úbackup_progresszJIRA.backup_progress  s  € ô œŸ™› tÑ+Ó,ˆ
Ø�>Š>Ø—/‘/Ð$DÀzÑ$QÑQ‰Cà�H‰H×ÑÐTÔUØØ�M‰M×Ñ˜c¨4¯=©=¸Ñ+CÐÓDˆð	Ü—:‘:˜aŸf™fÓ%Ð%øÜò 	Ý2àˆHðØ×'Ñ'¨¯©Ó/‘øØ×#Ñ#ò Ø—‘× Ñ Ø^Ð_aÐ^bÐcôõ ûð	úð
 —Y‘Y“[ò *�Ø"Ÿh™h q›k�˜’ð*àŠOð	ús<   ÂB& Â&D=Â8CÃD=ÃDÃ#DÄD=ÄDÄ.D=Ä<D=c                ó  — | j                   s| j                  j                  d«       y| j                  «       }t	        j
                  d|d   «      }t        |j                  d«      «      }t        |d   «      }|dk\  xr |dkD  S )	zfReturn boolean based on 'alternativePercentage' and 'size' returned from backup_progress (cloud only).r„  Nz\s([0-9]*)\sÚalternativePercentagerœ   rÉ  r2  r   )ra   rb   rc   rŽ  ÚrerÄ  r«   rd  )r•   r–  Úperc_searchÚperc_completeÚ	file_sizes        rZ   Úbackup_completezJIRA.backup_complete.  s   € à�~Š~Ø�H‰H×ÑÐTÔUØØ×%Ñ%Ó'ˆÜ—i‘i °Ð8OÑ1PÓQˆÜØ×Ñ˜aÓ ó
ˆô ˜˜v™Ó'ˆ	Ø Ñ#Ò5¨	°A©Ð5ri   c                óR  — | j                   s| j                  j                  d«       y| j                  «       d   }|xs |}| j                  dz   |z   }	 | j                  j                  d|› �«       t        |d«      5 }	 | j                  j                  || j                  d   d¬	«      }|j                  s=| j                  j                  d
|j                  › �«       t        |j                  «      ‚|j                  d«      D ]  }|j!                  |«       Œ 	 ddd«       y# t        $ r t        «       ‚w xY w# 1 sw Y   yxY w# t        $ r(}| j                  j                  d|› �«       Y d}~yd}~wt"        $ r%}	| j                  j                  |	«       Y d}	~	yd}	~	ww xY w)z.Download backup file from WebDAV (cloud only).r„  NÚfileNamez/webdav/backupmanager/zWriting file to Úwbr
  T)r
  Ústreamz$Something went wrong with download: i   z%Unable to access remote backup file: )ra   rb   rc   rŽ  rN  r$  rõ  rÝ   r_  rJ  r]  r   r<  r^  r_  Úiter_contentÚwritere  )
r•   rú  Úremote_fileÚ
local_filers   rä  ÚrespÚblockrŸ  Úioes
             rZ   Úbackup_downloadzJIRA.backup_download;  s‡  € à�~Š~Ø�H‰H×ÑÐTÔUØØ×*Ñ*Ó,¨ZÑ8ˆØÒ, ˆ
Ø�o‰oÐ 8Ñ8¸;ÑFˆð	 Ø�H‰H�N‰NÐ-¨j¨\Ð:Ô;Ü�j $Ó'ð &¨4ð&ØŸ=™=×,Ñ,Ø T§]¡]°9Ñ%=Àdð -ó �Dð
 —w’wØ—H‘H—N‘NÐ%IÈ$Ï)É)ÈÐ#UÔVÜ# D§I¡IÓ.Ð.Ø!×.Ñ.¨tÓ4ò &�EØ—J‘J˜uÕ%ñ&÷&ð  øô !ò &Ü#›+Ð%ð&ú÷&ð  ûô	 ò 	IØ�H‰H�N‰NÐBÀ2À$ÐG×HÐHð ûô ò 	 Ø�H‰H�N‰N˜3×ÐØûð	 ús[   Á*E	 Á?D=Â+D&Â,A0D=ÄE	 Ä&D:Ä:D=Ä=EÅE	 ÅE	 Å		F&ÅE5Å5F&ÆF!Æ!F&c                óö   — t        | d«      sM| j                  d«      }| j                  j                  || j                  d   ¬«      }t        |«      }|| _        |€| j                  rdnd}| j                  |   S )a‚  Return the `accountId` (Cloud) else `username` of the current user.

        For anonymous users it will return a value that evaluates as False.

        Args:
            field (Optional[str]): the name of the identifier field.
              Defaults to "accountId" for Jira Cloud, else "username"

        Returns:
            str: User's `accountId` (Cloud) else `username`.
        Ú_myselfrÕ  r
  r¦  ro  r{   )rÊ  r¦  rÝ   r_  rJ  rM   r£  ra   )r•   rP  rs   rü   rT  s        rZ   Úcurrent_userzJIRA.current_userW  sq   € ô �t˜YÔ'Ø—-‘- Ó)ˆCØ—‘×!Ñ! #¨t¯}©}¸YÑ/GÐ!ÓHˆAä%/°£]ˆFØ!ˆDŒLàˆ=ð $(§>¢>‘K°vˆEà�|‰|˜EÑ"Ð"ri   c                óJ  — t        |t        «      r!t        |d«      rt        |j                  «      }| j                  d|› �«      }| j                  j                  |d|i¬«      }|j                  dk(  rt        d«      ‚|j                  dk(  rt        d«      ‚|j                  S )	aÁ  Delete project from Jira.

        Args:
            pid (Union[str, Project]): Jira projectID or Project or slug.
            enable_undo (bool): Jira Cloud only. True moves to 'Trash'. False permanently deletes.

        Raises:
            JIRAError:  If project not found or not enough permissions
            ValueError: If pid parameter is not Project, slug or ProjectID

        Returns:
            bool: True if project was deleted
        rv  rŒ  Ú
enableUndor™  i“  z(Not enough permissions to delete projectrp   zProject not found in Jira)r_   r<   rÊ  r  rv  r¦  rÝ   r  rr   r   r<  )r•   ÚpidÚenable_undors   rü   s        rZ   Údelete_projectzJIRA.delete_projectq  s�   € ô" �cœ7Ô#¬°°TÔ(:Ü�c—f‘f“+ˆCà�m‰m˜h s eÐ,Ó-ˆØ�M‰M× Ñ  ¨l¸KÐ-HÐ ÓIˆØ�=‰=˜CÒÜÐFÓGÐGØ�=‰=˜CÒÜÐ7Ó8Ð8Ø�t‰tˆri   c                ó.  — | j                   dz   }| j                  j                  st        |«      | j                  _        | j                  j                  d   |ddœ}|j	                  |«       | j                  j                  |t        ddi«      |¬«      S )Nz&/secure/admin/WebSudoAuthenticate.jsparœ   ro  )ÚwebSudoPasswordÚwebSudoDestinationÚwebSudoIsPostrå  z!application/x-www-form-urlencodedr^  )rN  rÝ   rä   r   rK  r÷   r   )r•   rc  r  rs   rÓ  s        rZ   Ú_gain_sudo_sessionzJIRA._gain_sudo_session�  s“   € Ø�o‰oÐ HÑHˆà�}‰}×!Ò!Ü!/°Ó!4ˆD�M‰MÔð  $Ÿ}™}×1Ñ1°!Ñ4Ø"-Ø#ñ
ˆð 	�‰�wÔà�}‰}×!Ñ!ØÜ'ØÐ!DÐEóð ð "ó 
ð 	
ri   )Úmaxsizec                ó´   — | j                   dz   }| j                  j                  |«      }t        |«      }i }d|v r|d   D ]  }|d   D ]
  }|||d   <   Œ Œ |S )Nz(/rest/project-templates/latest/templatesÚprojectTemplatesGroupedByTypeÚprojectTemplatesr{   )rN  rÝ   r_  rM   )r•   rs   rü   rö   Ú	templatesrd  rx  s          rZ   r³  zJIRA.templates£  s{   € à�o‰oÐ JÑJˆà�M‰M×Ñ˜cÓ"ˆÜ)¨!›}ˆàˆ	Ø*¨dÑ2ØÐ=Ñ>ò -�ØÐ1Ñ2ò -�AØ+,�I˜a ™iÒ(ñ-ð-ð Ðri   c                óz   — | j                  d«      }| j                  j                  |«      }t        |«      }|d   S )NÚpermissionschemeÚpermissionSchemes©r¦  rÝ   r_  rM   ©r•   rs   rü   rö   s       rZ   ÚpermissionschemeszJIRA.permissionschemes²  s:   € à�m‰mÐ.Ó/ˆà�M‰M×Ñ˜cÓ"ˆÜ)¨!›}ˆàÐ'Ñ(Ð(ri   c                óz   — | j                  d«      }| j                  j                  |«      }t        |«      }|d   S )z¸Get all issue type schemes defined (Admin required).

        Returns:
            List[IssueTypeScheme]: All the Issue Type Schemes available to the currently logged in user.
        ÚissuetypeschemeÚschemesr·  r¸  s       rZ   Úissue_type_schemeszJIRA.issue_type_schemes»  s:   € ð �m‰mÐ-Ó.ˆà�M‰M×Ñ˜cÓ"ˆÜ)¨!›}ˆà�I‰Ðri   c                óz   — | j                  d«      }| j                  j                  |«      }t        |«      }|d   S )NÚissuesecurityschemesÚissueSecuritySchemesr·  r¸  s       rZ   r¿  zJIRA.issuesecurityschemesÉ  s:   € à�m‰mÐ2Ó3ˆà�M‰M×Ñ˜cÓ"ˆÜ)¨!›}ˆàÐ*Ñ+Ð+ri   c                ót   — | j                  d«      }| j                  j                  |«      }t        |«      }|S )NÚprojectCategoryr·  r¸  s       rZ   ÚprojectcategorieszJIRA.projectcategoriesÒ  s3   € à�m‰mÐ-Ó.ˆà�M‰M×Ñ˜cÓ"ˆÜ˜!‹}ˆàˆri   c                ó‚   — | j                  d|› d�«      }| j                  j                  |«      }t        |«      }|d   S )Nzavatar/z/systemÚsystemr·  )r•   Úentityrs   rü   rö   s        rZ   ÚavatarszJIRA.avatarsÛ  s@   € à�m‰m˜g f X¨WÐ5Ó6ˆà�M‰M×Ñ˜cÓ"ˆÜ)¨!›}ˆà�H‰~Ðri   c                óz   — | j                  d«      }| j                  j                  |«      }t        |«      }|d   S )NÚnotificationschemer×   r·  r¸  s       rZ   ÚnotificationschemeszJIRA.notificationschemesä  s:   € ð �m‰mÐ0Ó1ˆà�M‰M×Ñ˜cÓ"ˆÜ)¨!›}ˆØ�H‰~Ðri   c                óz   — | j                  d«      }| j                  j                  |«      }t        |«      }|d   S )NÚscreensr×   r·  r¸  s       rZ   rÌ  zJIRA.screensí  s9   € ð �m‰m˜IÓ&ˆà�M‰M×Ñ˜cÓ"ˆÜ)¨!›}ˆØ�H‰~Ðri   c                ót   — | j                  d«      }| j                  j                  |«      }t        |«      }|S )NÚworkflowschemesr·  r¸  s       rZ   ÚworkflowschemezJIRA.workflowschemeö  s5   € ð �m‰mÐ-Ó.ˆà�M‰M×Ñ˜cÓ"ˆÜ˜!‹}ˆØˆri   c                ót   — | j                  d«      }| j                  j                  |«      }t        |«      }|S )NÚworkflowr·  r¸  s       rZ   Ú	workflowszJIRA.workflowsÿ  s4   € ð �m‰m˜JÓ'ˆà�M‰M×Ñ˜cÓ"ˆÜ˜!‹}ˆØˆri   c                ó®   — | j                  d|› �«      }| j                  j                  |«      }t        |«      }| j                  j                  «        |S )Nzscreens/)r¦  rÝ   r  rM   rÌ  Úcache_clear©r•   rv  rs   rü   rö   s        rZ   Údelete_screenzJIRA.delete_screen  sH   € Ø�m‰m˜h r d˜OÓ,ˆà�M‰M× Ñ  Ó%ˆÜ˜!‹}ˆà�‰× Ñ Ô"Øˆri   c                ó®   — | j                  d|› �«      }| j                  j                  |«      }t        |«      }| j                  j                  «        |S )Nzpermissionscheme/)r¦  rÝ   r  rM   r¹  rÔ  rÕ  s        rZ   Údelete_permissionschemezJIRA.delete_permissionscheme  sL   € Ø�m‰mÐ/°¨tÐ4Ó5ˆà�M‰M× Ñ  Ó%ˆÜ˜!‹}ˆà×Ñ×*Ñ*Ô,Øˆri   c                ó|   — | j                  d|› d�«      }| j                  j                  |«      }t        |«      }|S )a  For the specified issue type scheme, returns all of the associated projects. (Admin required).

        Args:
            id (str): The issue type scheme id.

        Returns:
            List[Project]: Associated Projects for the Issue Type Scheme.
        zissuetypescheme/z/associationsr·  rÕ  s        rZ   Ú"get_issue_type_scheme_associationsz'JIRA.get_issue_type_scheme_associations  s>   € ð �m‰mÐ.¨r¨d°-Ð@ÓAˆØ�M‰M×Ñ˜cÓ"ˆÜ˜!‹}ˆØˆri   c                óú  — d}|€| j                  «       }|€|}|€2| j                  «       }|D ]  }|d   dk(  sŒ|d   } n |€
|r|d   d   }|€2| j                  «       }|D ]  }|d   dk(  sŒ|d   } n |€
|r|d   d   }|r|	s|n|	}	|	€2| j                  «       }|D ]  }|d   dk(  sŒ|d   }	 n |	€
|r|d   d   }	|s| j                  rdnd}n|}d|d	|d
|d|| j                  rdnd|dddddt        |«      d|
d|i
}|rt        |«      |d<   |	rt        |	«      |d<   | j                  d«      }| j                  j                  |t        j                  |«      ¬«      }|j                  «        t        |«      }|S )aä  Create a project with the specified parameters.

        Args:
            key (str): Mandatory. Must match Jira project key requirements, usually only 2-10 uppercase characters.
            name (Optional[str]): If not specified it will use the key value.
            assignee (Optional[str]): Key of the lead, if not specified it will use current user.
            ptype (Optional[str]): Determines the type of project that should be created. Defaults to 'software'.
            template_name (Optional[str]): Is used to create a project based on one of the existing project templates.
              If `template_name` is not specified, then it should use one of the default values.
            avatarId (Optional[int]): ID of the avatar to use for the project.
            issueSecurityScheme (Optional[int]): Determines the security scheme to use. If none provided, will fetch the
              scheme named 'Default' or the first scheme returned.
            permissionScheme (Optional[int]): Determines the permission scheme to use. If none provided, will fetch the
              scheme named 'Default Permission Scheme' or the first scheme returned.
            projectCategory (Optional[int]): Determines the category the project belongs to. If none provided,
              will fetch the one named 'Default' or the first category returned.
            notificationScheme (Optional[int]): Determines the notification scheme to use.
            categoryId (Optional[int]): Same as projectCategory. Can be used interchangeably.
            url (Optional[str]): A link to information about the project, such as documentation.

        Returns:
            Union[bool,int]: Should evaluate to False if it fails otherwise it will be the new project id.
        Nr{   zDefault Permission Schemerv  r   ÚDefaultz.com.pyxis.greenhopper.jira:gh-simplified-basicz>com.pyxis.greenhopper.jira:basic-software-development-templaterz   ÚprojectTypeKeyÚprojectTemplateKeyÚleadAccountIdÚleadr  ÚPROJECT_LEADr	  r4  ÚpermissionSchemeÚnotificationSchemers   ÚissueSecuritySchemeÚ
categoryIdr  rõ   )r¤  r¹  r¿  rÃ  ra   r«   r¦  rÝ   r÷   rø   rù   rú   rM   )r•   rz   r{   rß  ÚptypeÚtemplate_nameÚavatarIdrä  râ  rÂ  rã  rå  rs   Útemplate_keyÚps_listÚsecrÓ  rü   rT  s                      rZ   Úcreate_projectzJIRA.create_project(  s  € ðL ˆàÐØ×(Ñ(Ó*ˆHØˆ<ØˆDð Ð#Ø×,Ñ,Ó.ˆGØò �Ø�v‘;Ð"=Ó=Ø'*¨4¡yÐ$Ùðð  Ð'©GØ#*¨1¡:¨dÑ#3Ð àÐ&Ø×/Ñ/Ó1ˆGØò �Ø�v‘; )Ó+Ø*-¨d©)Ð'Ùðð #Ð*©wØ&-¨a¡j°Ñ&6Ð#ñ
 %©_‰JÀ/ð 	ð Ð"Ø×,Ñ,Ó.ˆGØò �Ø�v‘; )Ó+Ø&)¨$¡i�OÙðð Ð&©7Ø")¨!¡*¨TÑ"2�ñ ð —>’>ñ AàUñ ð )ˆLðt �DØ�3Ø˜eØ  ,Ø#Ÿ~š~‰O°6¸8Ø˜NØ˜2à¤Ð$4Ó 5Ø Ð"4Ø�3ð
ˆñ Ü-0Ð1DÓ-EˆGÐ)Ñ*ÙÜ$'¨Ó$8ˆG�LÑ!à�m‰m˜IÓ&ˆà�M‰M×Ñ˜s¬¯©°GÓ)<ÐÓ=ˆØ	×ÑÔÜ˜A“ˆØˆri   c
                óŽ  — |s|}| j                  d«      }
t        «       }||d<   ||d<   ||d<   |r||d<   |rd|d<   |	�|	|d	<   t        j                  |«      }	 | j                  j                  |
|¬
«       y# t        $ rC}|j                  �0|j                  j                  «       d   }d|v r|d   dk(  r|rY d}~y|‚d}~ww xY w)aÐ  Create a new Jira user.

        Args:
            username (str): the username of the new user
            email (str): email address of the new user
            directoryId (int): The directory ID the new user should be a part of (Default: ``1``)
            password (Optional[str]): Optional, the password for the new user
            fullname (Optional[str]): Optional, the full name of the new user
            notify (bool): True to send a notification to the new user. (Default: ``False``)
            active (bool): True to make the new user active upon creation. (Default: ``True``)
            ignore_existing (bool): True to ignore existing users. (Default: ``False``)
            application_keys (Optional[list]): Keys of products user should have access to

        Raises:
            JIRAError:  If username already exists and `ignore_existing` has not been set to `True`.

        Returns:
            bool: Whether the user creation was successful.
        rn  rp  rq  r{   rô   ÚTrueÚnotificationNÚapplicationKeysrõ   r’  ró   z)A user with that username already exists.T)rÑ  r   rø   rù   rÝ   r÷   r   ro   )r•   ró   rv  ÚdirectoryIdrô   ru  Únotifyrs  Úignore_existingÚapplication_keysrs   r�  rÓ  rt   Úerrs                  rZ   Úadd_userzJIRA.add_userÖ  sí   € ñ> ØˆHð ×"Ñ" 6Ó*ˆô (›Mˆà#ˆˆ-ÑØ!ˆˆ.ÑØˆˆ&‰	ÙØ$ˆAˆj‰MÙØ &ˆAˆnÑØÐ'Ø#3ˆAÐÑ ä—*‘*˜Q“-ˆð	Ø�M‰M×Ñ˜s¨ÐÔ1ð øô ò 		Ø�z‰zÐ%Ø—j‘j—o‘oÓ'¨Ñ1�à #Ñ%Ø˜J™Ð+VÒVÙ'äØˆGûð		ús   ÁA8 Á8	CÂ7B?Â=B?Â?Cc                óÊ   — | j                  d«      }d|i}d|i}t        j                  |«      }t        | j                  j                  |||¬«      «      }d|vs|d   |k7  ry|S )a^  Add a user to an existing group.

        Args:
            username (str): Username that will be added to specified group.
            group (str): Group that the user will be added to.

        Returns:
            Union[bool,Dict[str,Any]]: json response from Jira server for success or a value that evaluates as False in case of failure.
        ú
group/userrl  r{   rE  F)rÑ  rø   rù   rM   rÝ   r÷   )r•   ró   rd  rs   r�  ÚyrÓ  rü   s           rZ   Úadd_user_to_groupzJIRA.add_user_to_group  so   € ð ×"Ñ" <Ó0ˆØ˜%Ð ˆØ�XÐˆä—*‘*˜Q“-ˆä& t§}¡}×'9Ñ'9¸#ÀaÈgÐ'9Ó'VÓWˆØ˜‰?˜a ™i¨5Ò0ØàˆHri   c                ój   — | j                  d«      }||dœ}| j                  j                  ||¬«       y)zàRemove a user from a group.

        Args:
            username (str): The user to remove from the group.
            groupname (str): The group that the user will be removed from.

        Returns:
            bool
        rø  )rl  ró   r™  Tr„  )r•   ró   rl  rs   r�  s        rZ   Úremove_user_from_groupzJIRA.remove_user_from_group.  s8   € ð ×"Ñ" <Ó0ˆØ#°Ñ:ˆà�‰×Ñ˜S¨ÐÔ+àri   c                ót   — | j                  d«      }| j                  j                  |«      }t        |«      }|S )ztReturn Jira role information.

        Returns:
            List[Dict[str,Any]]: List of current user roles
        Úrole)rÑ  rÝ   r_  rM   r¸  s       rZ   rþ  z	JIRA.role?  s6   € ð ×"Ñ" 6Ó*ˆà�M‰M×Ñ˜cÓ"ˆÜ%/°£]ˆØˆri   c                óÔ   — | j                   dz   }t        |«      j                  «       rd|› �}|||dœ}| j                  j	                  || j
                  d   |¬«      }t        |«      S )Nz$/rest/idalko-igrid/1.0/datagrid/dataÚcustomfield_)Ú_issueIdÚ_fieldIdÚ_confSchemeIdr
  r}  )rN  r  ÚisdigitrÝ   r_  rJ  rM   )r•   ÚissueidÚcustomfieldÚschemeidrs   rÒ   rü   s          rZ   Ú	get_igridzJIRA.get_igridO  sn   € Ø�o‰oÐ FÑFˆÜˆ{Ó×#Ñ#Ô%Ø(¨¨Ð6ˆKàØ#Ø%ñ
ˆð
 �M‰M×Ñ˜c¨4¯=©=¸Ñ+CÈFÐÓSˆÜ˜!‹}Ðri   c           	     ó|   — i }|r||d<   |r||d<   |r||d<   | j                  t        dd|||| j                  ¬«      S )a*  Get a list of board resources.

        Args:
            startAt: The starting index of the returned boards. Base index: 0.
            maxResults: The maximum number of boards to return per page. Default: 50
            type: Filters results to boards of the specified type. Valid values: scrum, kanban.
            name: Filters results to boards that match or partially match the specified name.
            projectKeyOrID: Filters results to boards that match the specified project key or ID.

        Returns:
            ResultList[Board]
        rÿ  r{   ÚprojectKeyOrIdr×   Úboard©r›  )rº  r%   ÚAGILE_BASE_URL)r•   rŽ   r�   rÿ  r{   ÚprojectKeyOrIDrÒ   s          rZ   ÚboardszJIRA.boards_  sb   € ð* ˆÙØ!ˆF�6‰NÙØ!ˆF�6‰NÙØ'5ˆFÐ#Ñ$à× Ñ ÜØØØØØØ×$Ñ$ð !ó 
ð 	
ri   c           	     ó€   — i }|r||d<   |�t        d«       | j                  t        dd|› d�|||| j                  «      S )a&  Get a list of sprint Resources.

        Args:
            board_id (int): the board to get sprints from
            extended (bool): Deprecated.
            startAt (int): the index of the first sprint to return (0 based)
            maxResults (int): the maximum number of sprints to return
            state (str): Filters results to sprints in specified states. Valid values: `future`, `active`, `closed`.
              You can define multiple states separated by commas

        Returns:
            ResultList[Sprint]: List of sprints.
        Ústatez%The `extended` argument is deprecatedr×   zboard/z/sprint)rC  rº  rD   r  )r•   Úboard_idÚextendedrŽ   r�   r  rÒ   s          rZ   ÚsprintszJIRA.sprints†  s[   € ð, ˆÙØ#ˆF�7‰OàÐÜÐFÔGà× Ñ ÜØØ�X�J˜gÐ&ØØØØ×Ñó
ð 	
ri   c                óÂ   — i }| j                  |||¬«      D ]E  }|j                  |vr|j                  ||j                  <   Œ+t        d|j                  › d|› d�«      ‚ |S )aé  Get a dictionary of sprint Resources where the name of the sprint is the key.

        Args:
            board_id (int): the board to get sprints from
            extended (bool): Deprecated.
            state (str): Filters results to sprints in specified states. Valid values: `future`, `active`, `closed`.
              You can define multiple states separated by commas

        Returns:
            Dict[str, Dict[str, Any]]: dictionary of sprints with the sprint name as key
        )r  r  z1There are multiple sprints defined with the name z on board id zS,
returning a dict with sprint names as a key, assumes unique names for each sprint)r  r{   rZ  r   )r•   rv  r  r  r  r¨   s         rZ   Úsprints_by_namezJIRA.sprints_by_name­  sx   € ð ˆØ—‘˜b¨8¸5�ÓAò 	ˆAØ�v‰v˜WÑ$Ø"#§%¡%�˜Ÿ™’äØGÈÏÉÀxÈ}Ð]_Ð\`ð ahð ióð ð		ð ˆri   c                ó  — i }|r||d<   |r||d<   |r||d<   |r||d<   |r||d<   | j                  d|› �| j                  ¬«      }| j                  j                  |t	        j
                  |«      ¬«      }	t        |	«      S )	añ  Updates the sprint with the given values.

        Args:
            id (Union[str, int]): The id of the sprint to update
            name (Optional[str]): The name to update your sprint to
            startDate (Optional[Any]): The start date for the sprint
            endDate (Optional[Any]): The start date for the sprint
            state: (Optional[str]): The state of the sprint
            goal: (Optional[str]): The goal of the sprint

        Returns:
            Dict[str, Any]
        r{   r   ÚendDater  Úgoalúsprint/r  rõ   )r¦  r  rÝ   rÒ  rø   rù   rM   )
r•   rv  r{   r   r  r  r  rÓ  rs   rü   s
             rZ   Úupdate_sprintzJIRA.update_sprintÆ  s’   € ð, ˆÙØ"ˆG�F‰OÙØ#,ˆG�KÑ ÙØ!(ˆG�IÑÙØ$ˆG�GÑÙØ"ˆG�F‰Oà�m‰m˜g b T˜N°×1DÑ1DˆmÓEˆØ�M‰M×Ñ˜c¬¯
©
°7Ó(;ÐÓ<ˆä˜!‹}Ðri   c                ó^   — | j                  d|› d|› �| j                  ¬«      }|d   d   d   S )ú0Return the total incompleted points this sprint.ú&rapid/charts/sprintreport?rapidViewId=ú
&sprintId=r  ÚcontentsÚincompletedIssuesEstimateSumrÙ   ©r£  r  ©r•   r  Ú	sprint_idrö   s       rZ   r!  z!JIRA.incompletedIssuesEstimateSumí  sF   € à#Ÿ~™~Ø4°X°J¸jÈÈÐTØ×$Ñ$ð  .ó  
ˆð �JÑÐ >Ñ?ÀÑHÐHri   c                ó¾   — | j                  d|› d|› �| j                  ¬«      }|d   d   D �cg c]#  }t        | j                  | j                  |«      ‘Œ% }}|S c c}w )z^Return the completed issues for the sprint.

        Returns:
            List[Issue]
        r  r  r  r   ÚpuntedIssues)r£  r  r1   rJ  rÝ   )r•   r  r$  rT  Úraw_issues_jsonr˜  s         rZ   Úremoved_issueszJIRA.removed_issuesõ  sv   € ð "&§¡Ø4°X°J¸jÈÈÐTØ×$Ñ$ð "0ó "
ˆð $*¨*Ñ#5°nÑ#Eö
àô �$—-‘- §¡°Õ@ð
ˆð 
ð
 ˆùò
s   ®(Ac                ó^   — | j                  d|› d|› �| j                  ¬«      }|d   d   d   S )r  r  r  r  r   ÚpuntedIssuesEstimateSumrÙ   r"  r#  s       rZ   ÚremovedIssuesEstimateSumzJIRA.removedIssuesEstimateSum  sF   € à#Ÿ~™~Ø4°X°J¸jÈÈÐTØ×$Ñ$ð  .ó  
ˆð �JÑÐ 9Ñ:¸7ÑCÐCri   c                ó|   — t        | j                  | j                  «      }|j                  |«       |j                  S )a   Return the information about a sprint.

        Args:
            board_id (str): the board retrieving issues from. Deprecated and ignored.
            sprint_id (str): the sprint retrieving issues from

        Returns:
            Dict[str, Any]
        )rD   rJ  rÝ   rÄ  rZ  )r•   r  r$  Úsprints       rZ   Úsprint_infozJIRA.sprint_info  s.   € ô ˜Ÿ™ t§}¡}Ó5ˆØ�‰�IÔØ�z‰zÐri   c                óh   — t        | j                  | j                  «      }|j                  |«       |S )z¢Return the information about a sprint.

        Args:
            sprint_id (int): the sprint retrieving issues from

        Returns:
            Sprint
        )rD   rJ  rÝ   rÄ  )r•   rv  r-  s      rZ   r-  zJIRA.sprint  s(   € ô ˜Ÿ™ t§}¡}Ó5ˆØ�‰�BŒØˆri   c                ól   — t        | j                  | j                  d|i¬«      }|j                  «        y)zDelete an agile board.rv  r  N)r%   rJ  rÝ   r  )r•   rv  r  s      rZ   Údelete_boardzJIRA.delete_board+  s%   € ä�d—m‘m T§]¡]¸¸r¸
ÔCˆØ�‰�ri   c                óÆ  — i }|�t        d«       |�| j                  |«      j                  }||d<   ||d<   ||d<   | j                  r!d|i|d<   |dvr|d   j	                  d|i«       | j                  d| j                  ¬	«      }| j                  j                  |t        j                  |«      ¬
«      }	t        |	«      }
t        | j                  | j                  |
¬«      S )a½  Create a new board for the ``project_ids``.

        Args:
            name (str): name of the Board (<255 characters).
            filter_id (str): the Filter to use to create the Board.
              Note: if the user does not have the 'Create shared objects' permission and tries to create a shared board,
              a private board will be created instead (remember that board sharing depends on the filter sharing).
            project_ids (str): Deprecated. See location_id.
            preset (str): What preset/type to use for this Board, options: kanban, scrum, agility. (Default: "scrum")
            location_type (str): the location type. Available in Cloud. (Default: "user")
            location_id (Optional[str]):  aka ``projectKeyOrId``. The id of Project that the Board should be located under.
              Omit this for a 'user' location_type. Available in Cloud.

        Returns:
            Board: The newly created board
        zcproject_ids is deprecated and ignored. Use filter_id and location_id with `location_type='project'`r{   ÚfilterIdrÿ  Úlocation)rn  r
  r  r  rõ   r  )rC  r  rv  ra   rK  r¦  r  rÝ   r÷   rø   rù   rM   r%   rJ  )r•   r{   r`  Úproject_idsÚpresetÚlocation_typeÚlocation_idrÓ  rs   rü   r½  s              rZ   Úcreate_boardzJIRA.create_board0  sæ   € ð2 #%ˆàÐ"ÜðQôð
 Ð"ØŸ,™, {Ó3×6Ñ6ˆKàˆ�‰Ø'ˆ�
ÑØ ˆ�‰Ø�>Š>Ø#)¨=Ð"9ˆG�JÑØ IÑ-Ø˜
Ñ#×*Ñ*Ð,<¸kÐ+JÔKà�m‰m˜G¨$×*=Ñ*=ˆmÓ>ˆØ�M‰M×Ñ˜s¬¯©°GÓ)<ÐÓ=ˆä# A›ˆÜ�T—]‘] D§M¡M°~ÔFÐFri   c                ó2  — d|i}|r||d<   |r||d<   |r||d<   | j                  d| j                  ¬«      }||d<   | j                  j                  |t	        j
                  |«      ¬«      }t        |«      }	t        | j                  | j                  |	¬	«      S )
a©  Create a new sprint for the ``board_id``.

        Args:
            name (str): Name of the sprint
            board_id (int): Which board the sprint should be assigned.
            startDate (Optional[Any]): Start date for the sprint.
            endDate (Optional[Any]): End date for the sprint.
            goal (Optional[str]): Goal for the sprint.

        Returns:
            Sprint: The newly created Sprint
        r{   r   r  r  r-  r  ÚoriginBoardIdrõ   r  )	r¦  r  rÝ   r÷   rø   rù   rM   rD   rJ  )
r•   r{   r  r   r  r  rÓ  rs   rü   Úraw_sprint_jsons
             rZ   Úcreate_sprintzJIRA.create_sprintb  s™   € ð( $*¨4 .ˆÙØ#,ˆG�KÑ ÙØ!(ˆG�IÑÙØ"ˆG�F‰Oð �m‰m˜H¨4×+>Ñ+>ˆmÓ?ˆØ#+ˆ�Ñ Ø�M‰M×Ñ˜s¬¯©°GÓ)<ÐÓ=ˆÜ$ Q›-ˆä�d—m‘m T§]¡]¸ÔHÐHri   c                ó¬   — | j                  d|› d�| j                  ¬«      }d|i}| j                  j                  |t	        j
                  |«      ¬«      S )až  Add the issues in ``issue_keys`` to the ``sprint_id``.

        The sprint must be started but not completed.

        If a sprint was completed, then have to also edit the history of the issue so that it was added to the sprint before it was
        completed, preferably before it started. A completed sprint's issues also all have a resolution set before the completion date.

        If a sprint was not started, then have to edit the marker and copy the rank of each issue too.

        Args:
            sprint_id (int): the sprint to add issues to
            issue_keys (List[str]): the issues to add to the sprint

        Returns:
            Response
        r  ú/issuer  r˜  rõ   ©r¦  r  rÝ   r÷   rø   rù   )r•   r$  Ú
issue_keysrs   rÓ  s        rZ   Úadd_issues_to_sprintzJIRA.add_issues_to_sprint†  sR   € ð" �m‰m˜g i [°Ð7¸d×>QÑ>QˆmÓRˆØ˜ZÐ(ˆØ�}‰}×!Ñ! #¬D¯J©J°wÓ,?Ð!Ó@Ð@ri   c                ó   — i }t        |t        «      r|j                  d«      n
t        |«      |d<   |�t	        d«       | j                  d|› d�| j                  ¬«      }| j                  j                  |t        j                  |«      ¬«      S )a–  Add the issues in ``issue_keys`` to the ``epic_id``.

        Issues can only exist in one Epic!

        Args:
            epic_id (str): The ID for the epic where issues should be added.
            issue_keys (Union[str, List[str]]): The list (or comma separated str) of issues
              to add to the epic
            ignore_epics (bool): Deprecated.

        Returns:
            Response
        rÄ   r˜  z`ignore_epics` is Deprecatedzepic/r?  r  rõ   )r_   r  rÒ  rŒ   rC  r¦  r  rÝ   r÷   rø   rù   )r•   Úepic_idrA  Úignore_epicsrö   rs   s         rZ   Úadd_issues_to_epiczJIRA.add_issues_to_epic›  s…   € ð   "ˆä%/°
¼CÔ%@ˆJ×Ñ˜SÔ!ÄdÈ:ÓFVð 	ˆX‰ð Ð#ÜÐ=Ô>Ø�m‰m˜e G 9¨FÐ3¸$×:MÑ:MˆmÓNˆØ�}‰}×!Ñ! #¬D¯J©J°tÓ,<Ð!Ó=Ð=ri   c                óÚ  — |€|€t        d«      ‚|�|�t        d«      ‚|�d}|}n|�d}|}| j                  sQ| j                  «       D ]>  }|d   dk(  sŒ|d   d   d	k(  r|d   d
   | _         n|d   d   dk(  sŒ2|d   d
   | _        Œ@ | j                  d| j                  ¬«      }d|gd› d�d| j                  i}| j
                  j                  |t        j                  |«      ¬«      S )aÓ  Rank an issue before/after another using the default Ranking field, the one named 'Rank'.

        Pass only ONE of `next_issue` or `prev_issue`.

        Args:
            issue (str): issue key of the issue to be ranked before/after the second one.
            next_issue (str): issue key that the first issue is to be ranked before.
            prev_issue (str): issue key that the first issue is to be ranked after.

        Returns:
            Response
        z5One of 'next_issue' or 'prev_issue' must be specifiedz9Only one of 'next_issue' or 'prev_issue' may be specifiedÚBeforeÚAfterr{   ÚRankrŽ  Úcustomz'com.pyxis.greenhopper.jira:gh-lexo-rankr�  z)com.pyxis.greenhopper.jira:gh-global-rankz
issue/rankr  r˜  Úrankr1   ÚrankCustomFieldIdrõ   )	r  rL  rƒ   r¦  r  rÝ   rÒ  rø   rù   )	r•   rù  Ú
next_issueÚ
prev_issueÚbefore_or_afterÚother_issuerP  rs   rÓ  s	            rZ   rL  z	JIRA.rank´  s8  € ð( Ð *Ð"4ÜÐTÓUÐUØÐ#¨
Ð(>ÜØKóð ð Ð!Ø&ˆOØ$‰KØÐ#Ø%ˆOØ$ˆKà�zŠzØŸ™›ò A�Ø˜‘= FÓ*à˜h™¨Ñ1ØDòEð &+¨8¡_°ZÑ%@˜œ
Ùà˜h™¨Ñ1ØFóGð &+¨8¡_°ZÑ%@˜�
ðAð �m‰m˜L¨t×/BÑ/BˆmÓCˆà�u�gØ�?Ð# 5Ð)¨;Ø §¡ð
ˆð
 �}‰}× Ñ  ¬4¯:©:°gÓ+>Ð Ó?Ð?ri   c                ó¤   — | j                  d| j                  ¬«      }d|i}| j                  j                  |t	        j
                  |«      ¬«      S )a9  Move issues in ``issue_keys`` to the backlog, removing them from all sprints that have not been completed.

        Args:
            issue_keys (List[str]): the issues to move to the backlog

        Raises:
            JIRAError: If moving issues to backlog fails

        Returns:
            Response
        zbacklog/issuer  r˜  rõ   r@  )r•   rA  rs   rÓ  s       rZ   Úmove_to_backlogzJIRA.move_to_backlogí  sI   € ð �m‰m˜O°$×2EÑ2EˆmÓFˆØ˜ZÐ(ˆØ�}‰}×!Ñ! #¬D¯J©J°wÓ,?Ð!Ó@Ð@ri   )NNNNNNFNFTFr)  TrÑ  NNNN) r  r  rc  zdict[str, str | bool | Any]rd  ztuple[str, str] | Nonere  ú
str | Nonerf  rŸ  rg  rŸ  r8  rŸ  rj  Úboolrk  rU  r(  r«   rl  rU  rR  r«   rS  r
   r7  z>None | float | tuple[float, float] | tuple[float, None] | Nonerä   r  rm  z'dict[type[Resource], int | None] | None)r€   zdict[str, str])r€   r  )r€   rU  )rä   r  )r‹  r  )r¨  útype[ResourceType]r©  rT  rª  r  rŽ   r«   r�   r«   rÒ   rŸ  r›  r  rœ  rU  r€   zResultList[ResourceType])r¨  rV  r©  rT  r®  rŸ  r€   r°   )r¨  rV  r€   r¬   )r4  )rÅ  r  rÆ  ztuple[str, str] | int | strr€   r@   )é
   )rÉ  r«   rU   )rz   r  r€   z%dict[str, str] | list[dict[str, str]])rz   r  rÙ   r  )T)r×  rU  r€   rŒ   )rv  r  r€   r$   )r€   zdict[str, int])rù  ú	str | intrÝ  zstr | BufferedReaderrú  r  r€   r$   )rv  r  r€   r   )rv  r  )NNNF)r{   r  r  r  r€   r'   )rv  r  r€   r)   )Nr   r×  )r€   zResultList[Dashboard])rv  r  r€   r*   )NNN)
r{   r  r	  rT  r#  úlist[dict] | list | Noner$  rY  r€   r*   )rv  r  r{   r  r	  rT  r#  rY  r$  rY  r€   r*   )rv  r  r-  r«   r€   r   )r3  r  r4  r  r€   z$ResultList[DashboardItemPropertyKey])r3  r  r4  r  r7  r  r€   r,   )
r3  r  r4  r  r7  r  rÙ   rŸ  r€   r,   )r3  r  r€   zlist[DashboardGadget])r€   zResultList[DashboardGadget])NNNNNN)r3  zstr | DashboardrF  rT  rL  r­   rH  rT  rI  zdict[str, int] | NonerJ  rT  rK  rT  r€   r+   )r€   úlist[dict[str, Any]])rv  r  r€   r/   )r€   zlist[Filter])NNNN)
r{   r  r	  r  rZ  r  r[  rU  r€   r/   )r{   r  r	  r  rZ  r  r[  rU  )rv  r  rc  r
   r€   r0   )NNi'  )rÊ   rT  rf  ú
Any | Noner�   r«   r€   ú	list[str])rd  r  r€   r   )rl  r  r€   rU  )
rv  zIssue | strrƒ   rT  rc  rT  r‡  rT  r€   r1   )NT)rƒ   údict[str, Any] | NonerŒ  rU  r€   r1   )rœ  rZ  rŒ  rU  r€   rZ  )rv  r  rp  r  r€   r(   )r€   zlist[ServiceDesk])rv  r  r€   rC   )rƒ   rŸ  rŒ  rU  r€   r1   )r€   r®   )r   r”  )rÆ  rX  rŽ   r«   r�   r«   r€   rŸ  )
rÆ  rX  rÊ  rX  rŽ   r«   r�   r«   r€   rŸ  )rÎ  ztuple[str, str] | str | NonerÏ  zlist | tuple[str, str]rÐ  zlist[str] | NonerÑ  rT  rc  rT  r€   rŸ  )rn  rG   r€   r  )rn  rT  r€   rT  )rù  ú	int | strrß  rT  r€   rU  )rù  r^  rc  rT  r€   zlist[Comment])rù  r^  ré  r  rc  rT  r€   r&   )NF)
rù  ústr | int | Issuerë  r  rí  zdict[str, str] | Nonerî  rU  r€   r&   )rù  rX  )rù  rX  r€   zlist[RemoteLink])rù  rX  rv  r  r€   r=   )rù  r  r  zIssue | dict[str, Any]rþ  rT  rü  r]  r   rT  r€   r=   )rù  r  rû  rŸ  )NN)rù  r_  rv  rT  )rù  r_  r  r  r€   r¬   )
rù  r_  r  r  rƒ   r]  ré  rT  r  rT  )rù  rX  r€   rI   )r  r  r€   r5   )r  r  r€   r8   )r  r  r€   r9   )r  r  r€   r;   )r  r  r€   rK   )rù  rX  r€   r   )rù  rX  r€   rJ   )rù  rX  r3  r  r€   r   )rù  rX  r€   zlist[Worklog])rù  rX  rv  r  r€   rL   )	NNNNNNNNN)rù  rX  r  rT  rA  rT  r>  rT  r?  rT  r@  rT  ré  rT  rB  zdatetime.datetime | Nonern  rT  rí  r]  r€   rL   )rù  r  r€   zlist[IssueProperty])rù  r  rz   r  r€   r4   )rù  r  rz   r  r€   r   )
rÿ  zstr | IssueLinkTyperQ  r  rR  r  ré  r]  r€   r   )rv  r  r€   r2   )F)rc  rU  r€   zlist[IssueLinkType])rv  r  r€   r3   )r€   úlist[IssueType])r  r  rŽ   r«   r�   r«   r€   zResultList[IssueType])
r  r  ro  r  rŽ   r«   r�   r«   r€   zResultList[Field])rv  r  r€   r6   )r{   r  r  rT  r€   r6   )r²  rC   r€   zlist[RequestType])r²  rC   r{   r  )NNNNN)r~  rT  r  rT  r¶  rT  r€  rT  r�  rT  r€   z$dict[str, dict[str, dict[str, str]]])r€   zlist[Priority])rv  r  r€   r:   )rc  rT  r€   úlist[Project])rv  r  rc  rT  r€   r<   )r  r  )r  r  rú  r  rÉ  r«   r“  Úbytesr”  r  r•  rU  )r  r  r—  rŸ  )r  r  rŸ  r  )r  r  rŸ  r  r€   r   )r  r  r€   zlist[Component])r  r  r€   zlist[Version])r  r  r­  r  r€   zVersion | None)r  r  r°  r  r±  r  r€   r®   )r  r  r€   zdict[str, dict[str, str]])r  r  rv  r  r€   rA   )r€   zlist[Resolution])rv  r  r€   r?   )r   r”  TrÂ  NNFF)rÅ  r  rŽ   r«   r�   r«   rÆ  rU  rƒ   zstr | list[str] | Nonerc  rT  r‡  rT  rÇ  rU  rœ  rU  r€   z"dict[str, Any] | ResultList[Issue])rv  r  r€   rB   rž  )r€   zlist[Status])rÆ  r  r€   r`  )rv  r  r€   rE   )r€   zlist[StatusCategory])rv  r«   r€   rF   )rv  r  rc  r[  r€   rG   )
ró   r  rÎ  r  rŽ   r«   r�   r«   r€   rŠ   )NNNNr   r”  N)ró   rT  r  rT  r¶  rT  rc  r[  rŽ   r«   r�   r«   rÊ   rT  )ró   r  r€   rŸ  )rn  r  rú  r  rÉ  r«   r“  rb  r”  r
   r•  rU  )rn  r  r—  rŸ  )ró   r  rŸ  r  r€   r   )rù  zstr | Issuerò  rT  ró  rT  r€   r   )Nr   r”  TFN)rn  rT  rŽ   r«   r�   r«   rø  rU  rù  rU  rÊ   rT  r€   zResultList[User])NNr   r”  )rn  r  r¶  r  r~  r  rŽ   r«   r�   r«   r€   rŠ   )NNNFF)r{   r  r  r  r	  r  rÿ  r
   r   r
   rý  rU  rþ  rU  r€   rH   )rv  r  r  r  rI  r  r€   rH   )rv  r  rc  r
   r€   rH   )r€   rG   )r€   r   )r€   zResponse | None)ró   r  rô   r  )rf  rŸ  )r8  rŸ  )r:  zdatetime.timedelta)rg  rŸ  )re  r  )rÉ   r  r›  r  r€   r  )rÉ   r  rÒ   rŸ  r›  r  rœ  rU  )rT  r
   rÆ  z3tuple[str, ...] | tuple[str | int, str] | int | strr€   r
   )rf  rb  r€   rT  )rh  r  ri  r  )ró   r  r€   rU  )ró   r  r€   rX  )FT)rc  rU  ry  rU  r€   rU  )z
backup.zipF)rú  r  r�  rU  r€   zbool | int | None)r€   r]  )r€   r­   )rú  r  )rP  rT  r€   r  )r§  zstr | Projectr¨  rU  r€   r­   )r€   r@  )r€   zlist[IssueTypeScheme]rŠ  )rv  r  r€   ra  )NNÚsoftwareNNNNNi'  Nr4  )rz   r  r{   r  rß  r  ræ  r  rç  r  rè  r«   rä  r«   râ  r«   rÂ  r«   rã  r«   rå  r«   rs   r  )rœ   NNFTFN)ró   r  rv  r  rñ  r«   rô   r  ru  r  rò  rU  rs  rU  ró  rU  rô  zlist | None)ró   r  rd  r  r€   zbool | dict[str, Any])ró   r  rl  r  r€   rU  )r  r  r  r  r  r  )r   r”  NNN)
rŽ   r«   r�   r«   rÿ  r  r{   r  r€   zResultList[Board])Nr   r”  N)r  r«   r  r­   rŽ   r«   r�   r«   r  r  r€   zResultList[Sprint])FN)rv  rX  r  rU  r  r  r€   zdict[str, dict[str, Any]])rv  rX  r{   rT  r   r[  r  r[  r  rT  r  rT  r€   rŸ  )r  r  r$  r  )r  r  r$  r  r€   rŸ  )rv  r«   r€   rD   )NÚscrumrn  N)r{   r  r`  r  r5  r  r6  r  r7  zLiteral['user', 'project']r8  rT  r€   r%   )r{   r  r  r«   r   r[  r  r[  r  rT  r€   rD   )r$  r«   rA  r\  r€   r   )rD  r  rA  zstr | list[str]rE  rU  r€   r   )rù  r  rN  rT  rO  rT  r€   r   )rA  r\  r€   r   )çr±   r²   r³   r  r#   ÚAGILE_BASE_REST_PATHr@   rI  r`  rH  r  r�   r  rs  rr  rN  ra   rY  ra  r‡  r†  rŒ  r“  rº  r¤  r¢  rÂ  rÄ  r   rÌ  rÏ  rÔ  rÙ  rÝ  rà  r�   rþ  r  r  r  r  r  r  r  r  rk   rv   r&  r)  r.  r5  r8  r=  r  rD  rN  rƒ   r  rW  r\  ra  rd  rg  r  r‚  r…  rù  r�  r¢  r¨  r¬  r°  r²  r¸  r½  rÇ  rË  rÓ  rÕ  rÝ  rá  rä  ré  rï  rò  rö  rù  r  r  r  r  r  r  r  r!  r#  r%  r(  r,  r.  r0  r5  r7  r:  r  rI  rL  rK  rO  rX  r[  r]  rT  rf  rk  rm  rp  ro  r‹  rx  r·  rƒ  r‡  r…  r¯  r  r�  r˜  r’  r   r¢  r¦  r«  r®  r²  r¹  r»  r¿  r½  rË  rÍ  r[  rÕ  rØ  rÚ  r–  rÞ  rÝ  rn  rã  ræ  rè  rë  rê  rï  rñ  rö  rÙ  rû  r  r  r  r  r  râ   r  r  rU  rT  rX  rP  rQ  Ústaticmethodr;  rV  rW  rž  r,  r¦  rÑ  r£  rÛ  rO  r‘  rj  rl  rw  r|  r‚  rŽ  r•  r¡  r¤  r©  r®  r   r³  r¹  r½  r¿  rÃ  rÇ  rÊ  rÌ  rÏ  rÒ  rÖ  rØ  rÚ  rì  rö  rú  rü  rþ  r  r  r  r  r  r!  r(  r+  r.  r-  r1  r9  r=  rB  rF  rL  rS  rV   ri   rZ   r`   r`   —  sÌ  „ ñð(ØÐ.ðàÐ*ðð 	˜ðð 	�Uð	ð
 	˜Cðð 	˜=×=Ñ=ðð 	! %ðð 	�$ðð 	�Tðð 	�ðð 	˜ðð 	�tðð 	˜ðð  	˜ð!ð" 	Ø'à.ð ",ñ
ð#ð4 	Ø�cð
ð5€Oð> €Oð ×*Ñ*€MØ"×1Ñ1€Nð Ø/3Ø-1Ø!%Ø $Ø"ØØ+/ØØ $ØØØØØØRVØ $ØGKð'Q6àðQ6ð -ðQ6ð +ð	Q6ð
 ðQ6ð ðQ6ð ðQ6ð )ðQ6ð ðQ6ð ðQ6ð ðQ6ð ðQ6ð ðQ6ð  ð!Q6ð" Pð#Q6ð$ ð%Q6ð& Eó'Q6ðf ò(ó ð(ò=ð ò,ó ð,ð ò1ó ð1ó

ò ò"ò
!ôòð ØØ!%Ø!ØðOà%ðOð ðOð ð	Oð
 ðOð ðOð ðOð ðOð ðOð 
"ôOðbBà%ðBð ðBð !ð	Bð
 
ôBô $ó(ð HJñØ"ðØ)Dðà	ôð. õ
Hó ð
Hð  ñGØðGà	.ôGô	@ö&ô0	7ô1ð ð
 ñ	UàðUð )ðUð ð	Uð
 
óUó ðUôn
)ô6ð ð
 ØØØ!ñ&àð&ð ð&ð 
ó&ó ð&ôP	"ô
)ô	>ð 24ñ
à	ô
ô2ð Øð #'Ø59Ø6:ñ Oàð Oð  ð Oð 3ð	 Oð
 4ð Oð 
ó Oó  ó ð OðD Øð
 #'Ø59Ø6:ñ#Oàð#Oð ð#Oð  ð	#Oð
 3ð#Oð 4ð#Oð 
ó#Oó  ó ð#OðJ Øð1Øð1Ø #ð1à	ó1ó  ó ð1ð.
Øð
Ø*-ð
à	-ô
ð$'Øð'Ø*-ð'Ø=@ð'à	ô'ð$QØðQØ*-ðQØ=@ðQØIWðQà	ôQð. Øóó  ó ðð2 ØóRó  ó ðRð Øð !Ø<@Ø!%Ø*.Ø Øñ,Rà%ð,Rð ð,Rð /:ð	,Rð
 ð,Rð (ð,Rð ð,Rð ð,Rð 
ó,Ró  ó ð,Rôb'ô	3ôð ØØØñIàðIð ðIð ð	Ið
 ðIð 
ôIðH ØØØñ Ið ð Ið ð	 Ið
 ð Ið ô IöHð( !Ø"Øñ	àðð ðð ð	ð
 
ôô83Gôjô.ð( "Ø!Ø!%ñ àð ð ð ð ð	 ð
 ð ð 
ô ðH )-Øñ7Kà%ð7Kð ð7Kð
 
ô7Kðt BFñKØ.ðKØ:>ðKà	ôKòZôMô0ô	8ð à>Bñ2KØ$ð2KØ7;ð2Kà	ó2Kó ð2Kôhð$ Øñ	%
à!ð%
ð ð%
ð ð	%
ð
 
ô%
ðV Øñ'
à!ð'
ð ð'
ð ð	'
ð
 ð'
ð 
ô'
ðV 59Ø-/Ø)-Ø%)Ø!ð3:à1ð3:ð +ð3:ð 'ð	3:ð
 #ð3:ð ð3:ð 
ô3:ôj?ô$3ðN óó ðð  õó ðð* àCGñQØðQØ),ðQØ6@ðQà	óQó ðQð ð
 -1Ø!ñ Hà ð Hð ð Hð *ð	 Hð
 ð Hð 
ó Hó ð HðF ó	Có ð	Cð óó ðð  ó
@ó ð
@ð$  $Ø-1Ø#'ñSàðSð ,ðSð ð	Sð
 +ðSð !ðSð 
ôSôjð4 õ
ó ð
ð(Ø&ðØ9<ðà	ôð. ð
 )-Ø"Ø"ñ7à ð7ð ð7ð &ð	7ð
 ð7ð ó7ó ð7ðr ó5ó ð5ð ðJØðJà	!óJó ðJð ó	Dó ð	Dð ó	Bó ð	Bð ó	@ó ð	@ð ó	@ó ð	@ð ó
'ó ð
'ð ó"ó ð"ð ó	8ó ð	8ð óDó ðDð óó ðð" óó ðð ó
=ó ð
=ð ð !%Ø'+Ø%)Ø"&Ø#Ø"Ø,0ØØ,0ñNDàðNDð ðNDð %ð	NDð
 #ðNDð  ðNDð ðNDð ðNDð *ðNDð ðNDð *ðNDð 
óNDó ðNDðd óó ðð ó	Dó ð	Dð ó=ó ð=ð ð *.ñ.>à!ð.>ð ð.>ð ð	.>ð
 'ð.>ð 
ó.>ó ð.>ô`)ô	6ö-ô"	:ôð  Øñ	àðð ðð ð	ð
 
ôðB Øñàðð ðð ð	ð
 ðð 
ôô>	6öKô.ô.ð "&Ø $Ø#Ø"Ø"&ñ$>àð$>ð ð$>ð ð	$>ð
 ð$>ð  ð$>ð 
.ô$>ôPô	5öö&
Cð óAó ðAð ð  Ø"ñ5'àð5'ð ð5'ð ð	5'ð
 ð5'ð ð5'ð ó5'ó ð5'ðn óó ðð" óXó ðXð ó)ó ð)ð óó ðð  óó ðð  ðØðØ*-ðà	óó ðð$ ó
*ó ð
*ð óó ðð* ó<ó ð<ô ô	7ð  ØØ#Ø)/Ø!Ø!%Ø!ØñWàðWð ðWð ð	Wð
 ðWð 'ðWð ðWð ðWð ðWð ðWð 
,ôWôt	:ôô (ôô ô 	3ô ô	;öð2 Øñ
àð
ð ð
ð ð	
ð
 ð
ð 
ô
ð<  $Ø"Ø#Ø!ØØØ ñ5
àð5
ð ð5
ð ð	5
ð
 ð5
ð ð5
ð ð5
ð ô5
ôp	Mð"  Ø"ñ>'àð>'ð ð>'ð ð	>'ð
 ð>'ð ð>'ð ô>'ô@ô"
ô8ð ð
 #'Ø $ñ)àð)ð  ð	)ð
 ð)ð 
ó)ó ð)ð>  ØØØ"Ø %Ø ñ#Yàð#Yð ð#Yð ð	#Yð
 ð#Yð ð#Yð ð#Yð 
ô#YðP ØØØñ
àð
ð ð
ð ð	
ð
 ð
ð ð
ð 
ô
ð> ð
  ØØØØñ*àð*ð ð*ð ð	*ð
 ð*ð ð*ð ð*ð ð*ð 
ó*ó ð*öXö2ô"ô	/ô
ô)ôô
2ô ðH ,0ñ
à(ô
ò.
)ò
(ð õ.ó ð.ô&ô"3òLð 8Eõ &ð$ /<õ &ð  6Cõ &ð& "&Ø!Øðàðð ðð ð	ð
 ôðF ñ	àðð Aðð
 
ôò8#ô*ô(ô*ô"GGöR*ðZ AFñØðØ9=ðà	ôô<ôB6öö8#ð6 7;ñØ ðØ/3ðà	ôò8
ñ, �tÔóó ðñ �tÔñ)ó ð)ñ �tÔóó ðñ �tÔñ,ó ð,ñ �tÔñó ðñ �tÔóó ðñ �tÔñó ðñ �tÔñó ðñ �tÔñó ðñ �tÔñó ðôôôð" ØØØ!ØØ#'Ø $Ø#Ø"'ØØñlàðlð ðlð ð	lð
 ðlð ðlð ðlð !ðlð ðlð ðlð  ðlð ðlð ôlðd ØØØØØ %Ø(,ñ@àð@ð ð@ð ð	@ð
 ð@ð ð@ð ð@ð ð@ð ð@ð &ô@ôDô,ô"ô 
ðð ð ØØØØñ$
àð$
ð ð$
ð ð	$
ð
 ð$
ð 
ó$
ó ð$
ðL ð !%ØØØñ$
àð$
ð ð$
ð ð	$
ð
 ð$
ð ð$
ð 
ó$
ó ð$
ðN CGñØðØ'+ðØ<?ðà	"ôð8  Ø $Ø"Ø Øñ%àð%ð ð%ð ð	%ð
 ð%ð ð%ð ð%ð 
ô%ôNIôô"Dôôòð  ØØ4:Ø"&ñ0Gàð0Gð ð0Gð ð	0Gð
 ð0Gð 2ð0Gð  ð0Gð 
ô0Gðl !%Ø"Øñ"Iàð"Ið ð"Ið ð	"Ið
 ð"Ið ð"Ið 
ô"IôHAð, OSñ>Øð>Ø(7ð>ØGKð>à	ô>ð8 "&Ø!%ñ	7@àð7@ð ð7@ð ð	7@ð
 
ô7@õrAri   r`   )rg   r   r€   r   )r~   r   rU   )rƒ   rŸ  r„   r
   r€   z5dict[str, dict[str, Any]] | dict[str, dict[str, str]])ƒr  Ú
__future__r   r7  r  r5  r»   rø   rl  rE  rc  r÷  r‘  r=  r  rõ  rA  Úcollectionsr   Úcollections.abcr   Ú	functoolsr   r   Úior   Únumbersr	   Útypingr
   r   r   r   r   r   r   r   r   r   Úurllib.parser   r   r   r€  Úpackaging.versionr   r�  ÚPILr   r   Úrequests.authr   Úrequests.structuresr   Úrequests.utilsr   Úrequests_toolbeltr   rQ   r   Újira.exceptionsr   r    Újira.resilientsessionr!   r"   Újira.resourcesr#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   Ú
jira.utilsrM   rN   rO   Úrequests_jwtrP   r¡  Ú	getLoggerrÿ   Ú
addHandlerÚNullHandlerrk   rv   r�   r…   r†   rŒ   rŠ   r¶   rÛ   r  r`   rV   ri   rZ   ú<module>r}     s–  ðñõ #ã Û Û Û Û Û Û Û 	Û 	Û 
Û Û Û Ý #Ý $ß &Ý Ý ÷÷ ÷ ÷ 3Ñ 2ã Ý 4Ý Ý Ý "Ý 3Ý )Ý .å ß ;ß J÷+÷ +÷ +÷ +÷ +÷ +÷ +÷ +÷ +÷ +÷ +÷X NÑ Mð	Ý$ð
 €h×Ñ˜Ó €Ø ‡�Ð#ˆx×#Ñ#Ó%Ô &ó#óL#óLð0 "ð!Øð!Ø03ð!à:ó!ñ �~°TÀÔJ€ô56��w˜|Ñ,ô 56÷rDñ DôBP+�Xô P+ôf
�ô 
÷dQAò dQAøða	 ò 	Ùð	ús   Ä&F: Æ:GÇG