Ë
    daºiè[ ã                   ó.  — 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	Z	d dl
mZ d dlmZ d dl	mZ d dlmZ d dlmZmZmZmZmZmZmZmZ d dlmZ d dlZej8                  d	k\  rd d
lmZ nd d
lmZ  ej>                  e «      Z! G d„ de«      Z"y)é    N)Úcast)ÚBeautifulSoup)Ú
deprecated)Ú	HTTPError)Úutils)ÚApiConflictErrorÚApiErrorÚApiNotAcceptableÚApiNotFoundErrorÚApiPermissionErrorÚApiValueErrorÚJsonRPCErrorÚJsonRPCRestrictionsError)ÚAtlassianRestAPI)é   é   )ÚLiteralc            	       ó�  ‡ — e Zd ZdddddddddœZˆ fd	„Zed
„ «       Z	 	 	 	 	 dÊd„ZdËd„Zd„ Z	dÌd„Z
dÍd„ZdÍd„Zd„ ZdÎd„Zd„ Zd„ Zd„ ZdÏd„ZdÐd„ZdÑd„Zd„ Z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#„ZdØd$„Z 	 	 	 	 	 dÙd%„Z! e"d&d'¬(«      d)„ «       Z#d*„ Z$d+„ Z%d,„ Z&d-e'd.e(d/   fd0„Z)d1e'd.e(d/   fd2„Z*d1e'd-e'd.e(d/   fd3„Z+d1e'd-e'fd4„Z,d5„ Z-d6„ Z.d7„ Z/dÚd8„Z0	 	 	 	 	 	 dÛd9„Z1	 	 	 dÜd:„Z2	 	 	 	 	 dÝd;„Z3 e"d<d=¬(«      d>„ «       Z4d?„ Z5 e"d<d@¬(«      dÞdA„«       Z6dßdB„Z7 e"d<dC¬(«      dÞdD„«       Z8dßdE„Z9dF„ Z:	 	 	 	 	 dàdG„Z;dH„ Z<dádI„Z=dJ„ Z>dK„ Z?	 	 	 	 	 dâdL„Z@	 	 	 	 	 	 dãdM„ZAdädN„ZBdËdO„ZCdP„ ZDdQ„ ZEdådR„ZF	 	 	 	 	 dàdS„ZGdT„ ZHd-e'dUe'fdV„ZIdW„ ZJdX„ ZKdY„ ZLdZ„ ZMd[„ ZNd\„ ZOd]„ ZPd^„ ZQdËd_„ZR	 	 	 	 	 dæd`„ZS	 	 	 	 	 	 	 	 dçda„ZT	 	 	 	 	 	 dèdb„ZU	 	 	 	 dédc„ZV	 	 	 	 dédd„ZW	 	 	 	 	 dêde„ZXdf„ ZYdg„ ZZdh„ Z[di„ Z\dj„ Z]dk„ Z^dl„ Z_dm„ Z`dn„ Zadëdo„Zbdìdp„Zcdq„ Zddr„ Zedíds„Zfdîdt„Zgdïdu„Zh	 	 	 	 	 dðdv„Zidw„ Zjdx„ Zkdy„ ZldËdz„ZmdËd{„ZndËd|„ZodËd}„Zp	 	 	 	 	 dñd~„Zqd„ Zrd€„ Zsd�e'd‚e'dƒe'fd„„Ztd…„ Zud†„ Zvd‡„ Zwdˆ„ Zxd‰„ ZydŠ„ Zzd‹„ Z{dŒ„ Z|d�„ Z}dŽ„ Z~d�„ Zd�„ Z€d‘„ Z�d’„ Z‚d“„ Zƒd”„ Z„d•„ Z…d–„ Z†dÑd—„Z‡dËd˜„Zˆd™„ Z‰	 	 	 	 	 dòdš„ZŠ	 dód›„Z‹dœ„ ZŒd�„ Z�	 dÑdž„ZŽdËdŸ„Z�dËd „Z�d¡„ Z‘d¢„ Z’d£„ Z“d¤„ Z”d¥„ Z•d¦„ Z–d§„ Z—d¨„ Z˜d©„ Z™dÑdª„Zšd«„ Z›dËd¬„ZœdËd­„Z�d®„ ZždËd¯„ZŸdËd°„Z d±„ Z¡dËd²„Z¢dËd³„Z£d´„ Z¤dµ„ Z¥d¶„ Z¦d·„ Z§d¸„ Z¨d¹„ Z©dº„ Zªd»„ Z«d¼„ Z¬d½„ Z­d¾„ Z®d¿„ Z¯dÀ„ Z°dÁ„ Z±dÂ„ Z²dÃ„ Z³dÄ„ Z´dÅ„ ZµdÆ„ Z¶dÇ„ Z·dÈ„ Z¸dÉ„ Z¹ˆ xZºS )ôÚ
Confluencez	image/gifz	image/pngz
image/jpegzapplication/pdfzapplication/mswordzapplication/vnd.ms-excelzimage/svg+xml)z.gifz.pngz.jpgz.jpegz.pdfz.docz.xlsz.svgc                 óŠ   •— d|v sd|v r#d|vrt        j                  |d«      }d|vrd|d<   t        t        | �  |g|¢­i |¤Ž y )Nzatlassian.netzjira.comú/wikiÚcloudT)r   Ú
url_joinerÚsuperr   Ú__init__)ÚselfÚurlÚargsÚkwargsÚ	__class__s       €úU/var/www/timesheet/venv/lib/python3.12/site-packages/atlassian/confluence/__init__.pyr   zConfluence.__init__2   sU   ø€ Ø˜sÑ" j°CÑ&7¸gÈSÑ>PÜ"×-Ñ-¨c°7Ó;ˆCØ˜fÑ$Ø"&��w‘ÜŒj˜$Ñ(¨Ð>¨tÒ>°vÓ>ó    c                 ó.   — |dvrt        d«      ‚|| |dœiS )N)Úatlas_doc_formatÚeditorÚexport_viewÚviewÚstorageÚwikizCWrong value for representation, it should be either wiki or storage©ÚvalueÚrepresentation)Ú
ValueError)Úbodyr,   s     r!   Ú_create_bodyzConfluence._create_body9   s-   € àð "
ñ 
ô ÐbÓcÐcà¨$À.Ñ QÐRÐRr"   c              #   óÚ   K  — |€i }	 | j                  ||||||¬«      }d|vry|j                  dg «      D ]  }|–— Œ |j                  di «      j                  d«      }|€	 yd}i }d}Œc­w)a>  
        Used to get the paged data

        :param url: string:                        The url to retrieve
        :param params: dict (default is None):     The parameter's
        :param data: dict (default is None):       The data
        :param flags: string[] (default is None):  The flags
        :param trailing: bool (default is None):   If True, a trailing slash is added to the url
        :param absolute: bool (default is False):  If True, the url is used absolute and not relative to the root

        :return: A generator object for the data elements
        N)ÚtrailingÚparamsÚdataÚflagsÚabsoluteÚresultsÚ_linksÚnextF©Úget)	r   r   r2   r3   r4   r1   r5   Úresponser+   s	            r!   Ú
_get_pagedzConfluence._get_pagedG   s¦   è ø€ ð, ˆ>ØˆFàØ—x‘xØØ!ØØØØ!ð  ó ˆHð  Ñ(Øà!Ÿ™ i°Ó4ò �Ø“ðð —,‘,˜x¨Ó,×0Ñ0°Ó8ˆCØˆ{Øð 	ð ˆHàˆFàˆHð5 ùs   ‚A)A+c                 ó(  — d}i }|�t        |«      |d<   |�t        |«      |d<   |�t        |«      |d<   	 | j                  ||¬«      }|j                  d
«      ryy# t        $ r,}|j                  j                  dk(  rt        d|¬	«      ‚‚ d}~ww xY w)zÙ
        Check if title exists as page.
        :param space: Space key
        :param title: Title of the page
        :param type: type of the page, 'page' or 'blogpost'. Defaults to 'page'
        :return:
        úrest/api/contentNÚspaceKeyÚtitleÚtype©r2   é”  ú=The calling user does not have permission to view the content©Úreasonr6   TF)Ústrr:   r   r;   Ústatus_coder   )r   Úspacer@   rA   r   r2   r;   Úes           r!   Úpage_existszConfluence.page_exists~   s¯   € ð !ˆØˆØÐÜ!$ U£ˆF�:ÑØÐÜ! %›jˆF�7‰OØÐÜ  ›YˆF�6‰Nð		Ø—x‘x ¨F�xÓ3ˆHð �<‰<˜	Ô"Øàøô ò 	Ø�z‰z×%Ñ%¨Ò,Ü(ØSØôð ð
 ûð	ús   ¶A Á	BÁ%'BÂBc                 ó®   — d}||d||dœ}| j                  ||ddid¬«      }|j                  dk7  r%t        d	|j                  › d
|j                  › �«      ‚y)za
        Notify members (currently only groups implemented) about something on that page
        zrest/share-page/latest/shareÚpage)ÚcontextualPageIdÚentityIdÚ
entityTypeÚgroupsÚnoteÚcontentTypezapplication/json; charset=utf-8T)ÚjsonÚheadersÚadvanced_modeéÈ   zfailed sharing content z: N)ÚpostrH   Ú	ExceptionÚtext)r   Úpage_idÚgroupÚmessager   r2   Úrs          r!   Úshare_with_otherszConfluence.share_with_othersŸ   sp   € ð -ˆà 'àØ ØØñ
ˆð �I‰I�c °Ð@aÐ0bÐrvˆIÓwˆØ�=‰=˜CÒÜÐ5°a·m±m°_ÀBÀqÇvÁvÀhÐOÓPÐPð  r"   c                 óª  — i }|�t        |«      |d<   |�t        |«      |d<   |�||d<   d|› d|› �}t        j                  |«       	 | j                  s|€|€| j	                  ||¬«      S | j                  ||¬«      }| j                  r|S |j                  d«      S # t        $ r,}	|	j                  j                  d	k(  rt        d
|	¬«      ‚‚ d}	~	ww xY w)a¾  
        Provide content by type (page, blog, comment)
        :param page_id: A string containing the id of the type content container.
        :param type:
        :param start: OPTIONAL: The start point of the collection to return. Default: None (0).
        :param limit: OPTIONAL: how many items should be returned after the start index. Default: Site limit 200.
        :param expand: OPTIONAL: expand e.g. history
        :return:
        NÚstartÚlimitÚexpandúrest/api/content/z/child/rB   r6   rC   úgThere is no content with the given id, or the calling user does not have permission to view the contentrE   )
ÚintÚlogÚinforV   r<   r:   r   r;   rH   r	   )
r   r[   rA   ra   rb   rc   r2   r   r;   rJ   s
             r!   Úget_page_child_by_typez!Confluence.get_page_child_by_type±   sñ   € ð ˆØÐÜ! %›jˆF�7‰OØÐÜ! %›jˆF�7‰OØÐØ%ˆF�8Ñà! ' ¨'°$°Ð8ˆÜ�‰�Œð	Ø×%Ò%¨%¨-¸E¸MØ—‘ s°6�Ó:Ð:àŸ8™8 C°˜8Ó7�Ø×%Ò%Ø#�OØ—|‘| IÓ.Ð.øÜò 		Ø�z‰z×%Ñ%¨Ò,äðWàôð ð ûð		ús$   Á"B Á+ B ÂB Â	CÂ&'CÃCc                 ó\   — | j                  ||||«      }|D �cg c]  }|d   ‘Œ	 }}|S c c}w )av  
        Find a list of Child title
        :param page_id: A string containing the id of the type content container.
        :param type:
        :param start: OPTIONAL: The start point of the collection to return. Default: None (0).
        :param limit: OPTIONAL: how many items should be returned after the start index. Default: Site limit 200.
        :return:
        r@   ©ri   )r   r[   rA   ra   rb   Ú
child_pageÚchildÚchild_title_lists           r!   Úget_child_title_listzConfluence.get_child_title_listÙ   s>   € ð ×0Ñ0°¸$ÀÀuÓMˆ
Ø8BÖC¨u˜E '›NÐCÐÐCØÐùò Dó   ™)c                 ó\   — | j                  ||||«      }|D �cg c]  }|d   ‘Œ	 }}|S c c}w )as  
        Find a list of Child id
        :param page_id: A string containing the id of the type content container.
        :param type:
        :param start: OPTIONAL: The start point of the collection to return. Default: None (0).
        :param limit: OPTIONAL: how many items should be returned after the start index. Default: Site limit 200.
        :return:
        Úidrk   )r   r[   rA   ra   rb   rl   rm   Úchild_id_lists           r!   Úget_child_id_listzConfluence.get_child_id_listæ   s<   € ð ×0Ñ0°¸$ÀÀuÓMˆ
Ø2<Ö=¨˜˜t›Ð=ˆÐ=ØÐùò >rp   c                 ó(   — | j                  |d¬«      S )zc
        Get child pages for the provided page_id
        :param page_id:
        :return:
        rM   )r[   rA   rk   ©r   r[   s     r!   Úget_child_pageszConfluence.get_child_pagesó   s   € ð ×*Ñ*°7ÀÐ*ÓHÐHr"   c                 óP   — | j                  |||¬«      xs i j                  d«      S )zá
        Provide content id from search result by title and space.
        :param space: SPACE key
        :param title: title
        :param type: type of content: Page or Blogpost. Defaults to page
        :return:
        )rA   rr   )Úget_page_by_titler:   )r   rI   r@   rA   s       r!   Úget_page_idzConfluence.get_page_idû   s,   € ð ×&Ñ& u¨e¸$Ð&Ó?ÒEÀ2×JÑJÈ4ÓPÐPr"   c                 óÜ   — d}	 | j                  |d¬«      j                  d«      xs i d   j                  d«      xs d}|S # t        $ r }t        j	                  |«       Y d}~|S d}~ww xY w)zd
        Provide parent content id from page id
        :type page_id: str
        :return:
        NÚ	ancestors©r[   rc   éÿÿÿÿrr   ©Úget_page_by_idr:   rY   rg   Úerror)r   r[   Úparent_content_idrJ   s       r!   Úget_parent_content_idz Confluence.get_parent_content_id  s   € ð !Ðð	Ø!%×!4Ñ!4¸WÈ[Ð!4Ó!Y×!]Ñ!]Ð^iÓ!jÒ!pÐnpØñ!ç‰c�$‹iò! àð ð
 !Ð øô ò 	Ü�I‰I�a�LˆLØ Ð ûð	úó   „<A Á	A+ÁA&Á&A+c                 óÜ   — d}	 | j                  |d¬«      j                  d«      xs i d   j                  d«      xs d}|S # t        $ r }t        j	                  |«       Y d}~|S d}~ww xY w)zg
        Provide parent content title from page id
        :type page_id: str
        :return:
        Nr|   r}   r~   r@   r   )r   r[   Úparent_content_titlerJ   s       r!   Úget_parent_content_titlez#Confluence.get_parent_content_title  s€   € ð  $Ðð	Ø$(×$7Ñ$7ÀÐP[Ð$7Ó$\×$`Ñ$`ÐalÓ$mÒ$sÐqsØñ$ç‰c�'‹lò$#à"ð !ð
 $Ð#øô ò 	Ü�I‰I�a�LˆLØ#Ð#ûð	úr„   c                 ó|   — | j                  |d¬«      xs i j                  d«      xs i j                  d«      xs dS )zh
        Provide space key from content id.
        :param page_id: content ID
        :return:
        rI   ©rc   ÚkeyN)r€   r:   rv   s     r!   Úget_page_spacezConfluence.get_page_space#  sB   € ð ×$Ñ$ W°WÐ$Ó=ÒCÀ×HÑHÈÓQÒWÐUW×\Ñ\Ð]bÓcÒkÐgkÐkr"   c                 ó,   — | j                  |||||«      S )a¬  
        Provide pages by title search
        :param space: Space key
        :param title: Title of the page
        :param start: OPTIONAL: The start point of the collection to return. Default: None (0).
        :param limit: OPTIONAL: The limit of the number of labels to return, this may be restricted by
                            fixed system limits. Default: 200.
        :param expand: OPTIONAL: expand e.g. history
        :return: The JSON data returned from searched results the content endpoint, or the results of the
                 callback. Will raise requests.HTTPError on bad input, potentially.
                 If it has IndexError then return the None.
        )ry   )r   rI   r@   ra   rb   rc   s         r!   Úget_pages_by_titlezConfluence.get_pages_by_title+  s   € ð ×%Ñ% e¨U°E¸5À&ÓIÐIr"   c                 óH  — d}d|i}|�t        |«      |d<   |�t        |«      |d<   |�||d<   |�t        |«      |d<   |�t        |«      |d<   | j                  r| j                  ||¬	«      S 	 | j                  ||¬	«      }		 |	j                  d«      d   S # t        $ r,}
|
j
                  j                  d
k(  rt        d|
¬«      ‚‚ d}
~
ww xY w# t        t        f$ rD}
t        j                  d|› d| j                  › �«       t        j                  |
«       Y d}
~
yd}
~
ww xY w)a  
        Returns the first page  on a piece of Content.
        :param space: Space key
        :param title: Title of the page
        :param start: OPTIONAL: The start point of the collection to return. Default: None (0).
        :param limit: OPTIONAL: The limit of the number of labels to return, this may be restricted by
                            fixed system limits. Default: 1.
        :param expand: OPTIONAL: expand e.g. history
        :param type: OPTIONAL: Type of content: Page or Blogpost. Defaults to page
        :return: The JSON data returned from searched results the content endpoint, or the results of the
                 callback. Will raise requests.HTTPError on bad input, potentially.
                 If it has IndexError then return the None.
        r>   rA   Nra   rb   rc   r?   r@   rB   rC   rD   rE   r6   r   zCan't find 'z
' page on )rf   rG   rV   r:   r   r;   rH   r   Ú
IndexErrorÚ	TypeErrorrg   r�   r   Údebug)r   rI   r@   ra   rb   rc   rA   r   r2   r;   rJ   s              r!   ry   zConfluence.get_page_by_title:  s8  € ð !ˆØ˜$�ˆØÐÜ! %›jˆF�7‰OØÐÜ! %›jˆF�7‰OØÐØ%ˆF�8ÑØÐÜ!$ U£ˆF�:ÑØÐÜ! %›jˆF�7‰Oà×ÒØ—8‘8˜C¨�8Ó/Ð/ð		Ø—x‘x ¨F�xÓ3ˆHð	Ø—<‘< 	Ó*¨1Ñ-Ð-øô ò 	Ø�z‰z×%Ñ%¨Ò,Ü(ØSØôð ð
 ûð	ûô œIÐ&ò 	Ü�I‰I˜ U G¨:°d·h±h°ZÐ@ÔAÜ�I‰I�aŒLÜûð	ús0   Á.B ÂC Â	CÂ'CÃCÃD!Ã:DÄD!c                 óÖ   — i }|r||d<   |r||d<   |r||d<   d|› �}	 | j                  ||¬«      }|S # t        $ r,}|j                  j                  dk(  rt	        d|¬«      ‚‚ d	}~ww xY w)
a  
        Returns a piece of Content.
        Example request URI(s):
        http://example.com/confluence/rest/api/content/1234?expand=space,body.view,version,container
        http://example.com/confluence/rest/api/content/1234?status=any
        :param page_id: Content ID
        :param status: (str) list of Content statuses to filter results on. Default value: [current]
        :param version: (int)
        :param expand: OPTIONAL: Default value: history,space,version
                       We can also specify some extensions such as extensions.inlineProperties
                       (for getting inline comment-specific properties) or extensions. Resolution
                       for the resolution status of each comment in the results
        :return:
        rc   ÚstatusÚversionrd   rB   rC   re   rE   N©r:   r   r;   rH   r	   )	r   r[   rc   r“   r”   r2   r   r;   rJ   s	            r!   r€   zConfluence.get_page_by_idh  s™   € ð ˆÙØ%ˆF�8ÑÙØ%ˆF�8ÑÙØ 'ˆF�9ÑØ! ' Ð+ˆð	Ø—x‘x ¨F�xÓ3ˆHð ˆøô ò 		Ø�z‰z×%Ñ%¨Ò,äðWàôð ð ûð		ús   ž3 ³	A(¼'A#Á#A(c                 ó†  — 	 | j                  |d¬«      d   d   d   }|r• t        |d¬«      d«      D ���cg c]A  } |d	«      D ��cg c]+  } |d
«       |d«      z   D �cg c]  }|j                  ‘Œ c}‘Œ- c}}‘ŒC }}}}t        |«      dkD  r"t	        j
                  |t        |«      |dœ«      S d|iS dhS c c}w c c}}w c c}}}w # t        $ rF}|j                  j                  dk(  r#t        j                  d|«       t        d|¬«      ‚Y d}~yd}~wt        $ r }t        j                  d|«       Y d}~yd}~ww xY w)a  
        Fetches html  tables added to  confluence page
        :param page_id: integer confluence page_id
        :return: json object with page_id, number_of_tables_in_page
                 and list of list tables_content representing scraped tables
        úbody.storager‰   r.   r(   r+   Úlxml)ÚfeaturesÚtableÚtrÚthÚtdr   )r[   Únumber_of_tables_in_pageÚtables_contentzNo tables found for page: zPage content is emptyrC   z#Couldn't retrieve tables  from pagezˆThere is no content with the given pageid, pageid params is not an integer or the calling user does not have permission to view the pagerE   NzError occured)r€   r   rZ   ÚlenrT   Údumpsr   r;   rH   rg   r�   r	   rY   )r   r[   Úpage_contentrš   ÚrowÚcellÚ
tables_rawrJ   s           r!   Úget_tables_from_pagezConfluence.get_tables_from_page�  sV  € ð 	*Ø×.Ñ.¨w¸~Ð.ÓNÈvÑVÐW`ÑaÐbiÑjˆLáð "N¤¨|ÀfÔ!MÈgÓ!V÷ð àñ OTÐTXËk×ZÀs©C°«I¹¸D»	Ñ,AÖB D�d—i“iÔBÕZð�
ò ô �z“? QÒ&ÜŸ:™:à'.Ü8;¸J»Ø.8ñóð ð 5°gðð ð 0Ð0Ð0ùò! CùÓZùôøô$ ò 	Ø�z‰z×%Ñ%¨Ò,ä—	‘	Ð?ÀÔIÜðTàôð ô -ûô ò 	*Ü�I‰I�o q×)Ñ)ûð	*úsd   ‚5C
 ·CÁB=ÁB8Á2B=Á7CÁ=3C
 Â1C
 Â5C
 Â8B=Â=CÃC
 Ã
	E Ã<DÄE Ä D;Ä;E c                 ó€  — g }| j                  |d¬«      d   d   d   }	 |�Et        j                  ||«      D �cg c]  }|j                  d«      ‘Œ }}|r|j	                  |«       |S c c}w # t
        $ rF}|j                  j                  dk(  r#t        j                  d	|«       t        d
|¬«      ‚Y d}~yd}~ww xY w)zÞ
        Method scraps regex patterns from a Confluence page_id.

        :param page_id: The ID of the Confluence page.
        :param regex: The regex pattern to scrape.
        :return: A list of regex matches.
        r—   r‰   r.   r(   r+   Nr   rC   zcouldn't find page_id : zhThere is no content with the given page id,or the calling user does not have permission to view the pagerE   )r€   ÚreÚfinditerr\   Úextendr   r;   rH   rg   r�   r   )r   r[   ÚregexÚregex_outputÚpage_outputÚxÚdescription_matchesrJ   s           r!   Úscrap_regex_from_pagez Confluence.scrap_regex_from_page¸  sÍ   € ð ˆØ×)Ñ)¨'¸.Ð)ÓIÈ&ÑQÐR[Ñ\Ð]dÑeˆð	ØÐ&Ü;=¿;¹;ÀuÈkÓ;ZÖ&[°a q§w¡w¨q¥zÐ&[Ð#Ð&[Ù&Ø ×'Ñ'Ð(;Ô<ØÐùò '\øô ò 	Ø�z‰z×%Ñ%¨Ò,ä—	‘	Ð4°gÔ>Ü&ðTàôð ô -ûð	ús(    A. ºA)ÁA. Á)A. Á.	B=Á7<B8Â8B=c                 óü   — d|› d�}i }|r||d<   |�t        |«      |d<   |�t        |«      |d<   	 | j                  ||¬«      }|S # t        $ r,}|j                  j                  dk(  rt        d	|¬
«      ‚‚ d}~ww xY w)aá  
        Returns the list of labels on a piece of Content.
        :param page_id: A string containing the id of the labels content container.
        :param prefix: OPTIONAL: The prefixes to filter the labels with {@see Label.Prefix}.
                                Default: None.
        :param start: OPTIONAL: The start point of the collection to return. Default: None (0).
        :param limit: OPTIONAL: The limit of the number of labels to return, this may be restricted by
                            fixed system limits. Default: 200.
        :return: The JSON data returned from the content/{id}/label endpoint, or the results of the
                 callback. Will raise requests.HTTPError on bad input, potentially.
        rd   ú/labelÚprefixNra   rb   rB   rC   re   rE   )rf   r:   r   r;   rH   r	   )	r   r[   r³   ra   rb   r   r2   r;   rJ   s	            r!   Úget_page_labelszConfluence.get_page_labelsÒ  s§   € ð " ' ¨&Ð1ˆØˆÙØ%ˆF�8ÑØÐÜ! %›jˆF�7‰OØÐÜ! %›jˆF�7‰Oð	Ø—x‘x ¨F�xÓ3ˆHð ˆøô ò 		Ø�z‰z×%Ñ%¨Ò,äðWàôð ð ûð		ús   ±A Á	A;Á'A6Á6A;c                 óî   — |||dœ}|r||d<   |r||d<   |r||d<   |r||d<   d|› d�}		 | j                  |	|¬«      }
|
S # t        $ r,}|j                  j                  d	k(  rt	        d
|¬«      ‚‚ d}~ww xY w)a  

        :param content_id:
        :param expand: extensions.inlineProperties,extensions.resolution
        :param parent_version:
        :param start:
        :param limit:
        :param location: inline or not
        :param depth:
        :return:
        )rr   ra   rb   rc   ÚparentVersionÚlocationÚdepthrd   z/child/commentrB   rC   re   rE   Nr•   )r   Ú
content_idrc   Úparent_versionra   rb   r·   r¸   r2   r   r;   rJ   s               r!   Úget_page_commentszConfluence.get_page_commentsö  s®   € ð* #¨U¸UÑCˆÙØ%ˆF�8ÑÙØ&4ˆF�?Ñ#ÙØ!)ˆF�:ÑÙØ#ˆF�7‰OØ! * ¨^Ð<ˆð	Ø—x‘x ¨F�xÓ3ˆHð ˆøô ò 		Ø�z‰z×%Ñ%¨Ò,äðWàôð ð ûð		ús   ª? ¿	A4Á'A/Á/A4c                 ó*   — | j                  |||¬«      S )a&  
        Gets content by id with status = draft
        :param page_id: Content ID
        :param status: (str) list of content statuses to filter results on. Default value: [draft]
        :param expand: OPTIONAL: Default value: history,space,version
                       We can also specify some extensions such as extensions.inlineProperties
                       (for getting inline comment-specific properties) or extensions. Resolution
                       for the resolution status of each comment in the results
        :return:
        )r[   rc   r“   )r€   )r   r[   r“   rc   s       r!   Úget_draft_page_by_idzConfluence.get_draft_page_by_id%  s   € ð ×"Ñ"¨7¸6È&Ð"ÓQÐQr"   c                 ó
  — d}i }|rdd› d|› d�|d<   |r||d<   |r||d<   |r||d	<   	 | j                  ||¬
«      }|j                  d«      S # t        $ r,}|j                  j                  dk(  rt	        d|¬«      ‚‚ d}~ww xY w)aª  
        Get all page by label
        :param label:
        :param start: OPTIONAL: The start point of the collection to return. Default: None (0).
        :param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
                      fixed system limits. Default: 50
        :param expand: OPTIONAL: a comma separated list of properties to expand on the content
        :return:
        zrest/api/content/searchztype=rM   z AND label="ú"Úcqlra   rb   rc   rB   é�  úThe CQL is invalid or missingrE   Nr6   ©r:   r   r;   rH   r   )	r   Úlabelra   rb   rc   r   r2   r;   rJ   s	            r!   Úget_all_pages_by_labelz!Confluence.get_all_pages_by_label4  s«   € ð (ˆØˆÙØ# F 8¨<¸°w¸aÐ@ˆF�5‰MÙØ#ˆF�7‰OÙØ#ˆF�7‰OÙØ%ˆF�8Ñð	Ø—x‘x ¨F�xÓ3ˆHð �|‰|˜IÓ&Ð&øô ò 	Ø�z‰z×%Ñ%¨Ò,Ü#Ð$CÈAÔNÐNàûð		ús   ©A Á	BÁ'A=Á=Bc                 óú   — d}i }|r||d<   |r||d<   |r||d<   |r||d<   |r||d<   |r||d<   	 | j                  ||¬«      }	|	S # t        $ r,}
|
j                  j                  d	k(  rt	        d
|
¬«      ‚‚ d}
~
ww xY w)a¼  
        Get all pages from space

        :param space:
        :param start: OPTIONAL: The start point of the collection to return. Default: None (0).
        :param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
                            fixed system limits. Default: 50
        :param status: OPTIONAL: list of statuses the content to be found is in.
                                 Defaults to current is not specified.
                                 If set to 'any', content in 'current' and 'trashed' status will be fetched.
                                 Does not support 'historical' status for now.
        :param expand: OPTIONAL: a comma separated list of properties to expand on the content.
                                 Default value: history,space,version.
        :param content_type: the content type to return. Default value: page. Valid values: page, blogpost.
        :return:
        r>   r?   ra   rb   r“   rc   rA   rB   rC   rD   rE   N©r:   r   r;   rH   r   )r   rI   ra   rb   r“   rc   Úcontent_typer   r2   r;   rJ   s              r!   Úget_all_pages_from_space_rawz'Confluence.get_all_pages_from_space_rawS  s³   € ð2 !ˆØˆÙØ!&ˆF�:ÑÙØ#ˆF�7‰OÙØ#ˆF�7‰OÙØ%ˆF�8ÑÙØ%ˆF�8ÑÙØ)ˆF�6‰Nð		Ø—x‘x ¨F�xÓ3ˆHð ˆøô ò 	Ø�z‰z×%Ñ%¨Ò,Ü(ØSØôð ð
 ûð	ús   °A Á	A:Á'A5Á5A:c                 óª   — g }	 | j                  ||||||¬«      }|j                  dg «      }	|j                  |	«       t        |	«      |k  r	 |S ||z  }ŒQ)a¡  
         Retrieve all pages from a Confluence space.

        :param space: The space key to fetch pages from.
        :param start: OPTIONAL: The starting point of the collection. Default: 0.
        :param limit: OPTIONAL: The maximum number of pages per request. Default: 50.
        :param status: OPTIONAL: Filter pages by status ('current', 'trashed', 'any'). Default: None.
        :param expand: OPTIONAL: Comma-separated list of properties to expand. Default: history,space,version.
        :param content_type: OPTIONAL: The content type to return ('page', 'blogpost'). Default: page.
        :return: List containing all pages from the specified space.
        ©rI   ra   rb   r“   rc   rÈ   r6   )rÉ   r:   rª   r    )
r   rI   ra   rb   r“   rc   rÈ   Ú	all_pagesr;   r6   s
             r!   Úget_all_pages_from_spacez#Confluence.get_all_pages_from_spaceˆ  s|   € ð( ˆ	Øà×8Ñ8ØØØØØØ)ð 9ó ˆHð —l‘l 9¨bÓ1ˆGØ×Ñ˜WÔ%ô �7‹|˜uÒ$Øð Ðð �U‰NˆEð) r"   c              #   ó¢   K  — 	 | j                  ||||||¬«      }|j                  dg «      }|E d{  –—†  t        |«      |k  r	 y||z  }ŒI7 Œ­w)a¢  
        Retrieve all pages from a Confluence space using pagination.

        :param space: The space key to fetch pages from.
        :param start: OPTIONAL: The starting point of the collection. Default: 0.
        :param limit: OPTIONAL: The maximum number of pages per request. Default: 50.
        :param status: OPTIONAL: Filter pages by status ('current', 'trashed', 'any'). Default: None.
        :param expand: OPTIONAL: Comma-separated list of properties to expand. Default: history,space,version.
        :param content_type: OPTIONAL: The content type to return ('page', 'blogpost'). Default: page.
        :return: Generator yielding pages one by one.
        rË   r6   N)rÉ   r:   r    )	r   rI   ra   rb   r“   rc   rÈ   r;   r6   s	            r!   Ú%get_all_pages_from_space_as_generatorz0Confluence.get_all_pages_from_space_as_generator´  sv   è ø€ ð( à×8Ñ8ØØØØØØ)ð 9ó ˆHð —l‘l 9¨bÓ1ˆGØ×Ðô �7‹|˜eÒ#Øàð �U‰NˆEð% ð ús   ‚0A²A³Ac                 ó.   — | j                  |||||¬«      S )aÜ  
        Get list of pages from trash
        :param space:
        :param start: OPTIONAL: The start point of the collection to return. Default: None (0).
        :param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
                            fixed system limits. Default: 500
        :param status:
        :param content_type: the content type to return. Default value: page. Valid values: page, blogpost.
        :return:
        )rÈ   ©rÍ   )r   rI   ra   rb   r“   rÈ   s         r!   Úget_all_pages_from_space_trashz)Confluence.get_all_pages_from_space_trashÝ  s!   € ð ×,Ñ,¨U°E¸5À&ÐWcÐ,ÓdÐdr"   c                 ó*   — | j                  ||||«      S )a­  
        Get list of draft pages from space
        Use case is cleanup old drafts from Confluence
        :param space:
        :param start: OPTIONAL: The start point of the collection to return. Default: None (0).
        :param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
                            fixed system limits. Default: 500
        :param status:
        :return:
        rÑ   )r   rI   ra   rb   r“   s        r!   Úget_all_draft_pages_from_spacez)Confluence.get_all_draft_pages_from_spaceê  s   € ð ×,Ñ,¨U°E¸5À&ÓIÐIr"   c                 óì   — d|› d|› �}i }|r||d<   |r||d<   	 | j                  ||¬«      }|j                  d
«      S # t        $ r,}|j                  j                  dk(  rt	        d|¬«      ‚‚ d	}~ww xY w)aË  
        Search list of draft pages by space key
        Use case is cleanup old drafts from Confluence
        :param space: Space Key
        :param status: Can be changed
        :param start: OPTIONAL: The start point of the collection to return. Default: None (0).
        :param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
                            fixed system limits. Default: 500
        :return:
        z$rest/api/content?cql=space=spaceKey=z and status=rb   ra   rB   rC   rD   rE   Nr6   rÇ   )	r   rI   ra   rb   r“   r   r2   r;   rJ   s	            r!   Ú*get_all_draft_pages_from_space_through_cqlz5Confluence.get_all_draft_pages_from_space_through_cql÷  s—   € ð 5°U°G¸<ÈÀxÐPˆØˆÙØ#ˆF�7‰OÙØ#ˆF�7‰Oð		Ø—x‘x ¨F�xÓ3ˆHð �|‰|˜IÓ&Ð&øô ò 	Ø�z‰z×%Ñ%¨Ò,Ü(ØSØôð ð
 ûð	ús   š> ¾	A3Á'A.Á.A3c                 óü  — d}i }|rdj                  |«      |d<   |r||d<   |r||d<   |r||d<   |r||d<   |r||d<   g }		 	 | j                  ||¬	«      }
|
j                  d
«      }|	|z   }	|
j                  d«      }|�d|v r|
d   d   j                  d«      }i }n	 |	S Œ^# t        $ rR}|j                  j
                  dk(  rt        d|¬«      ‚|j                  j
                  dk(  rt        d
¬«      ‚‚ d}~ww xY w)a  
        Get all pages from a set of space ids:
        https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-get
        :param space_ids: A Set of space IDs passed as a filter to Confluence
        :param batch_size: OPTIONAL: The batch size of pages to retrieve from confluence per request MAX is 250.
                                     Default: 250
        :param sort: OPTIONAL: The order the pages are retrieved in.
                               Valid values:
                                    id, -id, created-date, -created-date, modified-date, -modified-date, title, -title
        :param status: OPTIONAL: Filter pages based on their status.
                                 Valid values: current, archived, deleted, trashed
                                 Default: current,archived
        :param title: OPTIONAL: Filter pages based on their title.
        :param body_format: OPTIONAL: The format of the body in the response. Valid values: storage, atlas_doc_format
        :return:
        z/api/v2/pagesú,zspace-idrb   Úsortr“   r@   zbody-formatrB   r6   r7   Nr8   z/wiki/rÁ   z‰The configured params cannot be interpreted by ConfluenceCheck the api documentation for valid values for status, expand, and sort paramsrE   é‘  úUnauthorized (401)©r;   )Újoinr:   Úremoveprefixr   r;   rH   r   )r   Ú	space_idsÚ
batch_sizerÙ   r“   r@   Úbody_formatÚpathr2   Ú
_all_pagesr;   ÚpagesÚlinksrJ   s                 r!   Ú+get_all_pages_by_space_ids_confluence_cloudz6Confluence.get_all_pages_by_space_ids_confluence_cloud  sA  € ð2 ˆØˆÙØ!$§¡¨)Ó!4ˆF�:ÑÙØ(ˆF�7‰OÙØ!ˆF�6‰NÙØ%ˆF�8ÑÙØ#ˆF�7‰OÙØ$/ˆF�=Ñ!àˆ
ð	ØØŸ8™8 D°˜8Ó8�à Ÿ™ YÓ/�Ø'¨%Ñ/�
à Ÿ™ XÓ.�ØÐ$¨°5©Ø# HÑ-¨fÑ5×BÑBÀ8ÓL�DØ‘Fàð Ðð/ øô ò 		Ø�z‰z×%Ñ%¨Ò,Ü#ðgàôð ð
 �z‰z×%Ñ%¨Ò,ÜÐ 4¸xÔHÐHØûð		ús    ÁAB  ÂB  Â 	C;Â)AC6Ã6C;z2.4.2z&Use get_all_restrictions_for_content())r”   rF   c                 ó&   — | j                  |¬«      S )z0Let's use the get_all_restrictions_for_content())r¹   )Ú get_all_restrictions_for_content©r   r¹   s     r!   Úget_all_restictions_for_contentz*Confluence.get_all_restictions_for_contentY  s   € ð ×4Ñ4À
Ð4ÓKÐKr"   c                 ó0   — d|› d�}| j                  |«      S )zŒ
        Returns info about all restrictions by operation.
        :param content_id:
        :return: Return the raw json response
        rd   z/restriction/byOperationr9   )r   r¹   r   s      r!   rè   z+Confluence.get_all_restrictions_for_content^  s!   € ð " * Ð-EÐFˆØ�x‰x˜‹}Ðr"   c                 óœ   — | j                   dk(  s| j                  ri S d}ddd|gdœ}| j                  ||¬«      j                  d«      xs i S )	áA  
        The JSON-RPC APIs for Confluence are provided here to help you browse and discover APIs you have access to.
        JSON-RPC APIs operate differently than REST APIs.
        To learn more about how to use these APIs,
        please refer to the Confluence JSON-RPC documentation on Atlassian Developers.
        r   ú!rpc/json-rpc/confluenceservice-v2ú2.0ÚgetContentPermissionSetsé	   ©ÚjsonrpcÚmethodrr   r2   ©r3   Úresult©Úapi_versionr   rX   r:   )r   r[   r   r3   s       r!   Ú'get_all_restrictions_from_page_json_rpcz2Confluence.get_all_restrictions_from_page_json_rpcg  sX   € ð ×Ñ˜wÒ&¨$¯*ª*ØˆIØ1ˆØ Ð,FÈaÐ\cÐ[dÑeˆØ�y‰y˜ 4ˆyÓ(×,Ñ,¨XÓ6Ò<¸"Ð<r"   c                 ó    — | j                   dk(  s| j                  ri S d}ddd|||gdœ}| j                  ||¬«      j                  d«      xs i S )	rí   r   rî   rï   ÚsetContentPermissionsrñ   rò   rõ   rö   r÷   )r   r[   Úpermission_typeÚcontent_permissionsr   r3   s         r!   Ú%update_restrictions_for_page_json_rpcz0Confluence.update_restrictions_for_page_json_rpct  sb   € ð ×Ñ˜wÒ&¨$¯*ª*ØˆIØ1ˆàØ-ØØ Ð1DÐEñ	
ˆð �y‰y˜ 4ˆyÓ(×,Ñ,¨XÓ6Ò<¸"Ð<r"   r[   Úrestriction_type)ÚViewÚEditc                 ó0  — | j                  |¬«      d   }| j                  |¬«      }	 t        |«      dkD  rA|D ]:  }t        |«      j	                  d«      |k(  sŒ!t        |«      j	                  d«      }Œ< S t        d|› d|› d�«      ‚# t        $ r ‚ w xY w)	N©r[   r@   r   rA   ÚcontentPermissionsz	On page "z" has no restrictions type of "r¿   )r€   rù   r    Údictr:   r   r   )r   r[   rÿ   Ú	page_nameÚrestrictions_in_pageÚrestriction_type_in_pageÚuserss          r!   Ú(get_users_from_restricts_in_page_by_typez3Confluence.get_users_from_restricts_in_page_by_type†  sÃ   € Ø×'Ñ'°Ð'Ó8¸ÑAˆ	Ø#×KÑKÐT[ÐKÓ\Ðð	ÜÐ'Ó(¨1Ò,Ø0Dò YÐ,ÜÐ4Ó5×9Ñ9¸&ÓAÐEUÓUÜ $Ð%=Ó >× BÑ BÐCWÓ X™ðYð �ä.Ø 	˜{Ð*IÐJZÐI[Ð[\Ð]óð øô ò 	Øð	ús   ©0B
 ÁB
 Á8B
 Â
BÚ	user_namec                 ó   — ||d dœ}|S )N)rA   ÚuserNameÚ	groupName© )r   r  rÿ   Úcontents       r!   Úcreate_restricts_from_from_userz*Confluence.create_restricts_from_from_user–  s   € Ø+¸ÐQUÑVˆàˆr"   c           	      óò  — | j                  |¬«      j                  d«      }d}d}| j                  |d¬«      }| j                  |d¬«      }| j                  |d¬«      }	| j                  |d¬«      }
	 d ||fv�rp|�6|D ]1  }t	        |«      j                  d«      |	j                  d«      k(  sŒ0d	}Œ3 |�6|D ]1  }t	        |«      j                  d«      |
j                  d«      k(  sŒ0d	}Œ3 |dk(  rT|du r9| j                  ||¬«      }|j                  |«       | j                  |||¬
«       y |r»t        d|› d|› d|› d�«      ‚|dk(  r |s†| j                  |d¬«      }	| j                  ||¬«      }
|j                  |	«       |j                  |
«       | j                  |d|¬
«       | j                  |||¬
«       t        d|› d|› d|› d�«       y |rt        d|› d|› d|› d�«      ‚y y y y # t        $ r ‚ w xY w)Nr  r@   Fr   ©r[   rÿ   r  ©r  rÿ   r  T©r[   rü   rý   úUser "z%" already have restrictions type of "z" on page "r¿   z " granted restrictions type of ")
r€   r:   r
  r  r  Úappendrþ   r   Úprintr   )r   r  r[   rÿ   r  Úuser_find_view_boolÚuser_find_edit_boolÚusers_content_viewÚusers_content_editÚcurrent_user_content_viewÚcurrent_user_content_editÚuserÚcurrent_user_contents                r!   Úadd_user_in_restricted_pagez&Confluence.add_user_in_restricted_page›  sç  € Ø×'Ñ'°Ð'Ó8×<Ñ<¸WÓEˆ	Ø#ÐØ#ÐØ#'×#PÑ#PØ¨fð $Qó $
Ðð $(×#PÑ#PØ¨fð $Qó $
Ðð +/×*NÑ*NØ°&ð +Oó +
Ð!ð +/×*NÑ*NØ°&ð +Oó +
Ð!ð1	ØÐ.Ð0BÐCÒCØ%Ð1Ø 2ò 7˜Ü ›:Ÿ>™>¨*Ó5Ð9R×9VÑ9VÐWaÓ9bÓbØ26Ñ/ð7ð &Ð1Ø 2ò 7˜Ü ›:Ÿ>™>¨*Ó5Ð9R×9VÑ9VÐWaÓ9bÓbØ26Ñ/ð7ð $ vÒ-Ø*¨eÑ3Ø/3×/SÑ/SØ&/ÐBRð 0Tó 0Ð,ð +×1Ñ1Ð2FÔGØ×BÑBØ$+Ø,<Ø0Bð Cõ ñ
 -Ü6Ø$ Y KÐ/TÐUeÐTfÐfqÐr{Ðq|Ð|}Ð~óð ð &¨Ò/Ù.Ø48×4XÑ4XØ&/À&ð 5Yó 5Ð1ð 59×4XÑ4XØ&/ÐBRð 5Yó 5Ð1ð +×1Ñ1Ð2KÔLØ*×1Ñ1Ð2KÔLØ×BÑBØ$+¸VÐYkð Cô ð ×BÑBØ$+Ð=MÐcuð Cô ô Ø$ Y KÐ/OÐP`ÐOaÐalÐmvÐlwÐwxÐyõñ -Ü6Ø$ Y KÐ/TÐUeÐTfÐfqÐr{Ðq|Ð|}Ð~óð ð -ð' 0ð	 -ð) Døô^ ò 	Øð	ús&   Á3:G+ Â.7G+ Ã&AG+ Ä,B#G+ ÇG+ Ç+G6c                 óî  — | j                  |¬«      j                  d«      }d}| j                  |d¬«      }| j                  |d¬«      }| j                  |d¬«      }| j                  |d¬«      }t	        |«      D ]E  \  }	}
t        |
«      j                  d«      |j                  d«      k(  sŒ3d	}|j                  |	«       ŒG t	        |«      D ]E  \  }	}
t        |
«      j                  d«      |j                  d«      k(  sŒ3d	}|j                  |	«       ŒG 	 |r;| j                  |d|¬
«       | j                  |d|¬
«       t        d|› d|› d�«       y |st        d|› d|› d�«      ‚y # t        $ r ‚ w xY w)Nr  r@   Fr   r  r  r  r  Tr  r  z." has been deleted from restrictions on page "r¿   z+" has not founded in restrictions on page ")r€   r:   r
  r  Ú	enumerater  Úpoprþ   r  r   r   )r   r  r[   r  Úuser_find_boolr  r  r  r  Ú
user_indexÚ
user_values              r!   Ú remove_user_from_restricted_pagez+Confluence.remove_user_from_restricted_pageÞ  sÓ  € Ø×'Ñ'°Ð'Ó8×<Ñ<¸WÓEˆ	ØˆØ#'×#PÑ#PØ¨fð $Qó $
Ðð $(×#PÑ#PØ¨fð $Qó $
Ðð %)×$HÑ$HÐS\ÐouÐ$HÓ$vÐ!Ø$(×$HÑ$HÐS\ÐouÐ$HÓ$vÐ!Ü&/Ð0BÓ&Cò 	3Ñ"ˆJ˜
Ü�JÓ×#Ñ# JÓ/Ð3L×3PÑ3PÐQ[Ó3\Ó\Ø!%�Ø"×&Ñ& zÕ2ð	3ô '0Ð0BÓ&Cò 	3Ñ"ˆJ˜
Ü�JÓ×#Ñ# JÓ/Ð3L×3PÑ3PÐQ[Ó3\Ó\Ø!%�Ø"×&Ñ& zÕ2ð	3ð	ÙØ×:Ñ:Ø#°VÐQcð ;ô ð ×:Ñ:Ø#°VÐQcð ;ô ô ˜˜y˜kÐ)WÐXaÐWbÐbcÐdÕeÙ#Ü.Ø˜Y˜KÐ'RÐS\ÐR]Ð]^Ð_óð ð $øô ò 	Øð	ús   Ä<E) ÅE) Å)E4c                 ó(   — | j                  |d¬«      S )z`
        This method removes a page from trash
        :param page_id:
        :return:
        Útrashed©r[   r“   ©Úremove_pagerv   s     r!   Úremove_page_from_trashz!Confluence.remove_page_from_trash  s   € ð ×Ñ¨¸	ÐÓBÐBr"   c                 ó(   — | j                  |d¬«      S )zq
        This method removes a page from trash if it is a draft
        :param page_id:
        :return:
        Údraftr+  r,  rv   s     r!   Úremove_page_as_draftzConfluence.remove_page_as_draft	  s   € ð ×Ñ¨¸ÐÓ@Ð@r"   c                 óì   — 	 | j                  d|› �«      }|S # t        $ rR}|j                  j                  dk(  rt	        d|¬«      ‚|j                  j                  dk(  rt        d|¬«      ‚‚ d}~ww xY w)zP
        Remove any content
        :param content_id:
        :return:
        rd   rC   úqThere is no content with the given id, or the calling user does not have permission to trash or purge the contentrE   é™  úCThere is a stale data object conflict when trying to delete a draftN)Údeleter   r;   rH   r	   r   )r   r¹   r;   rJ   s       r!   Úremove_contentzConfluence.remove_content  sŠ   € ð	Ø—{‘{Ð%6°z°lÐ#CÓDˆHð" ˆøô! ò 	Ø�z‰z×%Ñ%¨Ò,äðRàôð ð
 �z‰z×%Ñ%¨Ò,Ü&ØYØôð ð
 ûð	ús   ‚ ˜	A3¡AA.Á.A3c                 ó~  — d|› �}|r:| j                  |«      }|D ]$  }| j                  |j                  d«      ||«       Œ& i }|r||d<   	 | j                  ||¬«      }|S # t        $ rR}	|	j
                  j                  dk(  rt        d|	¬«      ‚|	j
                  j                  dk(  rt        d	|	¬«      ‚‚ d
}	~	ww xY w)a   
        This method removes a page, if it has recursive flag, method removes including child pages
        :param page_id:
        :param status: OPTIONAL: type of page
        :param recursive: OPTIONAL: if True - will recursively delete all children pages too
        :return:
        rd   rr   r“   rB   rC   r3  rE   r4  r5  N)	ri   r-  r:   r6  r   r;   rH   r	   r   )
r   r[   r“   Ú	recursiver   Úchildren_pagesÚchildren_pager2   r;   rJ   s
             r!   r-  zConfluence.remove_page+  sç   € ð " ' Ð+ˆÙØ!×8Ñ8¸ÓAˆNØ!/ò M�Ø× Ñ  ×!2Ñ!2°4Ó!8¸&À)ÕLðMàˆÙØ%ˆF�8Ñð	Ø—{‘{ 3¨v�{Ó6ˆHð" ˆøô! ò 	Ø�z‰z×%Ñ%¨Ò,äðRàôð ð
 �z‰z×%Ñ%¨Ò,Ü&ØYØôð ð
 ûð	ús   ÁA! Á!	B<Á*AB7Â7B<c
                 óº  — t         j                  d|||«       d}
|||	d|i| j                  ||«      di idœ}|r	||dœg|d<   |�|d	v rd
|i|d   d   d<   |du rd
di|d   d   d<   d
di|d   d   d<   nd
di|d   d   d<   d
di|d   d   d<   	 | j                  |
|¬«      }|S # t        $ r,}|j
                  j                  dk(  rt        d|¬«      ‚‚ d}~ww xY w)a©  
        Create page from scratch
        :param space:
        :param title:
        :param body:
        :param parent_id:
        :param type:
        :param representation: OPTIONAL: either Confluence 'storage' or 'wiki' markup format
        :param editor: OPTIONAL: v2 to be created in the new editor
        :param full_width: DEFAULT: False
        :param status: either 'current' or 'draft'
        :return:
        zCreating %s "%s" -> "%s"rd   rŠ   Ú
properties)rA   r@   r“   rI   r.   Úmetadata©rA   rr   r|   N)Úv1Úv2r+   r>  r%   Tú
full-widthúcontent-appearance-draftúcontent-appearance-publishedúfixed-widthrõ   rC   rD   rE   )rg   rh   r/   rX   r   r;   rH   r   )r   rI   r@   r.   Ú	parent_idrA   r,   r%   Ú
full_widthr“   r   r3   r;   rJ   s                 r!   Úcreate_pagezConfluence.create_pageP  sV  € ô2 	�‰Ð+¨T°5¸%Ô@Ø!ˆàØØØ˜U�^Ø×%Ñ% d¨NÓ;Ø% rÐ*ñ
ˆñ Ø*.°iÑ!@Ð AˆD�ÑØÐ &¨LÑ"8Ø8?ÀÐ7HˆD�Ñ˜\Ñ*¨8Ñ4Ø˜ÑØJQÐS_ÐI`ˆD�Ñ˜\Ñ*Ð+EÑFØNUÐWcÐMdˆD�Ñ˜\Ñ*Ð+IÒJàJQÐS`ÐIaˆD�Ñ˜\Ñ*Ð+EÑFØNUÐWdÐMeˆD�Ñ˜\Ñ*Ð+IÑJð		Ø—y‘y ¨4�yÓ0ˆHð ˆøô ò 	Ø�z‰z×%Ñ%¨Ò,Ü(ØSØôð ð
 ûð	ús   ÂB% Â%	CÂ.'CÃCc                 óv   — d}||dœ}|r||d<   |r||d<   |r||d<   | j                  ||| j                  ¬«      S )z×
        Move page method
        :param space_key:
        :param page_id:
        :param target_title:
        :param target_id:
        :param position: topLevel or append , above, below
        :return:
        z/pages/movepage.action)r?   ÚpageIdÚtargetTitleÚtargetIdÚposition©r2   rU   )rX   Úno_check_headers)r   Ú	space_keyr[   Ú	target_idÚtarget_titlerM  r   r2   s           r!   Ú	move_pagezConfluence.move_page‹  sU   € ð" 'ˆØ'°7Ñ;ˆÙØ$0ˆF�=Ñ!ÙØ!*ˆF�:ÑÙØ!)ˆF�:ÑØ�y‰y˜ V°T×5JÑ5JˆyÓKÐKr"   c                 ó¼   — |||dœ}|r||d<   |r||d<   |rd|i|d<   |r+||d<   | j                  dt        j                  |«      ¬«      S | j                  d|¬	«      S )
aS  
        Creates a new or updates an existing content template.

        Note, blueprint templates cannot be created or updated via the REST API.

        If you provide a ``template_id`` then this method will update the template with the provided settings.
        If no ``template_id`` is provided, then this method assumes you are creating a new template.

        :param str name: If creating, the name of the new template. If updating, the name to change
            the template name to. Set to the current name if this field is not being updated.
        :param dict body: This object is used when creating or updating content.
            {
                "storage": {
                    "value": "<string>",
                    "representation": "view"
                }
            }
        :param str template_type: OPTIONAL: The type of the new template. Default: "page".
        :param str template_id: OPTIONAL: The ID of the template being updated. REQUIRED if updating a template.
        :param str description: OPTIONAL: A description of the new template. Max length 255.
        :param list labels: OPTIONAL: Labels for the new template. An array like:
            [
                {
                    "prefix": "<string>",
                    "name": "<string>",
                    "id": "<string>",
                    "label": "<string>",
                }
            ]
        :param dict space: OPTIONAL: The key for the space of the new template. Only applies to space templates.
            If not specified, the template will be created as a global template.
        :return:
        )ÚnameÚtemplateTyper.   ÚdescriptionÚlabelsrŠ   rI   Ú
templateIdzrest/api/templaterõ   ©rT   )ÚputrT   r¡   rX   )	r   rU  r.   Útemplate_typeÚtemplate_idrW  rX  rI   r3   s	            r!   Úcreate_or_update_templatez$Confluence.create_or_update_template¦  sx   € ðV ¨mÀTÑJˆáØ"-ˆD�ÑáØ#ˆD�‰NáØ" E˜NˆD�‰MáØ!,ˆD�ÑØ—8‘8Ð/´d·j±jÀÓ6F�8ÓGÐGà�y‰yÐ,°4ˆyÓ8Ð8r"   z3.7.0zUse get_content_template()c                 ó¤   — d|› �}	 | j                  |«      }|S # t        $ r,}|j                  j                  dk(  rt	        d|¬«      ‚‚ d}~ww xY w)z{
        Get user template by id. Experimental API
        Use case is get template body and create page from that
        zrest/experimental/template/é“  re   rE   Nr•   ©r   r]  r   r;   rJ   s        r!   Úget_template_by_idzConfluence.get_template_by_idâ  sh   € ð ,¨K¨=Ð9ˆð	Ø—x‘x “}ˆHð ˆøô ò 		Ø�z‰z×%Ñ%¨Ò,äðWàôð ð ûð		úó   ‡ š	A£'A
Á
Ac                 ó¤   — d|› �}	 | j                  |«      }|S # t        $ r,}|j                  j                  dk(  rt	        d|¬«      ‚‚ d}~ww xY w)a.  
        Get a content template.

        This includes information about the template, like the name, the space or blueprint
            that the template is in, the body of the template, and more.
        :param str template_id: The ID of the content template to be returned
        :return:
        úrest/api/template/r`  re   rE   Nr•   ra  s        r!   Úget_content_templatezConfluence.get_content_templateø  sh   € ð # ; -Ð0ˆð	Ø—x‘x “}ˆHð ˆøô ò 		Ø�z‰z×%Ñ%¨Ò,äðWàôð ð ûð		úrc  zUse get_blueprint_templates()c                 ó  — d}i }|r||d<   |r||d<   |r||d<   |r||d<   	 | j                  ||¬«      }|j                  d«      xs g S # t        $ r,}|j                  j                  dk(  rt	        d|¬	«      ‚‚ d
}~ww xY w)aœ  
        Get all users blueprints from space. Experimental API
        :param space: Space Key
        :param start: OPTIONAL: The start point of the collection to return. Default: None (0).
        :param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
                            fixed system limits. Default: 20
        :param expand: OPTIONAL: expand e.g. body
        z$rest/experimental/template/blueprintr?   ra   rb   rc   rB   r`  rD   rE   Nr6   rÇ   ©	r   rI   ra   rb   rc   r   r2   r;   rJ   s	            r!   Úget_all_blueprints_from_spacez(Confluence.get_all_blueprints_from_space  s©   € ð 5ˆØˆÙØ!&ˆF�:ÑÙØ#ˆF�7‰OÙØ#ˆF�7‰OÙØ%ˆF�8Ñð		Ø—x‘x ¨F�xÓ3ˆHð �|‰|˜IÓ&Ò,¨"Ð,øô ò 	Ø�z‰z×%Ñ%¨Ò,Ü(ØSØôð ð
 ûð	úó   ¢A
 Á
	A?Á'A:Á:A?c                 ó  — d}i }|r||d<   |r||d<   |r||d<   |r||d<   	 | j                  ||¬«      }|j                  d«      xs g S # t        $ r,}|j                  j                  dk(  rt	        d|¬	«      ‚‚ d
}~ww xY w)aÅ  
        Gets all templates provided by blueprints.

        Use this method to retrieve all global blueprint templates or all blueprint templates in a space.
        :param space: OPTIONAL: The key of the space to be queried for templates. If ``space`` is not
            specified, global blueprint templates will be returned.
        :param start: OPTIONAL: The starting index of the returned templates. Default: None (0).
        :param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
                            fixed system limits. Default: 25
        :param expand: OPTIONAL: A multi-value parameter indicating which properties of the template to expand.
        zrest/api/template/blueprintr?   ra   rb   rc   rB   r`  rD   rE   Nr6   rÇ   rh  s	            r!   Úget_blueprint_templatesz"Confluence.get_blueprint_templates4  s©   € ð ,ˆØˆÙØ!&ˆF�:ÑÙØ#ˆF�7‰OÙØ#ˆF�7‰OÙØ%ˆF�8Ñð		Ø—x‘x ¨F�xÓ3ˆHð �|‰|˜IÓ&Ò,¨"Ð,øô ò 	Ø�z‰z×%Ñ%¨Ò,Ü(ØSØôð ð
 ûð	úrj  zUse get_content_templates()c                 ó  — d}i }|r||d<   |r||d<   |r||d<   |r||d<   	 | j                  ||¬«      }|j                  d«      xs g S # t        $ r,}|j                  j                  dk(  rt	        d|¬	«      ‚‚ d
}~ww xY w)a3  
        Get all users templates from space. Experimental API
        ref: https://docs.atlassian.com/atlassian-confluence/1000.73.0/com/atlassian/confluence/plugins/restapi    /resources/TemplateResource.html
        :param space: Space Key
        :param start: OPTIONAL: The start point of the collection to return. Default: None (0).
        :param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
                                fixed system limits. Default: 20
        :param expand: OPTIONAL: expand e.g. body
        zrest/experimental/template/pager?   ra   rb   rc   rB   r`  rD   rE   Nr6   rÇ   rh  s	            r!   Úget_all_templates_from_spacez'Confluence.get_all_templates_from_spaceX  s©   € ð 0ˆØˆÙØ!&ˆF�:ÑÙØ#ˆF�7‰OÙØ#ˆF�7‰OÙØ%ˆF�8Ñð	Ø—x‘x ¨F�xÓ3ˆHð �|‰|˜IÓ&Ò,¨"Ð,øô ò 	Ø�z‰z×%Ñ%¨Ò,Ü(ØSØôð ð ûð	úrj  c                 ó  — d}i }|r||d<   |r||d<   |r||d<   |r||d<   	 | j                  ||¬«      }|j                  d«      xs g S # t        $ r,}|j                  j                  dk(  rt	        d|¬	«      ‚‚ d
}~ww xY w)a¿  
        Get all content templates.
        Use this method to retrieve all global content templates or all content templates in a space.
        :param space: OPTIONAL: The key of the space to be queried for templates. If ``space`` is not
            specified, global templates will be returned.
        :param start: OPTIONAL: The start point of the collection to return. Default: None (0).
        :param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
                            fixed system limits. Default: 25
        :param expand: OPTIONAL: A multi-value parameter indicating which properties of the template to expand.
            e.g. ``body``
        zrest/api/template/pager?   ra   rb   rc   rB   r`  rD   rE   Nr6   rÇ   rh  s	            r!   Úget_content_templatesz Confluence.get_content_templates{  s©   € ð 'ˆØˆÙØ!&ˆF�:ÑÙØ#ˆF�7‰OÙØ#ˆF�7‰OÙØ%ˆF�8Ñð		Ø—x‘x ¨F�xÓ3ˆHð �|‰|˜IÓ&Ò,¨"Ð,øô ò 	Ø�z‰z×%Ñ%¨Ò,Ü(ØSØôð ð
 ûð	úrj  c                 ó*   — | j                  d|› �«      S )a’  
        Deletes a template.

        This results in different actions depending on the type of template:
            * If the template is a content template, it is deleted.
            * If the template is a modified space-level blueprint template, it reverts to the template
                inherited from the global-level blueprint template.
            * If the template is a modified global-level blueprint template, it reverts to the default
                global-level blueprint template.
        Note: Unmodified blueprint templates cannot be deleted.

        :param str template_id: The ID of the template to be deleted.
        :return:
        re  ©r6  )r   r]  s     r!   Úremove_templatezConfluence.remove_templateŸ  s   € ð �{‰{Ð/°¨}Ð=Ó>Ð>r"   c                 óv   — d}i }|r||d<   |r||d<   |r||d<   |r||d<   |r||d<   | j                  ||¬«      S )a`  
        Get all spaces with provided limit
        :param start: OPTIONAL: The start point of the collection to return. Default: None (0).
        :param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
                            fixed system limits. Default: 500
        :param space_type: OPTIONAL: Filter the list of spaces returned by type (global, personal)
        :param space_status: OPTIONAL: Filter the list of spaces returned by status (current, archived)
        :param expand: OPTIONAL: additional info, e.g. metadata, icon, description, homepage
        úrest/api/spacera   rb   rc   rA   r“   rB   r9   )r   ra   rb   rc   Ú
space_typeÚspace_statusr   r2   s           r!   Úget_all_spaceszConfluence.get_all_spaces°  s_   € ð" ˆØˆÙØ#ˆF�7‰OÙØ#ˆF�7‰OÙØ%ˆF�8ÑÙØ'ˆF�6‰NÙØ+ˆF�8ÑØ�x‰x˜ FˆxÓ+Ð+r"   c                 ó0   — d|› d�}| j                  |«      S )zJ
        Archive space
        :param space_key:
        :return:
        úrest/api/space/z/archive©r[  ©r   rP  r   s      r!   Úarchive_spacezConfluence.archive_spaceÏ  s    € ð   	˜{¨(Ð3ˆØ�x‰x˜‹}Ðr"   c                 óX   — d|› d�}d|i}|r||d<   |r||d<   | j                  ||¬«      S )zž
        Get trashed contents by space
        :param space_key:
        :param cursor:
        :param expand:
        :param limit:
        :return:
        rz  ú/content/trashrb   Úcursorrc   rB   r9   )r   rP  r€  rc   rb   r   r2   s          r!   Úget_trashed_contents_by_spacez(Confluence.get_trashed_contents_by_spaceØ  sI   € ð   	˜{¨.Ð9ˆØ˜5Ð!ˆÙØ%ˆF�8ÑÙØ%ˆF�8ÑØ�x‰x˜ FˆxÓ+Ð+r"   c                 ó0   — d|› d�}| j                  |«      S )z©
        Remove all content from the trash in the given space,
        deleting them permanently.Example request URI:
        :param space_key:
        :return:
        rz  r  rr  r|  s      r!   Ú remove_trashed_contents_by_spacez+Confluence.remove_trashed_contents_by_spaceé  s!   € ð   	˜{¨.Ð9ˆØ�{‰{˜3ÓÐr"   c                 óÒ   — d|dddœ| j                  |d«      dœ}	 | j                  d|¬«      }|S # t        $ r,}|j                  j                  d	k(  rt        d
|¬«      ‚‚ d}~ww xY w)zR
        Add comment into page
        :param page_id
        :param text
        ÚcommentrM   Úcurrent)rr   rA   r“   r(   )rA   Ú	containerr.   rd   rõ   rC   rD   rE   N)r/   rX   r   r;   rH   r   )r   r[   rZ   r3   r;   rJ   s         r!   Úadd_commentzConfluence.add_commentó  sƒ   € ð Ø '°À9ÑMØ×%Ñ% d¨IÓ6ñ
ˆð		Ø—y‘yÐ!4¸4�yÓ@ˆHð ˆøô ò 	Ø�z‰z×%Ñ%¨Ò,Ü(ØSØôð ð
 ûð	ús   œ1 ±	A&º'A!Á!A&c           	      ó
  — |€| j                  ||¬«      n|}d}|�u|r|nd|› d�}||||ddœ}	dd	d
œ}
d|› d�}| j                  ||
d|i¬«      }|j                  d«      r|dz   |d   d   d   z   dz   }	 | j                  ||	|
d|||fi¬«      }|S t        j                  d«       y# t        $ rR}|j                  j
                  dk(  rt        d|¬«      ‚|j                  j
                  dk(  rt        d|¬«      ‚‚ d}~ww xY w)a0  
        Attach (upload) a file to a page, if it exists it will update automatically the
        version the new file and keep the old one.
        :param title: The page name
        :type  title: ``str``
        :param space: The space name
        :type  space: ``str``
        :param page_id: The page id to which we would like to upload the file
        :type  page_id: ``str``
        :param name: The name of the attachment
        :type  name: ``str``
        :param content: Contains the content which should be uploaded
        :type  content: ``binary``
        :param content_type: Specify the HTTP content type.
                The default is "application/binary"
        :type  content_type: ``str``
        :param comment: A comment describing this upload/file
        :type  comment: ``str``
        N)rI   r@   Ú
attachmentz	Uploaded ú.Útrue)rA   ÚfileNamerS   r…  Ú	minorEditúno-checkzapplication/json)úX-Atlassian-TokenÚAcceptrd   ú/child/attachmentÚfilename)râ   rU   r2   Úsizeú/r6   r   rr   z/dataÚfile)râ   r3   rU   Úfilesr`  zhAttachments are disabled or the calling user does not have permission to add attachments to this contentrE   rC   z“The requested content is not found, the user does not have permission to view it, or the attachments exceeds the maximum configured attachment sizez-No 'page_id' found, not uploading attachments)	rz   r:   rX   r   r;   rH   r	   rg   Úwarning)r   r  rU  rÈ   r[   r@   rI   r…  rA   r3   rU   râ   Úattachmentsr;   rJ   s                  r!   Úattach_contentzConfluence.attach_content  sn  € ð: AHÀ�$×"Ñ"¨°eÐ"Ô<ÐU\ˆØˆØÐÙ!(‘g°	¸$¸¸qÐ.AˆGàØ Ø+Ø"Ø#ñˆDð &0Ø,ñˆGð ' w iÐ/@ÐAˆDàŸ(™(¨°gÀzÐSWÐFX˜(ÓYˆKØ�‰˜vÔ&Ø˜c‘z K°	Ñ$:¸1Ñ$=¸dÑ$CÑCÀgÑM�ðØŸ9™9ØØØ#Ø! D¨'°<Ð#@ÐAð	 %ó �ð2 ˆOä�K‰KÐGÔHØøô- ò Ø—:‘:×)Ñ)¨SÒ0ä"ðQà ôð ð
 —:‘:×)Ñ)¨SÒ0ä"ð5ð  !ô	ð ð ûð#ús   Á5B' Â'	DÂ0AC=Ã=Dc           
      ó8  — |€t         j                  j                  |«      }|€>t         j                  j                  |«      d   }| j                  j                  |d«      }t        |d«      5 }	| j                  |	||||||¬«      cddd«       S # 1 sw Y   yxY w)a­  
        Attach (upload) a file to a page, if it exists it will update automatically the
        version the new file and keep the old one.
        :param title: The page name
        :type  title: ``str``
        :param space: The space name
        :type  space: ``str``
        :param page_id: The page id to which we would like to upload the file
        :type  page_id: ``str``
        :param filename: The file to upload (Specifies the content)
        :type  filename: ``str``
        :param name: Specifies name of the attachment. This parameter is optional.
                     Is no name give the file name is used as name
        :type  name: ``str``
        :param content_type: Specify the HTTP content type. The default is
                            The default is "application/binary"
        :type  content_type: ``str``
        :param comment: A comment describing this upload/file
        :type  comment: ``str``
        Nr~   úapplication/binaryÚrb)r[   r@   rI   r…  )Úosrâ   ÚbasenameÚsplitextÚcontent_typesr:   Úopenrš  )
r   r“  rU  rÈ   r[   r@   rI   r…  Ú	extensionÚinfiles
             r!   Úattach_filezConfluence.attach_file]  sž   € ð> ˆ<Ü—7‘7×#Ñ# HÓ-ˆDØÐÜŸ™×(Ñ(¨Ó2°2Ñ6ˆIØ×-Ñ-×1Ñ1°)Ð=QÓRˆLä�(˜DÓ!ð 		 VØ×&Ñ&ØØØØØØØð 'ó ÷		÷ 		ò 		ús   Á.BÂBc                 ó&  — |s|€t        j                  «       }	 |r| j                  ||¬«      d   }|s d|› d�S | j                  |||¬«      d   }|syi }|D �]  }	|	d   xs |	d	   }
|	d
   d   }| j                  t	        |«      d¬«      }|rt        j                  |«      }|||
<   ŒQt        j                  d|
«      r:t        j                  dd|
«      }t        j                  d|
› d|› d�t        «       |}
t         j                  j                  ||
«      }t         j                  j                  ||
«      }t        |d«      5 }|j!                  |«       ddd«       �Œ	 |r|S t#        |«      |dœS # 1 sw Y   �Œ&xY w# t$        $ r t'        d|› d�«      ‚t(        $ r t)        d|› d�«      ‚t*        j,                  $ r4}t+        j,                  d|› �|j.                  |j0                  ¬«      ‚d}~wt2        $ r}t3        d|› �«      ‚d}~ww xY w)a†  
        Downloads attachments from a Confluence page. Supports downloading all files or a specific file.
        Files can either be saved to disk or returned as BytesIO objects for in-memory handling.

        :param page_id: str
            The ID of the Confluence page to fetch attachments from.
        :param path: str, optional
            Directory where attachments will be saved. If None, defaults to the current working directory.
            Ignored if `to_memory` is True.
        :param start: int, optional
            The start point for paginated attachment fetching. Default is 0. Ignored if `filename` is specified.
        :param limit: int, optional
            The maximum number of attachments to fetch per request. Default is 50. Ignored if `filename` is specified.
        :param filename: str, optional
            The name of a specific file to download. If provided, only this file will be fetched.
        :param to_memory: bool, optional
            If True, attachments are returned as a dictionary of {filename: BytesIO object}.
            If False, files are written to the specified directory on disk.
        :return:
            - If `to_memory` is True, returns a dictionary {filename: BytesIO object}.
            - If `to_memory` is False, returns a summary dict: {"attachments_downloaded": int, "path": str}.
        :raises:
            - FileNotFoundError: If the specified path does not exist.
            - PermissionError: If there are permission issues with the specified path.
            - requests.HTTPError: If the HTTP request to fetch an attachment fails.
            - Exception: For any unexpected errors.
        N)r[   r“  r6   zNo attachment with filename 'z' found on the page.)r[   ra   rb   z!No attachments found on the page.r@   rr   r7   ÚdownloadT©Únot_json_responsez[<>:"/\\|?*\x00-\x1F]Ú_zFile name 'z3' contained invalid characters and was renamed to 'z'.Úwb)Úattachments_downloadedrâ   zThe directory 'z' does not exist.z0Permission denied when trying to save files to 'z3HTTP error occurred while downloading attachments: )r;   ÚrequestzAn unexpected error occurred: )rž  ÚgetcwdÚget_attachments_from_contentr:   rG   ÚioÚBytesIOr¨   ÚsearchÚsubÚwarningsÚwarnÚUserWarningrâ   rÝ   r¢  Úwriter    ÚNotADirectoryErrorÚFileNotFoundErrorÚPermissionErrorÚrequestsr   r;   r­  rY   )r   r[   râ   ra   rb   r“  Ú	to_memoryr™  Údownloaded_filesrŠ  Ú	file_nameÚdownload_linkr;   Úfile_objÚ	sanitizedÚ	file_pathr–  Úhttp_errÚerrs                      r!   Údownload_attachments_from_pagez)Confluence.download_attachments_from_page�  sL  € ñ: ˜T˜\Ü—9‘9“;ˆDð8	Dáà"×?Ñ?ÈÐZbÐ?ÓcÐdmÑn�Ù"Ø:¸8¸*ÐDXÐYÐYð #×?Ñ?ÈÐW\ÐdiÐ?ÓjÐktÑu�Ù"Ø>ð  "ÐØ)ó -�
Ø& wÑ/ÒC°:¸dÑ3C�	Ø *¨8Ñ 4°ZÑ @�àŸ8™8¤C¨Ó$6È$˜8ÓO�áä!Ÿz™z¨(Ó3�HØ2:Ð$ YÒ/ô —y‘yÐ!9¸9ÔEÜ$&§F¡FÐ+CÀSÈ)Ó$T˜	Ü Ÿ™Ø)¨)¨Ð4gÐhqÐgrÐrtÐuÜ'ôð %.˜	Ü "§¡§¡¨T°9Ó =�Iä "§¡§¡¨T°9Ó =�IÜ˜i¨Ó.ð -°$ØŸ
™
 8Ô,÷-ñ -ð--ñ4 Ø'Ð'ä25°kÓ2BÈDÑQÐQ÷-ñ -ûô "ò 	OÜ# o°d°VÐ;LÐ$MÓNÐNÜò 	_Ü!Ð$TÐUYÐTZÐZ\Ð"]Ó^Ð^Ü×!Ñ!ò 	Ü×$Ñ$ØEÀhÀZÐPØ!×*Ñ*Ø ×(Ñ(ôð ûô
 ò 	DÜÐ<¸S¸EÐBÓCÐCûð	DúsN   šF ºF ÁC1F ÅE4ÅF Å&F Å4E>	Å9F ÆAHÇ/G1Ç1HÇ=HÈHc                 óV   — ||dœ}|r||d<   | j                  d|| j                  ¬«      S )z¶
        Remove completely a file if version is None or delete version
        :param version:
        :param page_id: file version
        :param filename:
        :return:
        )rJ  r�  r”   zjson/removeattachment.actionrN  )rX   Úform_token_headers)r   r[   r“  r”   r2   s        r!   Údelete_attachmentzConfluence.delete_attachmentç  s@   € ð $°Ñ:ˆÙØ 'ˆF�9ÑØ�y‰yØ*ØØ×+Ñ+ð ó 
ð 	
r"   c                 ó^   — | j                   r	d|› d|› �}nd|› d|› �}| j                  |«      S )z£
        Remove completely a file if version is None or delete version
        :param attachment_id:
        :param version: file version
        :return:
        rd   ú	/version/úrest/experimental/content/©r   r6  )r   Úattachment_idr”   r   s       r!   Údelete_attachment_by_idz"Confluence.delete_attachment_by_idø  s>   € ð �:Š:Ø% m _°I¸g¸YÐG‰Cà.¨}¨o¸YÀwÀiÐPˆCØ�{‰{˜3ÓÐr"   c                 ó   — | j                  |d|¬«      j                  d«      d   }| j                  |j                  d«      «      }t        |«      |kD  r”||   j                  d«      }| j	                  |j                  d«      |¬«       t
        j                  d|j                  d	«      t        |«      «       | j                  |j                  d«      «      }t        |«      |kD  rŒ”t
        j                  d
||j                  d	«      «       y)z‰
        Keep last versions
        :param filename:
        :param page_id:
        :param keep_last_versions:
        :return:
        r”   )r[   rc   r“  r6   r   rr   Únumber)rÍ  r”   z>Removed oldest version for %s, now versions equal more than %sr@   úKept versions %s for %sN)r¯  r:   Úget_attachment_historyr    rÎ  rg   rh   )r   r[   r“  Úkeep_last_versionsrŠ  Úattachment_versionsÚ remove_version_attachment_numbers          r!   Ú#remove_page_attachment_keep_versionz.Confluence.remove_page_attachment_keep_version  s  € ð ×6Ñ6¸wÈyÐckÐ6Ól×pÑpØó
à
ñˆ
ð #×9Ñ9¸*¿.¹.ÈÓ:NÓOÐÜÐ%Ó&Ð);Ò;Ø/BÐCUÑ/V×/ZÑ/ZÐ[cÓ/dÐ,Ø×(Ñ(Ø(Ÿn™n¨TÓ2Ø8ð )ô ô �H‰HØPØ—‘˜wÓ'ÜÐ'Ó(ôð
 #'×"=Ñ"=¸j¿n¹nÈTÓ>RÓ"SÐô Ð%Ó&Ð);Ó;ô 	�‰Ð*Ð,>À
ÇÁÈwÓ@WÕXr"   c                 óŠ   — ||dœ}| j                   rd|› d�}nd|› d�}| j                  ||¬«      xs i j                  d«      S )z
        Get attachment history
        :param attachment_id
        :param limit
        :param start
        :return
        )rb   ra   rd   z/versionrË  rB   r6   ©r   r:   )r   rÍ  rb   ra   r2   r   s         r!   rÒ  z!Confluence.get_attachment_history  sT   € ð !¨5Ñ1ˆØ�:Š:Ø% m _°HÐ=‰Cà.¨}¨o¸XÐFˆCØ—‘˜ V�Ó,Ò2°×7Ñ7¸	ÓBÐBr"   c                 óô   — i }|r||d<   |r||d<   |r||d<   |r||d<   |r||d<   d|› d�}	 | j                  ||¬«      }	|	S # t        $ r,}
|
j                  j                  d	k(  rt	        d
|
¬«      ‚‚ d}
~
ww xY w)zÊ
        Get attachments for page
        :param page_id:
        :param start:
        :param limit:
        :param expand:
        :param filename:
        :param media_type:
        :return:
        ra   rb   rc   r“  Ú	mediaTyperd   r’  rB   rC   re   rE   Nr•   )r   r[   ra   rb   rc   r“  Ú
media_typer2   r   r;   rJ   s              r!   r¯  z'Confluence.get_attachments_from_content/  s´   € ð& ˆÙØ#ˆF�7‰OÙØ#ˆF�7‰OÙØ%ˆF�8ÑÙØ!)ˆF�:ÑÙØ",ˆF�;ÑØ! ' Ð*;Ð<ˆð	Ø—x‘x ¨F�xÓ3ˆHð ˆøô ò 		Ø�z‰z×%Ñ%¨Ò,äðWàôð ð ûð		ús   ­A Á	A7Á'A2Á2A7c                 ó´   — d|› d�}d|dœ}	 | j                  ||¬«      }|S # t        $ r,}|j                  j                  dk(  rt	        d|¬«      ‚‚ d	}~ww xY w)
z‡
        Set a label on the page
        :param page_id: content_id format
        :param label: label to add
        :return:
        rd   r²   Úglobal)r³   rU  ©râ   r3   rC   re   rE   N)rX   r   r;   rH   r	   )r   r[   rÄ   r   r3   r;   rJ   s          r!   Úset_page_labelzConfluence.set_page_label^  sy   € ð " ' ¨&Ð1ˆØ"¨EÑ2ˆð	Ø—y‘y c°�yÓ5ˆHð ˆøô ò 		Ø�z‰z×%Ñ%¨Ò,äðWàôð ð ûð		ús   �" ¢	A«'AÁArÄ   c                 ó   — d|› d�}||dœ}	 | j                  ||¬«      }|S # t        $ rR}|j                  j                  dk(  rt	        d|¬«      ‚|j                  j                  dk(  rt        d	|¬«      ‚‚ d
}~ww xY w)zŠ
        Delete Confluence page label
        :param page_id: content_id format
        :param label: label name
        :return:
        rd   r²   )rr   rU  )râ   r2   r`  zCThe user has view permission, but no edit permission to the contentrE   rC   zcThe content or label doesn't exist, or the calling user doesn't have view permission to the contentN)r6  r   r;   rH   r   r	   )r   r[   rÄ   r   r2   r;   rJ   s          r!   Úremove_page_labelzConfluence.remove_page_labelw  s    € ð " ' ¨&Ð1ˆØ¨Ñ/ˆð	Ø—{‘{¨°F�{Ó;ˆHð" ˆøô! ò 	Ø�z‰z×%Ñ%¨Ò,Ü(Ø\Øôð ð �z‰z×%Ñ%¨Ò,äðVàôð ð ûð	ús   �" ¢	A=«AA8Á8A=c                 ó¦   — d|› d�}	 | j                  |«      }|S # t        $ r,}|j                  j                  dk(  rt	        d|¬«      ‚‚ d }~ww xY w)Nrd   z/historyrC   re   rE   r•   ©r   r[   r   r;   rJ   s        r!   ÚhistoryzConfluence.history•  sh   € Ø! ' ¨(Ð3ˆð	Ø—x‘x “}ˆHð ˆøô ò 		Ø�z‰z×%Ñ%¨Ò,äðWàôð ð ûð		ús   ˆ ›	A¤'AÁAc                 ó$   — | j                  |«      S ©N)rä  ré   s     r!   Úget_content_historyzConfluence.get_content_history¦  s   € Ø�|‰|˜JÓ'Ð'r"   c                 ó^   — | j                   r	d|› d|› �}nd|› d|› �}| j                  |«      S )z‚
        Get content history by version number
        :param content_id:
        :param version_number:
        :return:
        rd   rÊ  rË  rØ  )r   r¹   Úversion_numberr   s       r!   Ú%get_content_history_by_version_numberz0Confluence.get_content_history_by_version_number©  s?   € ð �:Š:Ø% j \°¸>Ð:JÐK‰Cà.¨z¨l¸)ÀNÐCSÐTˆCØ�x‰x˜‹}Ðr"   c                 ó`   — | j                   r	d|› d|› �}nd|› d|› �}| j                  |«       y)ú 
        Remove content history. It works as experimental method
        :param page_id:
        :param version_number: version number
        :return:
        rd   rÊ  rË  NrÌ  )r   r[   ré  r   s       r!   Úremove_content_historyz!Confluence.remove_content_history¶  s=   € ð �:Š:Ø% g Y¨i¸Ð7GÐH‰Cà.¨w¨i°yÀÐ@PÐQˆCØ�‰�CÕr"   c                 ó(   — | j                  ||«       y)rì  N)rí  )r   r[   ré  s      r!   Úremove_page_historyzConfluence.remove_page_historyÃ  s   € ð 	×#Ñ# G¨^Õ<r"   c                 ó6   — d|› d|› �}| j                  |«       y)z
        Remove content history. It works in CLOUD
        :param page_id:
        :param version_id:
        :return:
        rd   rÊ  Nrr  )r   r[   Ú
version_idr   s       r!   Úremove_content_history_in_cloudz*Confluence.remove_content_history_in_cloudÌ  s"   € ð " ' ¨)°J°<Ð@ˆØ�‰�CÕr"   c                 ó¤  — | j                  |d¬«      }|j                  d«      j                  d«      }||kD  rr| j                  |d¬«       | j                  |d¬«      }|j                  d«      j                  d«      }t        j	                  d|j                  d«      |«       ||kD  rŒrt        j	                  d||j                  d«      «       y	)
zp
        Keep last versions
        :param page_id:
        :param keep_last_versions:
        :return:
        r”   r}   rÐ  é   )r[   ré  z*Removed oldest version for %s, now it's %sr@   rÑ  N)r€   r:   rï  rg   rh   )r   r[   rÓ  rM   Úpage_numbers        r!   Ú remove_page_history_keep_versionz+Confluence.remove_page_history_keep_versionÖ  s¿   € ð ×"Ñ"¨7¸9Ð"ÓEˆØ—h‘h˜yÓ)×-Ñ-¨hÓ7ˆØÐ.Ò.Ø×$Ñ$¨WÀQÐ$ÔGØ×&Ñ&¨w¸yÐ&ÓIˆDØŸ(™( 9Ó-×1Ñ1°(Ó;ˆKÜ�H‰HÐAÀ4Ç8Á8ÈGÓCTÐVaÔbð	 Ð.Ó.ô
 	�‰Ð*Ð,>ÀÇÁÈÓ@QÕRr"   c                 óL  — d}| j                  |d¬«      }t        |«      dk(  ry|j                  d«      xs i j                  d«      xs i j                  d«      xs i }||v rA|j                  d	«      j                  d
«      |j                  d	«      j                  d«      z   S y)ze
        Check has unknown attachment error on page
        :param page_id:
        :return:
        z9plugins/servlet/confluence/placeholder/unknown-attachmentz	body.viewr‰   r   Ú r.   r'   r+   r7   ÚbaseÚtinyui)r€   r    r:   )r   r[   Úunknown_attachment_identifierrö   r.   s        r!   Úhas_unknown_attachment_errorz'Confluence.has_unknown_attachment_erroræ  s    € ð )dÐ%Ø×$Ñ$ W°[Ð$ÓAˆÜˆv‹;˜!ÒØØ—‘˜FÓ#Ò) r×.Ñ.¨vÓ6Ò<¸"×AÑAÀ'ÓJÒPÈbˆØ(¨DÑ0Ø—:‘:˜hÓ'×+Ñ+¨FÓ3°f·j±jÀÓ6J×6NÑ6NÈxÓ6XÑXÐXØr"   c                 ó,  — | j                  |«      }|r.|j                  dd«      }||k7  rt        j                  d|«       y| j                  rL| j                  |d¬«      j                  «       xs i j                  d«      xs i j                  d«      xs i }n=| j                  |d¬«      xs i j                  d«      xs i j                  d«      xs i }|j                  d	«      }|rt        j                  |«      }t        j                  d
|«       t        j                  d|«       |j                  «       j                  «       |j                  «       j                  «       k(  rt        j                  d|«       yt        j                  d|«       y)zõ
        Compare content and check is already updated or not
        :param page_id: Content ID for retrieve storage value
        :param body: Body for compare it
        :param title: Title to compare
        :return: True if the same
        r@   NzTitle of %s is differentFr—   r‰   r.   r(   r+   zOld Content: """%s"""zNew Content: """%s"""z!Content of %s is exactly the sameTzContent of %s differs)r€   r:   rg   rh   rV   rT   r   Úsymbol_normalizerr‘   ÚstripÚlower)r   r[   r.   r@   Úconfluence_contentÚcurrent_titleÚconfluence_body_contents          r!   Ú"is_page_content_is_already_updatedz-Confluence.is_page_content_is_already_updatedõ  sr  € ð "×0Ñ0°Ó9ÐÙØ.×2Ñ2°7¸DÓAˆMØ˜Ò%Ü—‘Ð3°WÔ=Øà×Òà×$Ñ$ W°^Ð$ÓD×IÑIÓKÒQÈr×VÑVÐW]Ó^ÒdÐbdß‰c�)‹nò"#à "ñ ð $(×#6Ñ#6°wÀ~Ð#6Ó#VÒ#\ÐZ\×"aÑ"aÐbhÓ"iÒ"oÐmo×!tÑ!tØó"ò "àð ð #5×"8Ñ"8¸Ó"AÐá"ä&+×&=Ñ&=Ð>UÓ&VÐ#ä�	‰	Ð)Ð+BÔCÜ�	‰	Ð)¨4Ô0à"×(Ñ(Ó*×0Ñ0Ó2°d·j±j³l×6HÑ6HÓ6JÒJÜ�H‰HÐ8¸'ÔBØä�H‰HÐ,¨gÔ6Ør"   c	           
      ó4   — | j                  ||||||||¬«      S )zVDuplicate update_page. Left for the people who used it before. Use update_page instead)r[   r@   r.   rA   r,   Ú
minor_editÚversion_commentrG  )Úupdate_page)	r   r[   r@   r.   rA   r,   r  r  rG  s	            r!   Úupdate_existing_pagezConfluence.update_existing_page  s4   € ð ×ÑØØØØØ)Ø!Ø+Ø!ð  ó 	
ð 		
r"   c                 óŽ  — ddi}t         j                  d|||«       |	s&|�$| j                  |||«      r| j                  |«      S 	 | j                  r)| j                  |«      j                  «       d   d   dz   }n| j                  |«      d   d   dz   }|||||d	œd
i idœ}|�| j                  ||«      |d<   |r	d|dœg|d<   |r||d   d<   |
du rddi|d   d
   d<   ddi|d   d
   d<   nddi|d   d
   d<   ddi|d   d
   d<   	 | j                  d|› �||¬«      }|S # t        t        f$ r6}t         j                  d||«       t         j                  |«       Y d}~yd}~ww xY w# t        $ rR}|j                  j                  dk(  rt!        d|¬«      ‚|j                  j                  dk(  rt#        d|¬«      ‚‚ d}~ww xY w) aF  
        Update page if already exist
        :param page_id:
        :param title:
        :param body:
        :param parent_id:
        :param type:
        :param representation: OPTIONAL: either Confluence 'storage' or 'wiki' markup format
        :param minor_edit: Indicates whether to notify watchers about changes.
            If False then notifications will be sent.
        :param version_comment: Version comment
        :param always_update: Whether always to update (suppress content check)
        :param full_width: OPTIONAL: Default False
        :return:
        r“   r†  zUpdating %s "%s" with %sNÚlastUpdatedrÐ  rô  zCan't find '%s' %s!©rÐ  rŽ  r=  )rr   rA   r@   r”   r>  r.   rM   r?  r|   r”   r]   Tr+   rB  r>  rC  rD  rE  rd   ©r3   r2   rÁ   ú…No space or no content type, or setup a wrong version type set to content, or status param is not draft and status content is currentrE   rC   ú'Can not find draft with current content)rg   rh   r  r€   rV   rä  rT   r�   r�   r�   r‘   r/   r[  r   r;   rH   r   r   )r   r[   r@   r.   rF  rA   r,   r  r  Úalways_updaterG  r2   r”   rJ   r3   r;   s                   r!   r  zConfluence.update_page4  sA  € ð: ˜IÐ&ˆÜ�‰Ð+¨T°5¸)ÔDá Ð!1°d×6]Ñ6]Ð^eÐgkÐmrÔ6sØ×&Ñ& wÓ/Ð/ð	Ø×!Ò!ØŸ,™, wÓ/×4Ñ4Ó6°}ÑEÀhÑOÐRSÑS‘àŸ,™, wÓ/°Ñ>¸xÑHÈ1ÑL�ð ØØØ")¸
ÑCØ% rÐ*ñ
ˆð ÐØ×,Ñ,¨T°>ÓBˆD�‰LáØ*0¸	Ñ!BÐ CˆD�ÑÙØ)8ˆD�‰O˜IÑ&à˜ÑØJQÐS_ÐI`ˆD�Ñ˜\Ñ*Ð+EÑFØNUÐWcÐMdˆD�Ñ˜\Ñ*Ð+IÒJàJQÐS`ÐIaˆD�Ñ˜\Ñ*Ð+EÑFØNUÐWdÐMeˆD�Ñ˜\Ñ*Ð+IÑJð	Ø—x‘xØ# G 9Ð-ØØð  ó ˆHð$ ˆøô[ œIÐ&ò 	Ü�I‰IÐ+¨U°DÔ9Ü�I‰I�aŒLÜûð	ûô@ ò 	Ø�z‰z×%Ñ%¨Ò,Ü#ð0ð ô	ð ð �z‰z×%Ñ%¨Ò,Ü&Ð'PÐYZÔ[Ð[àûð	ús2   ÁAD! ÄE) Ä!E&Ä0,E!Å!E&Å)	GÅ2AF?Æ?Gc
                 óÈ  — t         j                  d||«       ddi}
| j                  |||«      r| j                  |«      S | j	                  |«      d   d   dz   }| j                  |d¬«      j                  d	«      xs i j                  d
«      j                  d«      }|j                  dd«      }|	r||z   n||z   }|||| j                  ||«      ||dœdœ}|r	d|dœg|d<   |r||d   d<   	 | j                  d|› �||
¬«      }|S # t        $ rR}|j                  j                  dk(  rt        d|¬«      ‚|j                  j                  dk(  rt        d|¬«      ‚‚ d}~ww xY w)aò  
        Insert body to a page if already exist
        :param parent_id:
        :param page_id:
        :param title:
        :param insert_body:
        :param type:
        :param representation: OPTIONAL: either Confluence 'storage' or 'wiki' markup format
        :param minor_edit: Indicates whether to notify watchers about changes.
            If False then notifications will be sent.
        :param top_of_page: Option to add the content to the end of page body
        :return:
        úUpdating %s "%s"r“   r†  r  rÐ  rô  r—   r‰   r.   r(   r+   z&oacute;õ   Ã³r  )rr   rA   r@   r.   r”   rM   r?  r|   r”   r]   rd   r  rÁ   r  rE   rC   r  N)rg   rh   r  r€   rä  r:   Úreplacer/   r[  r   r;   rH   r   r   )r   r[   r@   Úinsert_bodyrF  rA   r,   r  r  Útop_of_pager2   r”   Úprevious_bodyr.   r3   r;   rJ   s                    r!   Ú_insert_to_existing_pagez#Confluence._insert_to_existing_page‹  s¨  € ô2 	�‰Ð# T¨5Ô1à˜IÐ&ˆà×2Ñ2°7¸KÈÔOØ×&Ñ& wÓ/Ð/à—l‘l 7Ó+¨MÑ:¸8ÑDÀqÑHˆGà×$Ñ$ W°^Ð$ÓD×HÑHÈÓPÒVÐTV×[Ñ[Ð\eÓf×jÑjÐkrÓsð ð *×1Ñ1°*¸dÓCˆMÙ2=�; Ò.À=ÐS^ÑC^ˆDàØØØ×)Ñ)¨$°Ó?Ø&-¸JÑGñˆDñ Ø.4¸IÑ%FÐ$G��[Ñ!ÙØ-<��Y‘ 	Ñ*ðØŸ8™8Ø'¨ yÐ1ØØ!ð $ó �ð$ ˆOøô ò Ø—:‘:×)Ñ)¨SÒ0Ü'ð4ð  !ô	ð ð —:‘:×)Ñ)¨SÒ0Ü*Ð+TÐ]^Ô_Ð_àûðús   Ã-D Ä	E!ÄAEÅE!c           
      ób   — t         j                  d||«       | j                  |||||||d¬«      S )a¢  
        Append body to page if already exist
        :param parent_id:
        :param page_id:
        :param title:
        :param append_body:
        :param type:
        :param representation: OPTIONAL: either Confluence 'storage' or 'wiki' markup format
        :param minor_edit: Indicates whether to notify watchers about changes.
            If False then notifications will be sent.
        :return:
        r  F©rF  rA   r,   r  r  ©rg   rh   r  )r   r[   r@   Úappend_bodyrF  rA   r,   r  s           r!   Úappend_pagezConfluence.append_pageÓ  sE   € ô, 	�‰Ð# T¨5Ô1à×,Ñ,ØØØØØØ)Ø!Øð -ó 	
ð 		
r"   c           
      ób   — t         j                  d||«       | j                  |||||||d¬«      S )a£  
        Append body to page if already exist
        :param parent_id:
        :param page_id:
        :param title:
        :param prepend_body:
        :param type:
        :param representation: OPTIONAL: either Confluence 'storage' or 'wiki' markup format
        :param minor_edit: Indicates whether to notify watchers about changes.
            If False then notifications will be sent.
        :return:
        r  Tr  r  )r   r[   r@   Úprepend_bodyrF  rA   r,   r  s           r!   Úprepend_pagezConfluence.prepend_pageö  sE   € ô, 	�‰Ð# T¨5Ô1à×,Ñ,ØØØØØØ)Ø!Øð -ó 	
ð 		
r"   c	           
      óŒ  — | j                  |«      }	| j                  |	|«      rA| j                  |	|«      }
|�|n| j                  |
«      }| j	                  ||
||||||¬«      }n| j                  |	||||||¬«      }t        j                  d| j                  |xs i j                  d«      xs i j                  d«      «       |S )aÛ  
        Update page or create a page if it is not exists
        :param parent_id:
        :param title:
        :param body:
        :param representation: OPTIONAL: either Confluence 'storage' or 'wiki' markup format
        :param minor_edit: Update page without notification
        :param version_comment: Version comment
        :param editor: OPTIONAL: v2 to be created in the new editor
        :param full_width: OPTIONAL: Default is False
        :return:
        )rF  r[   r@   r.   r,   r  r  rG  )rI   rF  r@   r.   r,   r%   rG  z!You may access your page at: %s%sr7   rú  )
r‹   rK   rz   rƒ   r  rH  rg   rh   r   r:   )r   rF  r@   r.   r,   r  r  r%   rG  rI   r[   rö   s               r!   Úupdate_or_createzConfluence.update_or_create	  sè   € ð. ×#Ñ# IÓ.ˆà×Ñ˜E 5Ô)Ø×&Ñ& u¨eÓ4ˆGØ%.Ð%:™	À×@ZÑ@ZÐ[bÓ@cˆIØ×%Ñ%Ø#ØØØØ-Ø%Ø /Ø%ð &ó 	‰Fð ×%Ñ%ØØ#ØØØ-ØØ%ð &ó ˆFô 	�‰Ø/Ø�H‰HØŠl˜×Ñ Ó)Ò/¨R×4Ñ4°XÓ>ô	
ð
 ˆr"   c                 ó2   — |ddœ}| j                  d|¬«      S )zj
        Convert to Confluence XHTML format from wiki style
        :param wiki:
        :return:
        r)   r*   z$rest/api/contentbody/convert/storagerõ   ©rX   )r   r)   r3   s      r!   Úconvert_wiki_to_storagez"Confluence.convert_wiki_to_storageQ	  s"   € ð °Ñ8ˆØ�y‰yÐ?ÀdˆyÓKÐKr"   c                 ó2   — |ddœ}| j                  d|¬«      S )zn
        Convert from Confluence XHTML format to view format
        :param storage:
        :return:
        r(   r*   z!rest/api/contentbody/convert/viewrõ   r$  )r   r(   r3   s      r!   Úconvert_storage_to_viewz"Confluence.convert_storage_to_viewZ	  s"   € ð !°IÑ>ˆØ�y‰yÐ<À4ˆyÓHÐHr"   c                 óF  — d|› d�}|}	 | j                  ||¬«      }|S # t        $ rx}|j                  j                  dk(  rt	        d|¬«      ‚|j                  j                  dk(  rt        d|¬«      ‚|j                  j                  d	k(  rt	        d
|¬«      ‚‚ d}~ww xY w)z¶
        Set the page (content) property e.g. add hash parameters
        :param page_id: content_id format
        :param data: data should be as json data
        :return:
        rd   ú	/propertyrÞ  rÁ   ú®The given property has a different content id to the one in the path, or the content already has a value with the given key, or the value is missing, or the value is too longrE   r`  úGThe user does not have permission to edit the content with the given idé�  úThe value is too longN)rX   r   r;   rH   r   r   )r   r[   r3   r   Ú	json_datar;   rJ   s          r!   Úset_page_propertyzConfluence.set_page_propertyc	  s½   € ð " ' ¨)Ð4ˆØˆ	ð	Ø—y‘y c°	�yÓ:ˆHð& ˆøô% ò 	Ø�z‰z×%Ñ%¨Ò,Ü#ðEð ô	ð ð �z‰z×%Ñ%¨Ò,Ü(Ø`Øôð ð �z‰z×%Ñ%¨Ò,Ü#Ð$;ÀAÔFÐFàûð!	ús   Š Ÿ	B ¨A3BÂB c                 óü  — d|› d|j                  d«      › �}	 | j                  ||¬«      }|S # t        $ rÄ}|j                  j                  dk(  rt        d|¬«      ‚|j                  j                  dk(  rt        d	|¬«      ‚|j                  j                  d
k(  rt        d|¬«      ‚|j                  j                  dk(  rt        d|¬«      ‚|j                  j                  dk(  rt        d|¬«      ‚‚ d}~ww xY w)zÛ
        Update the page (content) property.
        Use json data or independent keys
        :param data:
        :param page_id: content_id format
        :data: property data in json format
        :return:
        rd   ú
/property/rŠ   rÞ  rÁ   r*  rE   r`  r+  rC   zŽThere is no content with the given id, or no property with the given key, or if the calling user does not have permission to view the content.r4  zWThe given version is does not match the expected target version of the updated propertyr,  r-  N)	r:   r[  r   r;   rH   r   r   r   r   )r   r[   r3   r   r;   rJ   s         r!   Úupdate_page_propertyzConfluence.update_page_propertyƒ	  s  € ð " ' ¨*°T·X±X¸e³_Ð4EÐFˆð	Ø—x‘x S¨t�xÓ4ˆHð8 ˆøô7 ò 	Ø�z‰z×%Ñ%¨Ò,Ü#ðEð ô	ð ð �z‰z×%Ñ%¨Ò,Ü(Ø`Øôð ð �z‰z×%Ñ%¨Ò,Ü&ð[àôð ð
 �z‰z×%Ñ%¨Ò,Ü&ØpØôð ð �z‰z×%Ñ%¨Ò,Ü#Ð$;ÀAÔFÐFØûð5	ús   ™. ®	C;·B?C6Ã6C;c                 ó¾   — d|› dt        |«      › �}	 | j                  |¬«      }|S # t        $ r,}|j                  j                  dk(  rt        d|¬«      ‚‚ d}~ww xY w)zµ
        Delete the page (content) property e.g. delete key of hash
        :param page_id: content_id format
        :param page_property: key of property
        :return:
        rd   r1  ©râ   rC   re   rE   N)rG   r6  r   r;   rH   r	   )r   r[   Úpage_propertyr   r;   rJ   s         r!   Údelete_page_propertyzConfluence.delete_page_property¬	  sw   € ð " ' ¨*´S¸Ó5GÐ4HÐIˆð	Ø—{‘{¨�{Ó,ˆHð ˆøô ò 		Ø�z‰z×%Ñ%¨Ò,äðWàôð ð ûð		úó   “' §	A°'AÁAc                 ó¾   — d|› dt        |«      › �}	 | j                  |¬«      }|S # t        $ r,}|j                  j                  dk(  rt        d|¬«      ‚‚ d}~ww xY w)z³
        Get the page (content) property e.g. get key of hash
        :param page_id: content_id format
        :param page_property_key: key of property
        :return:
        rd   r1  r4  rC   zŠThere is no content with the given id, or no property with the given key, or the calling user does not have permission to view the contentrE   N)rG   r:   r   r;   rH   r	   )r   r[   Úpage_property_keyr   r;   rJ   s         r!   Úget_page_propertyzConfluence.get_page_propertyÃ	  sy   € ð " ' ¨*´SÐ9JÓ5KÐ4LÐMˆð	Ø—x‘x S�xÓ)ˆHð ˆøô ò 
	Ø�z‰z×%Ñ%¨Ò,äð"ð ô	ð ð ûð
	úr7  c                 ó¨   — d|› d�}	 | j                  |¬«      }|S # t        $ r,}|j                  j                  dk(  rt	        d|¬«      ‚‚ d}~ww xY w)z}
        Get the page (content) properties
        :param page_id: content_id format
        :return: get properties
        rd   r)  r4  rC   re   rE   Nr•   rã  s        r!   Úget_page_propertieszConfluence.get_page_propertiesÛ	  sm   € ð " ' ¨)Ð4ˆð	Ø—x‘x S�xÓ)ˆHð ˆøô ò 		Ø�z‰z×%Ñ%¨Ò,äðWàôð ð ûð		ús   ˆ œ	A¥'AÁAc                 óÆ   — d|› d�}	 | j                  |¬«      }|j                  d«      S # t        $ r,}|j                  j                  dk(  rt	        d|¬«      ‚‚ d}~ww xY w)	zŒ
        Provide the ancestors from the page (content) id
        :param page_id: content_id format
        :return: get properties
        rd   z?expand=ancestorsr4  rC   rD   rE   Nr|   rÇ   rã  s        r!   Úget_page_ancestorszConfluence.get_page_ancestorsò	  su   € ð " ' Ð*;Ð<ˆð		Ø—x‘x S�xÓ)ˆHð �|‰|˜KÓ(Ð(øô ò 	Ø�z‰z×%Ñ%¨Ò,Ü(ØSØôð ð
 ûð	ús   ˆ+ «	A ´'AÁA c                 ó@   — | j                   }| j                  d|¬«      S )z&Clean all caches from cache managementú%rest/cacheManagement/1.0/cacheEntries©rU   ©rÇ  r6  )r   rU   s     r!   Úclean_all_cacheszConfluence.clean_all_caches
  s!   € à×)Ñ)ˆØ�{‰{ÐBÈGˆ{ÓTÐTr"   c                 óJ   — | j                   }d|i}| j                  d||¬«      S )z�Clean caches from cache management
        e.g.
        com.gliffy.cache.gon
        org.hibernate.cache.internal.StandardQueryCache_v5
        Ú	cacheNamer@  ©r3   rU   rB  )r   Ú
cache_namerU   r3   s       r!   Úclean_package_cachezConfluence.clean_package_cache
  s0   € ð ×)Ñ)ˆØ˜ZÐ(ˆØ�{‰{ÐBÈÐW^ˆ{Ó_Ð_r"   c                 óÈ   — d|› d|› �}	 | j                  |«      }|j                  d«      S # t        $ r,}|j                  j                  dk(  rt	        d|¬«      ‚‚ d}~ww xY w)a[  
        Get all groups from Confluence User management
        :param start: OPTIONAL: The start point of the collection to return. Default: None (0).
        :param limit: OPTIONAL: The limit of the number of groups to return, this may be restricted by
                                fixed system limits. Default: 1000
        :return:
        zrest/api/group?limit=ú&start=r`  z8The calling user does not have permission to view groupsrE   Nr6   rÇ   )r   ra   rb   r   r;   rJ   s         r!   Úget_all_groupszConfluence.get_all_groups
  su   € ð & e W¨G°E°7Ð;ˆð		Ø—x‘x “}ˆHð �|‰|˜IÓ&Ð&øô ò 	Ø�z‰z×%Ñ%¨Ò,Ü(ØNØôð ð
 ûð	ús   Š, ¬	A!µ'AÁA!c                 ó6   — d}|ddœ}| j                  ||¬«      S )zu
        Create a group by given group parameter

        :param name: str
        :return: New group params
        zrest/api/admin/groupr\   )rU  rA   rõ   r$  )r   rU  r   r3   s       r!   Úcreate_groupzConfluence.create_group-
  s&   € ð %ˆØ gÑ.ˆØ�y‰y˜ 4ˆyÓ(Ð(r"   c                 óÐ   — t         j                  d|«       d|› �}	 | j                  |«      }|S # t        $ r,}|j                  j
                  dk(  rt        d|¬«      ‚‚ d}~ww xY w)zÕ
        Delete a group by given group parameter
        If you delete a group and content is restricted to that group, the content will be hidden from all users

        :param name: str
        :return:
        zDRemoving group:  %s  during Confluence remove_group method executionzrest/api/admin/group/rC   z`There is no group with the given name, or the calling user does not have permission to delete itrE   N)rg   rh   r6  r   r;   rH   r	   )r   rU  r   r;   rJ   s        r!   Úremove_groupzConfluence.remove_group8
  sy   € ô 	�‰ÐWÐY]Ô^Ø% d VÐ,ˆð
	Ø—{‘{ 3Ó'ˆHð ˆøô ò 	Ø�z‰z×%Ñ%¨Ò,äðPàôð ð
 ûð	ús   �0 °	A%¹'A Á A%c                 óÔ   — d|› d|› d|› d|› �}	 | j                  |«      }|j                  d	«      S # t        $ r,}|j                  j                  dk(  rt	        d|¬«      ‚‚ d}~ww xY w)
aß  
        Get a paginated collection of users in the given group
        :param group_name
        :param start: OPTIONAL: The start point of the collection to return. Default: None (0).
        :param limit: OPTIONAL: The limit of the number of users to return, this may be restricted by
                            fixed system limits. Default: 1000
        :param expand: OPTIONAL: A comma separated list of properties to expand on the content. status
        :return:
        zrest/api/group/z/member?limit=rJ  z&expand=r`  ú7The calling user does not have permission to view usersrE   Nr6   rÇ   )r   Ú
group_namera   rb   rc   r   r;   rJ   s           r!   Úget_group_memberszConfluence.get_group_membersQ
  sƒ   € ð   
˜|¨>¸%¸ÀÈÀwÈhÐW]ÐV^Ð_ˆð		Ø—x‘x “}ˆHð �|‰|˜IÓ&Ð&øô ò 	Ø�z‰z×%Ñ%¨Ò,Ü(ØMØôð ð
 ûð	ús   �2 ²	A'»'A"Á"A'c                 óÌ   — d}d}d}g }|rH| j                  |t        |«      ||¬«      }|dz  }t        |«      dk(  rd}n|j                  |«       |rŒH|st        d|› d�«       |S )	zÓ
        Get  collection of all users in the given group
        :param group_name
        :param expand: OPTIONAL: A comma separated list of properties to expand on the content. status
        :return:
        é2   Tr   )rR  ra   rb   rc   rô  FzDid not get members from z0 group, please check permissions or connectivity)rS  r    rª   r  )r   rR  rc   rb   ÚflagÚstepÚmembersÚvaluess           r!   Úget_all_memberszConfluence.get_all_membersj
  sŠ   € ð ˆØˆØˆØˆÙØ×+Ñ+Ø%Ü˜'“lØØð	 ,ó ˆFð �A‰IˆDÜ�6‹{˜aÒØ‘à—‘˜vÔ&ò ñ ÜÐ-¨j¨\Ð9iÐjÔkØˆr"   c                 óÂ   — d|› �}|xs i }|r||d<   	 | j                  ||¬«      }|S # t        $ r,}|j                  j                  dk(  rt	        d|¬«      ‚‚ d}~ww xY w)a?  
        Get information about a space through space key
        :param space_key: The unique space key name
        :param expand: OPTIONAL: additional info from description, homepage
        :param params: OPTIONAL: dictionary of additional URL parameters
        :return: Returns the space along with its ID
        rz  rc   rB   rC   údThere is no space with the given key, or the calling user does not have permission to view the spacerE   Nr•   )r   rP  rc   r2   r   r;   rJ   s          r!   Ú	get_spacezConfluence.get_space…
  sƒ   € ð   	˜{Ð+ˆØ’˜2ˆÙØ%ˆF�8Ñð
	Ø—x‘x ¨F�xÓ3ˆHð ˆøô ò 	Ø�z‰z×%Ñ%¨Ò,äðUàôð ð
 ûð	ús   ”) ©	A²'AÁAc                 óÜ   — |rd|z   nd› }d|› d|› �}|||dœ}|r||d<   	 | j                  ||¬«      }	|	S # t        $ r,}
|
j                  j                  dk(  rt	        d	|
¬
«      ‚‚ d}
~
ww xY w)ab  
        Get space content.
        You can specify which type of content want to receive, or get all content types.
        Use expand to get specific content properties or page
        :param content_type:
        :param space_key: The unique space key name
        :param depth: OPTIONAL: all|root
                                Gets all space pages or only root pages
        :param start: OPTIONAL: The start point of the collection to return. Default: 0.
        :param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
                                fixed system limits. Default: 500
        :param expand: OPTIONAL: by default expands page body in confluence storage format.
                                 See atlassian documentation for more information.
        :return: Returns the space along with its ID
        r•  rø  rz  z/content)r¸   ra   rb   rc   rB   rC   r\  rE   Nr•   )r   rP  r¸   ra   rb   rÈ   rc   r   r2   r;   rJ   s              r!   Úget_space_contentzConfluence.get_space_contentž
  s£   € ñ2 1=˜# Ò,À"ÐEˆØ 	˜{¨(°<°.ÐAˆàØØñ
ˆñ
 Ø%ˆF�8Ñð
	Ø—x‘x ¨F�xÓ3ˆHð ˆøô ò 	Ø�z‰z×%Ñ%¨Ò,äðUàôð ð
 ûð	ús   ¡6 ¶	A+¿'A&Á&A+c                 óF   — | j                  |d¬«      j                  d«      S )z—
        Get information about a space through space key
        :param space_key: The unique space key name
        :return: Returns homepage
        Úhomepager‰   )r]  r:   )r   rP  s     r!   Úget_home_page_of_spacez!Confluence.get_home_page_of_spaceÍ
  s"   € ð �~‰~˜i°
ˆ~Ó;×?Ñ?À
ÓKÐKr"   c                 ó4   — ||dœ}| j                  d|¬«       y)zd
        Create space
        :param space_key:
        :param space_name:
        :return:
        )rŠ   rU  ru  rõ   Nr$  )r   rP  Ú
space_namer3   s       r!   Úcreate_spacezConfluence.create_spaceÕ
  s   € ð !¨*Ñ5ˆØ�	‰	Ð"¨ˆ	Õ.r"   c                 ó¤   — d|› �}	 | j                  |«      }|S # t        $ r,}|j                  j                  dk(  rt	        d|¬«      ‚‚ d}~ww xY w)zI
        Delete space
        :param space_key:
        :return:
        rz  rC   z_There is no space with the given key, or the calling user does not have permission to delete itrE   N)r6  r   r;   rH   r	   )r   rP  r   r;   rJ   s        r!   Údelete_spacezConfluence.delete_spaceß
  si   € ð   	˜{Ð+ˆð	Ø—{‘{ 3Ó'ˆHð ˆøô ò 		Ø�z‰z×%Ñ%¨Ò,äðPàôð ð ûð		úrc  c                 ó¼   — d|› d�}i }|r||d<   	 | j                  ||¬«      }|S # t        $ r,}|j                  j                  dk(  rt	        d|¬«      ‚‚ d }~ww xY w)Nrz  r)  rc   rB   rC   r\  rE   r•   )r   rP  rc   r   r2   r;   rJ   s          r!   Úget_space_propertyzConfluence.get_space_propertyö
  s   € Ø 	˜{¨)Ð4ˆØˆÙØ%ˆF�8Ñð	Ø—x‘x ¨F�xÓ3ˆHð ˆøô ò 		Ø�z‰z×%Ñ%¨Ò,äðUàôð ð ûð		ús   ‘& ¦	A¯'AÁAc                 ó  — d}d|i}|r||d<   	 | j                  ||¬«      }|S # t        $ rR}|j                  j                  dk(  rt	        d|¬«      ‚|j                  j                  dk(  rt        d	|¬«      ‚‚ d
}~ww xY w)a  
        Get information about a user through username
        :param username: The username
        :param expand: OPTIONAL expand for get status of user.
                Possible param is "status". Results are "Active, Deactivated"
        :return: Returns the user details
        úrest/api/userÚusernamerc   rB   r`  rQ  rE   rC   ú:The user with the given username or userkey does not existN©r:   r   r;   rH   r   r   )r   rl  rc   r   r2   r;   rJ   s          r!   Úget_user_details_by_usernamez'Confluence.get_user_details_by_username  s¡   € ð ˆØ˜hÐ'ˆÙØ%ˆF�8Ñð	Ø—x‘x ¨F�xÓ3ˆHð ˆøô ò 	Ø�z‰z×%Ñ%¨Ò,Ü(ØMØôð ð �z‰z×%Ñ%¨Ò,Ü&ØPØôð ð
 ûð	úó   �$ ¤	A?­AA:Á:A?c                 ó  — d}d|i}|r||d<   	 | j                  ||¬«      }|S # t        $ rR}|j                  j                  dk(  rt	        d|¬«      ‚|j                  j                  dk(  rt        d	|¬«      ‚‚ d
}~ww xY w)a   
        Get information about a user through accountid
        :param accountid: The account id
        :param expand: OPTIONAL expand for get status of user.
                Possible param is "status". Results are "Active, Deactivated"
        :return: Returns the user details
        rk  Ú	accountIdrc   rB   r`  rQ  rE   rC   z.The user with the given account does not existNrn  )r   Ú	accountidrc   r   r2   r;   rJ   s          r!   Úget_user_details_by_accountidz(Confluence.get_user_details_by_accountid*  s¡   € ð ˆØ˜yÐ)ˆÙØ%ˆF�8Ñð	Ø—x‘x ¨F�xÓ3ˆHð ˆøô ò 	Ø�z‰z×%Ñ%¨Ò,Ü(ØMØôð ð �z‰z×%Ñ%¨Ò,Ü&ØDØôð ð
 ûð	úrp  c                 ó  — d}d|i}|r||d<   	 | j                  ||¬«      }|S # t        $ rR}|j                  j                  dk(  rt	        d|¬«      ‚|j                  j                  dk(  rt        d	|¬«      ‚‚ d
}~ww xY w)a  
        Get information about a user through user key
        :param userkey: The user key
        :param expand: OPTIONAL expand for get status of user.
                Possible param is "status". Results are "Active, Deactivated"
        :return: Returns the user details
        rk  rŠ   rc   rB   r`  rQ  rE   rC   rm  Nrn  )r   Úuserkeyrc   r   r2   r;   rJ   s          r!   Úget_user_details_by_userkeyz&Confluence.get_user_details_by_userkeyI  s¡   € ð ˆØ˜Ð!ˆÙØ%ˆF�8Ñð	Ø—x‘x ¨F�xÓ3ˆHð ˆøô ò 	Ø�z‰z×%Ñ%¨Ò,Ü(ØMØôð ð �z‰z×%Ñ%¨Ò,Ü&ØPØôð ð
 ûð	úrp  c                 ó  — i }|�t        |«      |d<   |�t        |«      |d<   |�||d<   |�||d<   |�||d<   |�||d<   	 | j                  d|¬	«      }|S # t        $ r,}	|	j                  j                  d
k(  rt        d|	¬«      ‚‚ d}	~	ww xY w)a³  
        Get results from cql search result with all related fields
        Search for entities in Confluence using the Confluence Query Language (CQL)
        :param cql:
        :param start: OPTIONAL: The start point of the collection to return. Default: 0.
        :param limit: OPTIONAL: The limit of the number of issues to return, this may be restricted by
                        fixed system limits. Default by built-in method: 25
        :param excerpt: the excerpt strategy to apply to the result, one of : indexed, highlight, none.
                        This defaults to highlight
        :param expand: OPTIONAL: the properties to expand on the search result,
                        this may cause database requests for some properties
        :param include_archived_spaces: OPTIONAL: whether to include content in archived spaces in the result,
                                    this defaults to false
        :return:
        Nra   rb   rÀ   rc   ÚincludeArchivedSpacesÚexcerptzrest/api/searchrB   rÁ   zThe query cannot be parsedrE   )rf   r:   r   r;   rH   r   )
r   rÀ   ra   rb   rc   Úinclude_archived_spacesrz  r2   r;   rJ   s
             r!   rÀ   zConfluence.cqlh  sÂ   € ð0 ˆØÐÜ! %›jˆF�7‰OØÐÜ! %›jˆF�7‰OØˆ?ØˆF�5‰MØÐØ%ˆF�8ÑØ"Ð.Ø.EˆFÐ*Ñ+ØÐØ 'ˆF�9Ñð	Ø—x‘xÐ 1¸&�xÓAˆHð ˆøô ò 	Ø�z‰z×%Ñ%¨Ò,Ü#Ð$@ÈÔKÐKàûð		ús   Á A Á	B
Á'BÂB
c                 ó.  — | j                   }d|› �}| j                  dk(  s| j                  rV| j                  |«      }|s"t        j                  d«       t        dd¬«      ‚t        j                  |d¬«      j                  S | j                  ||d¬	«      S )
zp
        Export page as standard pdf exporter
        :param page_id: Page ID
        :return: PDF File
        z-spaces/flyingpdf/pdfpageexport.action?pageId=r   zFailed to get download PDF url.zFailed to export page as PDFrE   éK   )ÚtimeoutT©rU   r©  )
rÇ  rø   r   Ú)get_pdf_download_url_for_confluence_cloudrg   r�   r   r»  r:   r  ©r   r[   rU   r   s       r!   Úget_page_as_pdfzConfluence.get_page_as_pdf˜  sŠ   € ð ×)Ñ)ˆØ=¸g¸YÐGˆØ×Ñ˜wÒ&¨$¯*ª*Ø×@Ñ@ÀÓEˆCÙÜ—	‘	Ð;Ô<Ü&Ð'EÐNoÔpÐpä—<‘< ¨RÔ0×8Ñ8Ð8Ø�x‰x˜ WÀˆxÓEÐEr"   c                 óL   — | j                   }d|› �}| j                  ||d¬«      S )zs
        Export page as standard word exporter.
        :param page_id: Page ID
        :return: Word File
        zexportword?pageId=Tr  )rÇ  r:   r�  s       r!   Úget_page_as_wordzConfluence.get_page_as_word©  s0   € ð ×)Ñ)ˆØ" 7 )Ð,ˆØ�x‰x˜ WÀˆxÓEÐEr"   rP  Úexport_typeÚreturnc           	      ól  ‡ — dt         fˆ fd„}‰ j                  |d¬«       	 t        j                  d|z   dz   |z   «       |dk(  rt	         |d|› �«      d	d
dd¬«      }ni|dk(  r |d|› �«      dddddœ}nR|dk(  r |d|› �«      dd
dddœ}n;|dk(  r+d|z   }t        j                  d«       ‰ j                  |«      S t        d«      ‚‰ j                  ‰ j                  d|› �¬«      }‰ j                  j                  |‰ j                  |¬«      }t        |j                  d«      }	 t        d|j                  ddd i«      j!                  d!«      «      }d%}
|
rý	 ‰ j!                  |«      xs i }t        j                  d&|› d'|j!                  d(d)«      › �«       |i ur |j!                  d*«      r�t        |j!                  d(«      d«      }t        d|j                  d+d,d-i«      j!                  d.«      «      }‰ j                  |v r|S ‰ j                  |z   }|j'                  d/«      d0kD  r|j)                  d1d/«      }|S t+        j,                  d2«       |
rŒýy)# t"        $ r}	t%        d"|	¬#«      ‚d$}	~	ww xY w# t"        $ r}	t%        d3|z   |	¬#«      ‚d$}	~	ww xY w# t"        $ r}	t%        d4|z   |	¬#«      ‚d$}	~	ww xY w)5aB  
        Export a Confluence space to a file of the specified type.
        (!) This method was developed for Confluence Cloud and may not work with Confluence on-prem.
        (!) This is an experimental method that does not trigger an officially supported REST endpoint.
        It may break if Atlassian changes the space export front-end logic.

        :param space_key: The key of the space to export.
        :param export_type: The type of export to perform. Valid values are: 'html', 'csv', 'xml', 'pdf'.
        :return: The URL to download the exported file.
        Úlinkc                 óÞ   •— 	 ‰j                  | d¬«      }t        |j                  d«      }|j                  dddi«      j                  d«      }|S # t        $ r}t        d|¬	«      ‚d }~ww xY w)
NT)rV   úhtml.parserÚinputrU  Ú	atl_tokenr+   zAProblems with getting the atl_token for get_space_export method :rE   )r:   r   rZ   ÚfindrY   r	   )rˆ  r;   Úparsed_htmlrŒ  rJ   r   s        €r!   Úget_atl_requestz4Confluence.get_space_export.<locals>.get_atl_request¿  su   ø€ ðnØŸ8™8 D¸˜8Ó=�Ü+¨H¯M©M¸=ÓI�Ø'×,Ñ,¨W°v¸{Ð6KÓL×PÑPÐQXÓY�	Ø Ð øÜò nÜÐbÐklÔmÐmûðnús   ƒAA Á	A,ÁA'Á'A,Úpermissions©rP  rc   z@Initiated experimental get_space_export method for export type: z from Confluence space: Úcsvz!spaces/exportspacecsv.action?key=ÚTYPE_CSVÚallrŒ  ÚExport)rŒ  Ú
exportTypeÚcontentOptionÚincludeCommentsÚconfirmÚhtmlz"spaces/exportspacehtml.action?key=Ú	TYPE_HTMLÚvisibleOnlyÚxmlz!spaces/exportspacexml.action?key=ÚTYPE_XMLÚpdfz(spaces/flyingpdf/doflyingpdf.action?key=zInitiated PDF  space exportzIInvalid export_type parameter value. Valid values are: 'html/csv/xml/pdf'z spaces/doexportspace.action?key=)r   râ   )rU   r3   rŠ  rG   ÚmetarU  zajs-pollURIr  z@Problems with getting the poll_url for get_space_export method :rE   NTzSpace z export status: r]   ÚNoneÚcompleteÚaÚclasszspace-export-download-pathÚhrefr   rô  z
/wiki/wikié   z>Encountered error during space export status check from space z1Encountered error during space export from space )rG   r]  rg   rh   r  r€  r-   r   r   ÚsessionrX   rÇ  r   rZ   r   r�  r:   rY   r	   Úcountr  ÚtimeÚsleep)r   rP  r…  r�  Ú	form_datar   r;   rŽ  Úpoll_urlrJ   Úrunning_taskÚprogress_responseÚdownload_urlÚcombined_urls   `             r!   Úget_space_exportzConfluence.get_space_export³  s#  ø€ ð		n¤#õ 		nð 	�‰ °=ˆÔAðG	fÜ�H‰HØRØñà,ñ-ð ñôð ˜eÒ#Ü Ù-Ð0QÐR[ÐQ\Ð.]Ó^Ø)Ø"'Ø$*Ø$ô‘	ð  Ò&á!0Ð3UÐV_ÐU`Ð1aÓ!bØ"-Ø%2Ø'-Ø'ñ‘	ð  Ò%á!0Ð3TÐU^ÐT_Ð1`Ó!aØ",Ø%*Ø'-Ø'ñ‘	ð  Ò%Ø@À9ÑL�Ü—‘Ð6Ô7Ø×EÑEÀcÓJÐJä Ð!lÓmÐmØ—/‘/ d§h¡hÐ7WÐXaÐWbÐ5c�/ÓdˆCð —|‘|×(Ñ(¨°d×6MÑ6MÐT]Ð(Ó^ˆHÜ'¨¯©°}ÓEˆKðmÜ  {×'7Ñ'7¸ÀÈÐ@WÓ'X×'\Ñ'\Ð]fÓ'gÓh�ð  ˆLÙðØ(,¯©°Ó(:Ò(@¸bÐ%Ü—H‘H˜v i [Ð0@ÐAR×AVÑAVÐW`ÐbhÓAiÐ@jÐkÔlØ(°Ñ2Ð7H×7LÑ7LÈZÔ7XÜ&3Ð4E×4IÑ4IÈ)Ó4TÐVcÓ&d˜Ü'+¨E°;×3CÑ3CÀCÈ'ÐSoÐIpÓ3q×3uÑ3uÐv|Ó3}Ó'~˜ØŸ8™8 |Ñ3Ø#/Ð/à+/¯8©8°lÑ+B˜Là+×1Ñ1°'Ó:¸QÒ>Ø/;×/CÑ/CÀLÐRYÓ/Z Ø#/Ð/Ü—J‘J˜r”Nò ð* øô1 ò mÜÐaÐjkÔlÐlûðmûô& !ò Ü"ØXÐ[dÑdÐmnôð ûðûô ò 	fÜÐNÐQZÑZÐcdÔeÐeûð	fúst   ¢BJ Â=A)J Ä'-I ÅJ ÅB,I4 È6I4 È=I4 ÉJ É	I1ÉI,É,I1É1J É4	JÉ=JÊJÊJ Ê	J3ÊJ.Ê.J3c                 ó$   — | j                  |«      S )zo
        Alias method for export page as pdf
        :param page_id: Page ID
        :return: PDF File
        )r‚  rv   s     r!   Úexport_pagezConfluence.export_page  s   € ð ×#Ñ# GÓ,Ð,r"   c                 ó0  — d}d|› d|› d�}	 | j                  |i «      }|j                  d	g «      D ]*  }|j                  d
«      |k(  sŒ|j                  d«      } |S  |S # t        $ r,}|j                  j                  dk(  rt	        d|¬«      ‚‚ d}~ww xY w)a  
        Provide  space, parent_id and title of the descendant page, it will return the descendant page_id
        :param space: str
        :param parent_id: int
        :param title: str
        :return: page_id of the page whose title is passed in argument
        rø  z#rest/api/content/search?cql=parent=z%20AND%20space="r¿   rÁ   rÂ   rE   Nr6   r@   rr   rÃ   )	r   rI   rF  r@   r[   r   r;   rJ   Ú	each_pages	            r!   Úget_descendant_page_idz!Confluence.get_descendant_page_id  s³   € ð ˆà3°I°;Ð>NÈuÈgÐUVÐWˆð	Ø—x‘x  RÓ(ˆHð "Ÿ™ i°Ó4ò 	ˆIØ�}‰}˜WÓ%¨Ó.Ø#Ÿ-™-¨Ó-�ØØˆð		ð ˆøô ò 	Ø�z‰z×%Ñ%¨Ò,Ü#Ð$CÈAÔNÐNàûð		ús   �A  Á 	BÁ)'BÂBc                 ó(   — d}| j                  |«      S )zQ
        It is not public method for reindex Confluence
        :return:
        úrest/prototype/1/index/reindexr$  ©r   r   s     r!   ÚreindexzConfluence.reindex8  s   € ð
 /ˆØ�y‰y˜‹~Ðr"   c                 ó(   — d}| j                  |«      S )zC
        Get reindex status of Confluence
        :return:
        r¸  r9   r¹  s     r!   Úreindex_get_statuszConfluence.reindex_get_status@  s   € ð
 /ˆØ�x‰x˜‹}Ðr"   c                 óN   — | j                  d«      }|s| j                  d«      }|S )z§
        Get health status
        https://confluence.atlassian.com/jirakb/how-to-retrieve-health-check-results-using-rest-api-867195158.html
        :return:
        zrest/troubleshooting/1.0/check/z"rest/supportHealthCheck/1.0/check/r9   )r   r;   s     r!   Úhealth_checkzConfluence.health_checkH  s*   € ð —8‘8Ð=Ó>ˆÙà—x‘xÐ DÓEˆHØˆr"   c                 ó4   — ddi}d}| j                  ||¬«      S )z3
        Enable Synchrony
        :return:
        r�  r�  úrest/synchrony-interop/enablerA  r$  ©r   rU   r   s      r!   Úsynchrony_enablezConfluence.synchrony_enableU  s&   € ð
 '¨
Ð3ˆØ-ˆØ�y‰y˜ gˆyÓ.Ð.r"   c                 ó4   — ddi}d}| j                  ||¬«      S )z4
        Disable Synchrony
        :return:
        r�  r�  úrest/synchrony-interop/disablerA  r$  rÁ  s      r!   Úsynchrony_disablezConfluence.synchrony_disable^  s&   € ð
 '¨
Ð3ˆØ.ˆØ�y‰y˜ gˆyÓ.Ð.r"   c                 ó$   — | j                  d«      S )Nzrest/api/accessmoder9   )r   s    r!   Úcheck_access_modezConfluence.check_access_modeg  s   € Ø�x‰xÐ-Ó.Ð.r"   c                 óš   — 	 | j                  d«      }|S # t        $ r,}|j                  j                  dk(  rt	        d|¬«      ‚‚ d}~ww xY w)zc
        Get information about how anonymous is represented in confluence
        :return:
        zrest/api/user/anonymousr`  z;The calling user does not have permission to use ConfluencerE   NrÇ   )r   r;   rJ   s      r!   Ú	anonymouszConfluence.anonymousj  sY   € ð
		Ø—x‘xÐ 9Ó:ˆHð ˆøô ò 	Ø�z‰z×%Ñ%¨Ò,Ü(ØQØôð ð
 ûð	ús   ‚ •	A
ž'AÁA
c                 óB   — d}| j                  || j                  d¬«      S )zR
        Provide plugins info
        :return a json of installed plugins
        úrest/plugins/1.0/T©rU   r1   ©r:   rO  r¹  s     r!   Úget_plugins_infozConfluence.get_plugins_info|  s$   € ð
 "ˆØ�x‰x˜ T×%:Ñ%:ÀTˆxÓJÐJr"   c                 óJ   — d|› d�}| j                  || j                  d¬«      S )zQ
        Provide plugin info
        :return a json of installed plugins
        rË  ú-keyTrÌ  rÍ  ©r   Ú
plugin_keyr   s      r!   Úget_plugin_infozConfluence.get_plugin_info„  s-   € ð
 " * ¨TÐ2ˆØ�x‰x˜ T×%:Ñ%:ÀTˆxÓJÐJr"   c                 óJ   — d|› d�}| j                  || j                  d¬«      S )z[
        Provide plugin license info
        :return a json specific License query
        rË  z-key/licenseTrÌ  rÍ  rÑ  s      r!   Úget_plugin_license_infoz"Confluence.get_plugin_license_infoŒ  s-   € ð
 " * ¨\Ð:ˆØ�x‰x˜ T×%:Ñ%:ÀTˆxÓJÐJr"   c                 ó¼   — dt        |d«      i}| j                  dd| j                  d¬«      j                  d   }d|› �}| j	                  ||| j                  ¬	«      S )
zƒ
        Provide plugin path for upload into Jira e.g. useful for auto deploy
        :param plugin_path:
        :return:
        Úpluginr�  ÚGETrË  T)rô   râ   rU   r1   z	upm-tokenzrest/plugins/1.0/?token=)r—  rU   )r¢  r­  rO  rU   rX   )r   Úplugin_pathr—  Ú	upm_tokenr   s        r!   Úupload_pluginzConfluence.upload_plugin”  sq   € ð œ4 ¨TÓ2Ð3ˆØ—L‘LØØ$Ø×)Ñ)Øð	 !ó 
÷
 ‰'�+ñˆ	ð )¨¨Ð4ˆØ�y‰y˜ E°4×3HÑ3HˆyÓIÐIr"   c                 óH   — dddœ}d|› d�}ddi}| j                  |||¬«      S )	zN
        Disable a plugin
        :param plugin_key:
        :return:
        r�  ú application/vnd.atl.plugins+json©r�  úContent-TyperË  rÐ  r“   ÚdisabledrF  r{  ©r   rÒ  Úapp_headersr   r3   s        r!   Údisable_pluginzConfluence.disable_plugin¤  s@   € ð ",Ø>ñ
ˆð " * ¨TÐ2ˆØ˜*Ð%ˆØ�x‰x˜ $°ˆxÓ<Ð<r"   c                 óH   — dddœ}d|› d�}ddi}| j                  |||¬«      S )	zM
        Enable a plugin
        :param plugin_key:
        :return:
        r�  rÝ  rÞ  rË  rÐ  r“   ÚenabledrF  r{  rá  s        r!   Úenable_pluginzConfluence.enable_plugin²  s@   € ð ",Ø>ñ
ˆð " * ¨TÐ2ˆØ˜)Ð$ˆØ�x‰x˜ $°ˆxÓ<Ð<r"   c                 ó0   — d|› d�}| j                  |«      S )zK
        Delete plugin
        :param plugin_key:
        :return:
        rË  rÐ  rr  rÑ  s      r!   Údelete_pluginzConfluence.delete_pluginÀ  s!   € ð " * ¨TÐ2ˆØ�{‰{˜3ÓÐr"   c                 óB   — d}| j                  d|| j                  ¬«      S )Nzrest/plugins/latest/safe-moderØ  )rô   râ   rU   )r­  Úsafe_mode_headersr¹  s     r!   Úcheck_plugin_manager_statusz&Confluence.check_plugin_manager_statusÉ  s"   € Ø-ˆØ�|‰| 5¨s¸D×<RÑ<Rˆ|ÓSÐSr"   c                 óH   — dddœ}d|› d�}d|i}| j                  |||¬«      S )zs
        Update license for plugin
        :param plugin_key:
        :param raw_license:
        :return:
        r�  rÝ  rÞ  z/plugins/1.0/z/licenseÚ
rawLicenserF  r{  )r   rÒ  Úraw_licenserâ  r   r3   s         r!   Úupdate_plugin_licensez Confluence.update_plugin_licenseÍ  s@   € ð ",Ø>ñ
ˆð ˜j˜\¨Ð2ˆØ˜kÐ*ˆØ�x‰x˜ $°ˆxÓ<Ð<r"   c                 óV   — i }|r||d<   |r||d<   |r||d<   | j                  d|¬«      S )aU  
        Get result of long tasks
        :param start: OPTIONAL: The start point of the collection to return. Default: None (0).
        :param limit: OPTIONAL: The limit of the number of pages to return, this may be restricted by
                            fixed system limits. Default: 50
        :param expand:
        :return:
        rc   ra   rb   zrest/api/longtaskrB   r9   )r   ra   rb   rc   r2   s        r!   Úcheck_long_tasks_resultz"Confluence.check_long_tasks_resultÜ  sB   € ð ˆÙØ%ˆF�8ÑÙØ#ˆF�7‰OÙØ#ˆF�7‰OØ�x‰xÐ+°FˆxÓ;Ð;r"   c                 ó´   — d}|rd|i}	 | j                  d|› �|¬«      }|S # t        $ r,}|j                  j                  dk(  rt	        d|¬«      ‚‚ d}~ww xY w)zr
        Get result of long tasks
        :param task_id: task id
        :param expand:
        :return:
        Nrc   zrest/api/longtask/rB   rC   z\There is no task with the given key, or the calling user does not have permission to view itrE   r•   )r   Útask_idrc   r2   r;   rJ   s         r!   Úcheck_long_task_resultz!Confluence.check_long_task_resultî  sx   € ð ˆÙØ Ð'ˆFð
	Ø—x‘xÐ"4°W°IÐ >Àv�xÓNˆHð ˆøô ò 	Ø�z‰z×%Ñ%¨Ò,äØuØôð ð
 ûð	ús   Š" ¢	A«'AÁAc                 ó¾  — 	 d}| j                   }t        j                  d«       | j                  ||d¬«      }|j	                  dd¬«      }|j                  d«      d   j                  d	«      d
   }d|› d�}|råt        j                  d«       | j                  |«      }t        |j                  dd
«      «      }	|j                  d«      }
|
dk(  rt        j                  d«       y|	dk(  rAd}t        j                  d|
› �«       t        j                  d«       |j                  d«      }n/t        j                  |	› d|
› �«       t        j                  d«       |rŒåt        j                  d«       | j                  dd d¬«      }|j	                  dd¬«      }t        j                  d«       |S # t        $ r}t        j                  |«       Y d}~yd}~ww xY w)aü  
        Confluence cloud does not return the PDF document when the PDF
        export is initiated. Instead, it starts a process in the background
        and provides a link to download the PDF once the process completes.
        This functions polls the long-running task page and returns the
        download url of the PDF.
        This method is used in get_space_export() method for space-> PDF export.
        :param url: URL to initiate PDF export
        :return: Download url for PDF file
        Tz)Initiate PDF export from Confluence Cloudr  zutf-8Úignore)ÚencodingÚerrorszname="ajs-taskId" content="rô  z">r   z/services/api/v1/task/z	/progressz#Check if export task has completed.ÚprogressÚstateÚFAILEDzPDF conversion not successful.Néd   FzTask completed - z%Extract task results to download PDF.rö   z% - r   zETask successfully done, querying the task result for the download urlé   r¨  Ústrictz!Successfully got the download url)rÇ  rg   rh   r:   ÚdecodeÚsplitrf   r�   r‘   r©  rª  r�   )r   r   r­  rU   r;   Úresponse_stringró  r¬  r®  Úpercentage_completeÚ
task_stateÚtask_result_urlÚtask_contentr¯  rJ   s                  r!   r€  z4Confluence.get_pdf_download_url_for_confluence_cloud  sµ  € ð 	ØˆLØ×-Ñ-ˆGÜ�H‰HÐ@ÔAØ—x‘x ¨WÈ�xÓMˆHØ&Ÿo™o°wÀx˜oÓPˆOØ%×+Ñ+Ð,IÓJÈ1ÑM×SÑSÐTXÓYÐZ[Ñ\ˆGØ/°¨y¸	ÐBˆHÙÜ—‘Ð>Ô?Ø$(§H¡H¨XÓ$6Ð!Ü&)Ð*;×*?Ñ*?À
ÈAÓ*NÓ&OÐ#Ø.×2Ñ2°7Ó;�
Ø Ò)Ü—I‘IÐ>Ô?ØØ(¨CÒ/Ø#(�LÜ—H‘HÐ0°°Ð=Ô>Ü—I‘IÐEÔFØ&7×&;Ñ&;¸HÓ&E‘Oä—H‘HÐ 3Ð4°D¸¸ÐEÔFÜ—J‘J˜q”Mò ô  �I‰IÐ]Ô^àŸ8™8 O°A°BÐ$7È4˜8ÓPˆLØ'×.Ñ.¸ÈÐ.ÓQˆLÜ�I‰IÐ9Ô:ØÐøÜò 	Ü�I‰I�aŒLÜûð	ús&   ‚C$F4 Ã'A7F4 ÅAF4 Æ4	GÆ=GÇGc                 óv   — d}i }|r||d<   |r||d<   |r||d<   |r||d<   |r||d<   | j                  ||¬«      S )zî
        Fetch a paginated list of AuditRecord instances dating back to a certain time
        :param start_date:
        :param end_date:
        :param start:
        :param limit:
        :param search_string:
        :return:
        zrest/api/auditÚ	startDateÚendDatera   rb   ÚsearchStringrB   r9   )r   Ú
start_dateÚend_datera   rb   Úsearch_stringr   r2   s           r!   ÚauditzConfluence.audit4  s`   € ð" ˆØˆÙØ",ˆF�;ÑÙØ (ˆF�9ÑÙØ#ˆF�7‰OÙØ#ˆF�7‰OÙØ%2ˆF�>Ñ"Ø�x‰x˜ FˆxÓ+Ð+r"   c                 óP   — d}d|i}|�||d<   |�||d<   | j                  ||¬«      S )Nz/api/v2/whiteboardsÚspaceIdr@   ÚparentIdrõ   r$  )r   r  r@   r  r   r3   s         r!   Úcreate_whiteboardzConfluence.create_whiteboardY  sC   € Ø#ˆØ˜7Ð#ˆØÐØ!ˆD�‰MØÐØ'ˆD�ÑØ�y‰y˜ 4ˆyÓ(Ð(r"   c                 ó    — 	 d|z  }| j                  |«      S # t        $ r,}|j                  j                  dk(  rt	        d|¬«      ‚‚ d }~ww xY w©Nz/api/v2/whiteboards/%srC   zRWhiteboard not found. Check confluence instance url and/or if whiteboard id existsrE   rÃ   ©r   Úwhiteboard_idr   rJ   s       r!   Úget_whiteboardzConfluence.get_whiteboardb  sY   € ð
	Ø*¨mÑ<ˆCØ—8‘8˜C“=Ð øÜò 	à�z‰z×%Ñ%¨Ò,Ü#ØhÐqrôð ð ûð	úó   ‚ ˜	A¡'AÁAc                 ó    — 	 d|z  }| j                  |«      S # t        $ r,}|j                  j                  dk(  rt	        d|¬«      ‚‚ d }~ww xY wr  )r6  r   r;   rH   r   r  s       r!   Údelete_whiteboardzConfluence.delete_whiteboardo  sZ   € ð
	Ø*¨mÑ<ˆCØ—;‘;˜sÓ#Ð#øÜò 	à�z‰z×%Ñ%¨Ò,Ü#ØhÐqrôð ð ûð	úr  c                 óZ   — d}i }|r||d<   |r||d<   |r||d<   | j                  ||¬«      S )z–
        Get subscribed calendars
        :param include:
        :param viewing_space_key:
        :param calendar_context:
        :return:
        z0rest/calendar-services/1.0/calendar/subcalendarsÚincludeÚviewingSpaceKeyÚcalendarContextrB   r9   )r   r  Úviewing_space_keyÚcalendar_contextr   r2   s         r!   Ú team_calendars_get_sub_calendarsz+Confluence.team_calendars_get_sub_calendars‚  sK   € ð AˆØˆÙØ 'ˆF�9ÑÙØ(9ˆFÐ$Ñ%ÙØ(8ˆFÐ$Ñ%Ø�x‰x˜ FˆxÓ+Ð+r"   c                 ó>   — d}i }|r||d<   | j                  ||¬«      S )Nz@rest/calendar-services/1.0/calendar/subcalendars/watching/statusr  rB   r9   )r   r  r   r2   s       r!   Ú0team_calendars_get_sub_calendars_watching_statusz;Confluence.team_calendars_get_sub_calendars_watching_status”  s,   € ØPˆØˆÙØ 'ˆF�9ÑØ�x‰x˜ FˆxÓ+Ð+r"   c                 óh   — d}i }|r||d<   |r||d<   |r||d<   |r||d<   | j                  ||¬«      S )z¨
        Get calendar event status
        :param sub_calendar_id:
        :param start:
        :param end:
        :param user_time_zone_id:
        :return:
        z*rest/calendar-services/1.0/calendar/eventsÚsubCalendarIdÚuserTimeZoneIdra   ÚendrB   r9   )r   Úsub_calendar_idra   r&  Úuser_time_zone_idr   r2   s          r!   Úteam_calendar_eventszConfluence.team_calendar_events›  sT   € ð ;ˆØˆÙØ&5ˆF�?Ñ#ÙØ'8ˆFÐ#Ñ$ÙØ#ˆF�7‰OÙØˆF�5‰MØ�x‰x˜ FˆxÓ+Ð+r"   c                 ó.   — d|› �}| j                  |«      S )zQ
        Get mobile paramaters
        :param username:
        :return:
        zrest/mobile/1.0/profile/r9   )r   rl  r   s      r!   Úget_mobile_parametersz Confluence.get_mobile_parameters°  s   € ð )¨¨
Ð3ˆØ�x‰x˜‹}Ðr"   c                 ó4   — d|› d�}| j                  ||¬«      S )zw

        :param user_key:
        :param data: json like {"avatarDataURI":"image in base64"}
        :return:
        úrest/user-profile/1.0/z/avatar/uploadrõ   r$  )r   Úuser_keyr3   r   s       r!   Úavatar_upload_for_userz!Confluence.avatar_upload_for_user¹  s%   € ð ' x j°Ð?ˆØ�y‰y˜ 4ˆyÓ(Ð(r"   c                 ó0   — d|› d�}| j                  |«      S )z3
        :param user_key:
        :return:
        r-  z/avatar/defaultr9   )r   r.  r   s      r!   Úavatar_set_default_for_userz&Confluence.avatar_set_default_for_userÃ  s    € ð
 ' x j°Ð@ˆØ�x‰x˜‹}Ðr"   c                 óJ   — |||dœ}d}dd||gdœ}| j                  ||¬«       y)zY
        That method related to creating user via json rpc for Confluence Server
        )ÚemailÚfullnamerU  rî   rï   ÚaddUser©ró   rô   r2   rõ   Nr$  )r   r3  r4  rl  Úpasswordr2   r   r3   s           r!   Úadd_userzConfluence.add_userË  s<   € ð !¨hÀÑIˆØ1ˆàØØ˜xÐ(ñ
ˆð
 	�	‰	�#˜Dˆ	Õ!r"   c                 óF   — d|i}d}dd||gdœ}| j                  ||¬«       y)zb
        That method related to changing user password via json rpc for Confluence Server
        rU  rî   rï   ÚchangeUserPasswordr6  rõ   Nr$  )r   rl  r7  r2   r   r3   s         r!   Úchange_user_passwordzConfluence.change_user_passwordØ  s:   € ð ˜(Ð#ˆØ1ˆàØ*Ø˜xÐ(ñ
ˆð
 	�	‰	�#˜Dˆ	Õ!r"   c                 ó>   — d}dd||gdœ}| j                  ||¬«       y)zp
        That method related to changing calling user's own password via json rpc for Confluence Server
        rî   rï   ÚchangeMyPasswordr6  rõ   Nr$  )r   ÚoldpassÚnewpassr   r3   s        r!   Úchange_my_passwordzConfluence.change_my_passwordå  s0   € ð 2ˆàØ(Ø Ð(ñ
ˆð
 	�	‰	�#˜Dˆ	Õ!r"   c                 ó4   — d|› d|› �}| j                  |«      S )zÖ
        Add given user to a group

        :param username: str - username of user to add to group
        :param group_name: str - name of group to add user to
        :return: Current state of the group
        úrest/api/user/ú/group/r{  ©r   rl  rR  r   s       r!   Úadd_user_to_groupzConfluence.add_user_to_groupñ  s$   € ð ˜x˜j¨°
¨|Ð<ˆØ�x‰x˜‹}Ðr"   c                 ó4   — d|› d|› �}| j                  |«      S )a�  
        Remove the given {@link User} identified by username from the given {@link Group} identified by groupName.
        This method is idempotent i.e. if the membership is not present then no action will be taken.

        :param username: str - username of user to add to group
        :param group_name: str - name of group to add user to
        :return: Current state of the group
        rB  rC  rr  rD  s       r!   Úremove_user_from_groupz!Confluence.remove_user_from_groupü  s%   € ð ˜x˜j¨°
¨|Ð<ˆØ�{‰{˜3ÓÐr"   c                 ó0   — d|› d�}| j                  |«      S )z�
        Returns list of permissions granted to users and groups in the particular space.
        :param space_key:
        :return:
        rz  ú/permissionsr9   r|  s      r!   Úget_all_space_permissionsz$Confluence.get_all_space_permissions	  s    € ð   	˜{¨,Ð7ˆØ�x‰x˜‹}Ðr"   c                 ó   — d|› d�}g }|r|j                  ||xs g dœ«       |r|j                  ||xs g dœ«       |s|s|j                  d|xs g i«       t        j                  |«      }| j                  ||¬«      S )aÚ  
        Sets permissions to multiple users/groups in the given space.
        Request should contain all permissions that user/group/anonymous user will have in a given space.
        If permission is absent in the request, but was granted before, it will be revoked.
        If empty list of permissions passed to user/group/anonymous user,
        then all their existing permissions will be revoked.
        If user/group/anonymous user not mentioned in the request, their permissions will not be revoked.

        Maximum 40 different users/groups/anonymous user could be passed in the request.
        :param space_key:
        :param user_key:
        :param group_name:
        :param operations:
        :return:
        rz  rI  )ÚuserKeyÚ
operations)r  rM  rM  rõ   )r  rT   r¡   rX   )r   rP  r.  rR  rM  r   r2   Úpayload_jsons           r!   Ú+set_permissions_to_multiple_items_for_spacez6Confluence.set_permissions_to_multiple_items_for_space  s†   € ð    	˜{¨,Ð7ˆØˆáØ�M‰M h¸jÒ>NÈBÑOÔPáØ�M‰M¨
À*ÒBRÐPRÑSÔTá¡
Ø�M‰M˜<¨Ò)9°rÐ:Ô;Ü—z‘z &Ó)ˆØ�y‰y˜ <ˆyÓ0Ð0r"   c                 ó0   — d|› d�}| j                  |«      S )zz
        Get permissions granted to anonymous user for the given space
        :param space_key:
        :return:
        rz  ú/permissions/anonymousr9   r|  s      r!   Ú.get_permissions_granted_to_anonymous_for_spacez9Confluence.get_permissions_granted_to_anonymous_for_space0  s!   € ð   	˜{Ð*@ÐAˆØ�x‰x˜‹}Ðr"   c                 óD   — d|› d�}d|xs g i}| j                  ||¬«      S )a­  
        Grant permissions to anonymous user in the given space. Operation doesn't override existing permissions,
        will only add those one that weren't granted before. Multiple permissions could be passed in one request.
        Supported targetType and operationKey pairs:

        space read
        space administer
        space export
        space restrict
        space delete_own
        space delete_mail
        page create
        page delete
        blogpost create
        blogpost delete
        comment create
        comment delete
        attachment create
        attachment delete
        :param space_key:
        :param operations:
        :return:
        rz  rQ  rM  rõ   r{  ©r   rP  rM  r   r3   s        r!   Ú&set_permissions_to_anonymous_for_spacez1Confluence.set_permissions_to_anonymous_for_space9  s5   € ð0   	˜{Ð*@ÐAˆØ˜jÒ.¨BÐ/ˆØ�x‰x˜ $ˆxÓ'Ð'r"   c                 óD   — d|› d�}d|xs g i}| j                  ||¬«      S )aÇ  
        Revoke permissions from anonymous user in the given space.
        If anonymous user doesn't have permissions that we are trying to revoke,
        those permissions will be silently skipped. Multiple permissions could be passed in one request.
        Supported targetType and operationKey pairs:

        space read
        space administer
        space export
        space restrict
        space delete_own
        space delete_mail
        page create
        page delete
        blogpost create
        blogpost delete
        comment create
        comment delete
        attachment create
        attachment delete
        :param space_key:
        :param operations:
        :return:
        rz  z/permissions/anonymous/revokerM  rõ   r{  rT  s        r!   Ú+remove_permissions_from_anonymous_for_spacez6Confluence.remove_permissions_from_anonymous_for_spaceU  s5   € ð2   	˜{Ð*GÐHˆØ˜jÒ.¨BÐ/ˆØ�x‰x˜ $ˆxÓ'Ð'r"   c                 ó4   — d|› d|› �}| j                  |«      S )zŒ
        Get permissions granted to group for the given space
        :param space_key:
        :param group_name:
        :return:
        rz  ú/permissions/group/r9   )r   rP  rR  r   s       r!   Ú*get_permissions_granted_to_group_for_spacez5Confluence.get_permissions_granted_to_group_for_spacer  s%   € ð   	˜{Ð*=¸j¸\ÐJˆØ�x‰x˜‹}Ðr"   c                 óH   — d|› d|› �}d|xs g i}| j                  ||¬«      S )a¿  
        Grant permissions to group in the given space.
        Operation doesn't override existing permissions, will only add those one that weren't granted before.
        Multiple permissions could be passed in one request. Supported targetType and operationKey pairs:

        space read
        space administer
        space export
        space restrict
        space delete_own
        space delete_mail
        page create
        page delete
        blogpost create
        blogpost delete
        comment create
        comment delete
        attachment create
        attachment delete
        :param space_key:
        :param group_name:
        :param operations:
        :return:
        rz  rY  rM  rõ   r{  ©r   rP  rR  rM  r   r3   s         r!   Ú"set_permissions_to_group_for_spacez-Confluence.set_permissions_to_group_for_space|  s9   € ð2   	˜{Ð*=¸j¸\ÐJˆØ˜jÒ.¨BÐ/ˆØ�x‰x˜ $ˆxÓ'Ð'r"   c                 óJ   — d|› d|› d�}d|xs g i}| j                  ||¬«      S )aÒ  
        Revoke permissions from a group in the given space.
        If group doesn't have permissions that we are trying to revoke,
        those permissions will be silently skipped. Multiple permissions could be passed in one request.
        Supported targetType and operationKey pairs:

        space read
        space administer
        space export
        space restrict
        space delete_own
        space delete_mail
        page create
        page delete
        blogpost create
        blogpost delete
        comment create
        comment delete
        attachment create
        attachment delete
        :param space_key:
        :param group_name:
        :param operations:
        :return:
        rz  rY  ú/revokerM  rõ   r{  r\  s         r!   Ú'remove_permissions_from_group_for_spacez2Confluence.remove_permissions_from_group_for_space™  s;   € ð4   	˜{Ð*=¸j¸\ÈÐQˆØ˜jÒ.¨BÐ/ˆØ�x‰x˜ $ˆxÓ'Ð'r"   c                 ó4   — d|› d|› �}| j                  |«      S )z‰
        Get permissions granted to user for the given space
        :param space_key:
        :param user_key:
        :return:
        rz  ú/permissions/user/r9   )r   rP  r.  r   s       r!   Ú)get_permissions_granted_to_user_for_spacez4Confluence.get_permissions_granted_to_user_for_space·  s%   € ð   	˜{Ð*<¸X¸JÐGˆØ�x‰x˜‹}Ðr"   c                 óH   — d|› d|› �}d|xs g i}| j                  ||¬«      S )a¼  
        Grant permissions to user in the given space.
        Operation doesn't override existing permissions, will only add those one that weren't granted before.
        Multiple permissions could be passed in one request. Supported targetType and operationKey pairs:

        space read
        space administer
        space export
        space restrict
        space delete_own
        space delete_mail
        page create
        page delete
        blogpost create
        blogpost delete
        comment create
        comment delete
        attachment create
        attachment delete
        :param space_key:
        :param user_key:
        :param operations:
        :return:
        rz  rb  rM  rõ   r{  ©r   rP  r.  rM  r   r3   s         r!   Ú!set_permissions_to_user_for_spacez,Confluence.set_permissions_to_user_for_spaceÁ  s9   € ð2   	˜{Ð*<¸X¸JÐGˆØ˜jÒ.¨BÐ/ˆØ�x‰x˜ $ˆxÓ'Ð'r"   c                 óJ   — d|› d|› d�}d|xs g i}| j                  ||¬«      S )aÎ  
        Revoke permissions from a user in the given space.
        If user doesn't have permissions that we are trying to revoke,
        those permissions will be silently skipped. Multiple permissions could be passed in one request.
        Supported targetType and operationKey pairs:

        space read
        space administer
        space export
        space restrict
        space delete_own
        space delete_mail
        page create
        page delete
        blogpost create
        blogpost delete
        comment create
        comment delete
        attachment create
        attachment delete
        :param space_key:
        :param user_key:
        :param operations:
        :return:
        rz  rb  r_  rM  rB   r{  re  s         r!   Ú&remove_permissions_from_user_for_spacez1Confluence.remove_permissions_from_user_for_spaceÞ  s;   € ð4   	˜{Ð*<¸X¸JÀgÐNˆØ˜jÒ.¨BÐ/ˆØ�x‰x˜ DˆxÓ)Ð)r"   c                 ób   — d|› d�}||dœ||dœi dœ}| j                  ||| j                  ¬«      S )aÌ  
        Add permissions to a space

        :param space_key: str - key of space to add permissions to
        :param subject_type: str - type of subject to add permissions for
        :param subject_id: str - id of subject to add permissions for
        :param operation_key: str - key of operation to add permissions for
        :param operation_target: str - target of operation to add permissions for
        :return: Current permissions of space
        rz  z/permission)rA   Ú
identifier)rŠ   Útarget)ÚsubjectÚ	operationr7   rF  )rX   Úexperimental_headers)r   rP  Úsubject_typeÚ
subject_idÚoperation_keyÚoperation_targetr   r3   s           r!   Úadd_space_permissionsz Confluence.add_space_permissionsü  sJ   € ð$   	˜{¨+Ð6ˆà ,¸JÑGØ!.Ð:JÑKØñ
ˆð �y‰y˜ 4°×1JÑ1JˆyÓKÐKr"   c                 ó    — | j                   dk(  s| j                  ri S d}ddd|||gdœ}| j                  ||¬«      j                  d«      xs i S )	rí   r   rî   rï   ÚaddPermissionToSpacerñ   rò   rõ   rö   r÷   ©r   rP  r  Ú
permissionr   r3   s         r!   Úadd_space_permission_json_rpcz(Confluence.add_space_permission_json_rpc  sa   € ð ×Ñ˜wÒ&¨$¯*ª*ØˆIØ1ˆàØ,ØØ! 4¨Ð3ñ	
ˆð �y‰y˜ 4ˆyÓ(×,Ñ,¨XÓ6Ò<¸"Ð<r"   c                 ó    — | j                   dk(  s| j                  ri S d}ddd|||gdœ}| j                  ||¬«      j                  d«      xs i S )	rí   r   rî   rï   ÚremovePermissionFromSpacerñ   rò   rõ   rö   r÷   rv  s         r!   Úremove_space_permissionz"Confluence.remove_space_permission)  sa   € ð ×Ñ˜wÒ&¨$¯*ª*ØˆIØ1ˆàØ1ØØ! 4¨Ð3ñ	
ˆð �y‰y˜ 4ˆyÓ(×,Ñ,¨XÓ6Ò<¸"Ð<r"   c                 ó¾   — | j                   dk(  s| j                  r| j                  |d¬«      S d}ddd|gdœ}| j                  ||¬	«      j	                  d
«      xs i S )rí   r   r�  r‘  rî   rï   ÚgetSpacePermissionSetsé   rò   rõ   rö   )rø   r   r]  rX   r:   )r   rP  r   r3   s       r!   Úget_space_permissionsz Confluence.get_space_permissions;  sj   € ð ×Ñ˜wÒ&¨$¯*ª*Ø—>‘>¨I¸m�>ÓLÐLØ1ˆàØ.ØØ �kñ	
ˆð �y‰y˜ 4ˆyÓ(×,Ñ,¨XÓ6Ò<¸"Ð<r"   c                 ó  — t        «       }|j                  |«       | j                  |«      }|D ]D  }| j                  |j	                  d«      «      }|sŒ&|j                  |D �cg c]  }|‘Œ c}«       ŒF t        |«      S c c}w )za
        Get subtree of page ids
        :param page_id:
        :return: Set of page ID
        rr   )Úlistr  ri   Úget_subtree_of_content_idsr:   rª   Úset)r   r[   Úoutputr:  rM   Úchild_subtreeÚps          r!   r‚  z%Confluence.get_subtree_of_content_idsM  sy   € ô “ˆØ�‰�gÔØ×4Ñ4°WÓ=ˆØ"ò 	:ˆDØ ×;Ñ;¸D¿H¹HÀT»NÓKˆMÚØ—‘¨-Ö8 QšqÒ8Õ9ð	:ô �6‹{Ðùò 9s   Á$	B
c                 óD   — d|› d|› d�}|ddœ}| j                  ||¬«      S )zg
        Set inline task element value
        status is CHECKED or UNCHECKED
        :return:
        zrest/inlinetasks/1/task/r•  Ú	VIEW_PAGE)r“   ÚtriggerrZ  r$  )r   r[   ró  r“   r   r3   s         r!   Úset_inline_tasks_checkboxz$Confluence.set_inline_tasks_checkbox\  s5   € ð )¨¨	°°7°)¸1Ð=ˆØ ¨[Ñ9ˆØ�y‰y˜ 4ˆyÓ(Ð(r"   c                 ó4   — d}d|i}| j                  ||¬«      S )zy
        Get linked Jira ticket metadata
        PRIVATE method
        :param page_id: Page Id
        :return:
        zrest/jira-metadata/1.0/metadatarJ  rB   r9   ©r   r[   r   r2   s       r!   Úget_jira_metadatazConfluence.get_jira_metadataf  s&   € ð 0ˆØ˜GÐ$ˆØ�x‰x˜ FˆxÓ+Ð+r"   c                 ó4   — d}d|i}| j                  ||¬«      S )z„
        Get linked Jira ticket aggregated metadata
        PRIVATE method
        :param page_id: Page Id
        :return:
        z)rest/jira-metadata/1.0/metadata/aggregaterJ  rB   r9   rŒ  s       r!   Úget_jira_metadata_aggregatedz'Confluence.get_jira_metadata_aggregatedq  s&   € ð :ˆØ˜GÐ$ˆØ�x‰x˜ FˆxÓ+Ð+r"   c                 ó4   — d}d|i}| j                  ||¬«      S )zŒ
        Clean cache for linked Jira app link
        PRIVATE method
        :param global_id: ID of Jira app link
        :return:
        z%rest/jira-metadata/1.0/metadata/cacheÚglobalIdrB   rr  )r   Ú	global_idr   r2   s       r!   Úclean_jira_metadata_cachez$Confluence.clean_jira_metadata_cache|  s&   € ð 6ˆØ˜iÐ(ˆØ�{‰{˜3 vˆ{Ó.Ð.r"   c                 ód   — | j                   rt        S d}| j                  || j                  ¬«      S )z†
        Get collaborative editing configuration
        Related to the on-prem setup Confluence Data Center
        :return:
        z$rest/synchrony-interop/configurationrA  ©r   r
   r:   rO  r¹  s     r!   Ú'collaborative_editing_get_configurationz2Confluence.collaborative_editing_get_configurationˆ  s/   € ð �:Š:Ü#Ð#Ø4ˆØ�x‰x˜ T×%:Ñ%:ˆxÓ;Ð;r"   c                 ód   — | j                   rt        S d}| j                  || j                  ¬«      S )ú|
        Disable collaborative editing
        Related to the on-prem setup Confluence Data Center
        :return:
        rÄ  rA  ©r   r
   rX   rO  r¹  s     r!   Úcollaborative_editing_disablez(Confluence.collaborative_editing_disable“  ó/   € ð �:Š:Ü#Ð#Ø.ˆØ�y‰y˜ d×&;Ñ&;ˆyÓ<Ð<r"   c                 ód   — | j                   rt        S d}| j                  || j                  ¬«      S )r˜  rÀ  rA  r™  r¹  s     r!   Úcollaborative_editing_enablez'Confluence.collaborative_editing_enablež  s/   € ð �:Š:Ü#Ð#Ø-ˆØ�y‰y˜ d×&;Ñ&;ˆyÓ<Ð<r"   c                 ód   — | j                   rt        S d}| j                  || j                  ¬«      S )r˜  zrest/synchrony-interop/restartrA  r™  r¹  s     r!   Úcollaborative_editing_restartz(Confluence.collaborative_editing_restart©  r›  r"   c                 ód   — | j                   rt        S d}| j                  || j                  ¬«      S )zô
        Status of collaborative editing
        Related to the on-prem setup Confluence Data Center
        :return: false or true parameter in json
                {
                     "sharedDraftsEnabled": false
                }
        zrest/synchrony-interop/statusrA  r•  r¹  s     r!   Ú)collaborative_editing_shared_draft_statusz4Confluence.collaborative_editing_shared_draft_status´  s/   € ð �:Š:Ü#Ð#Ø-ˆØ�x‰x˜ T×%:Ñ%:ˆxÓ;Ð;r"   c                 ód   — | j                   rt        S d}| j                  || j                  ¬«      S )zã
        Status of collaborative editing
        Related to the on-prem setup Confluence Data Center
        :return: stopped or running parameter in json
            {
                "status": "stopped"
            }
        z'rest/synchrony-interop/synchrony-statusrA  r•  r¹  s     r!   Ú&collaborative_editing_synchrony_statusz1Confluence.collaborative_editing_synchrony_statusÂ  s/   € ð �:Š:Ü#Ð#Ø7ˆØ�x‰x˜ T×%:Ñ%:ˆxÓ;Ð;r"   c                 ód   — | j                   rt        S d}| j                  || j                  ¬«      S )ú~
        Status of collaborative editing
        Related to the on-prem setup Confluence Data Center
        :return:
        z rest/synchrony/1.0/config/statusrA  r•  r¹  s     r!   Úsynchrony_get_configurationz&Confluence.synchrony_get_configurationÐ  s/   € ð �:Š:Ü#Ð#Ø0ˆØ�x‰x˜ T×%:Ñ%:ˆxÓ;Ð;r"   c                 óT   — | j                   rt        S d|› d�}| j                  |«      S )r¥  zrest/synchrony/1.0/content/z/changes/unpublished)r   r
   r6  )r   r[   r   s      r!   Úsynchrony_remove_draftz!Confluence.synchrony_remove_draftÛ  s/   € ð �:Š:Ü#Ð#Ø+¨G¨9Ð4HÐIˆØ�{‰{˜3ÓÐr"   c                 ó(   — d}| j                  |«      S )z:
        Returns the license detailed information
        z rest/license/1.0/license/detailsr9   r¹  s     r!   Úget_license_detailszConfluence.get_license_detailsæ  s   € ð 1ˆØ�x‰x˜‹}Ðr"   c                 ó(   — d}| j                  |«      S )z=
        Returns the total used seats in the license
        z"rest/license/1.0/license/userCountr9   r¹  s     r!   Úget_license_user_countz!Confluence.get_license_user_countí  s   € ð 3ˆØ�x‰x˜‹}Ðr"   c                 ó(   — d}| j                  |«      S )z?
        Returns the available license seats remaining
        z'rest/license/1.0/license/remainingSeatsr9   r¹  s     r!   Úget_license_remainingz Confluence.get_license_remainingô  s   € ð 8ˆØ�x‰x˜‹}Ðr"   c                 ó(   — d}| j                  |«      S )z/
        Returns the license max users
        z!rest/license/1.0/license/maxUsersr9   r¹  s     r!   Úget_license_max_usersz Confluence.get_license_max_usersû  s   € ð 2ˆØ�x‰x˜‹}Ðr"   c                 ód  — |j                   dk(  r+|j                  j                  d«      dk7  rt        d|¬«      ‚d|j                   cxk  rdk  r&n y		 |j	                  «       }|d   }t        ||¬«      ‚y	# t
        $ r/}t        j                  |«       |j                  «        Y d	}~y	d	}~ww xY w)
z©
        Checks the response for an error status and raises an exception with the error message provided by the server
        :param response:
        :return:
        rÚ   rß  zapplication/json;charset=UTF-8rÛ   rÜ   rÁ   iX  r]   N)	rH   rU   r:   r   rT   rY   rg   r�   Úraise_for_status)r   r;   ÚjÚ	error_msgrJ   s        r!   r²  zConfluence.raise_for_status  s¥   € ð ×Ñ 3Ò&¨8×+;Ñ+;×+?Ñ+?ÀÓ+OÐSsÒ+sÜÐ0¸8ÔDÐDà�(×&Ñ&Ô,¨Õ,ð>Ø—M‘M“O�Ø˜i™L�	ô
   	°HÔ=Ð=ð -øô ò ,Ü—	‘	˜!”Ø×)Ñ)×+Ñ+ûð,ús   ÁA7 Á7	B/Â %B*Â*B/)NNNNFræ  )rM   NNN)rM   NN)rM   )r   rW   N)r   rô  NrM   )NNN)NNr   é   NN)r0  N)r   rU  N)r   rU  NNrM   )r   rU  Nzhistory,space,versionrM   )r   éô  r*  rM   )r   r¶  r0  )éú   NNNN)NF)NrM   r(   NFr†  )NNr  )rM   NNNN)r   NN)Nr   NN)r   rU  NNN)NNrü  )rœ  NNNN)NNNNNN)Nr   rU  NF)rW   r   )rM   r(   FNF)NNrM   r(   FNFF)NrM   r(   FNF)NrM   r(   F)r(   FNNF)zcom.gliffy.cache.gon)r   éè  )úconfluence-usersr   r¸  N)r¹  N)zdescription.plain,homepageN)r”  r   r¶  Nr—   )r   NNNN)NNNNN)NN)»Ú__name__Ú
__module__Ú__qualname__r¡  r   Ústaticmethodr/   r<   rK   r_   ri   ro   rt   rw   rz   rƒ   r‡   r‹   r�   ry   r€   r¦   r°   r´   r»   r½   rÅ   rÉ   rÍ   rÏ   rÒ   rÔ   rÖ   ræ   r   rê   rè   rù   rþ   rG   r   r
  r  r!  r(  r.  r1  r7  r-  rH  rS  r^  rb  rf  ri  rl  rn  rp  rs  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   r"  r%  r'  r/  r2  r6  r:  r<  r>  rC  rH  rK  rM  rO  rS  rZ  r]  r_  rb  re  rg  ri  ro  rt  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/  r1  r8  r;  r@  rE  rG  rJ  rO  rR  rU  rW  rZ  r]  r`  rc  rf  rh  rs  rx  r{  r  r‚  rŠ  r�  r�  r“  r–  rš  r�  rŸ  r¡  r£  r¦  r¨  rª  r¬  r®  r°  r²  Ú__classcell__)r    s   @r!   r   r   &   sd  ø„ àØØØØ!Ø$Ø*Øñ	€Mô?ð ñSó ðSð  ØØØØó5ónòBQó$&óP óòIóQò!ò$òlóJó,ó\%òN'*òRó4"ðN ØØØØØó-ó^Ró'ðD ØØØØó3ðp ØØØØó*ð^ ØØØ&Øó'óReóJó'ðD ØØØØóAñF ˜Ð(PÔQñLó RðLòò=ò=ð$Àð ÐW^Ð_mÑWnó ð ¸ð ÐPWÐXfÑPgó ð
A°Sð AÀ3ð AÐZaÐbpÑZqó AðF!¸#ð !Èó !òFCòAòó4#ðT ØØ ØØØó9ð~ ØØóLð> ØØØØó:9ñx ˜Ð(DÔEñó Fðò*ñ4 ˜Ð(GÔHò-ó Ið-óB"-ñH ˜Ð(EÔFò -ó Gð -óD"-òH?ð& ØØØØó,ò>ó,ò" òð: *ØØØØóOðh ØØØØØó.ó`XDót
ò" òYó4Cð& ØØØØó-ò^ð2¨ð °Só ò<ò"(òòò=òòSò ó&ðZ Ø ØØØó
ð6 ØØØ ØØØØóUðx ØØ ØØØóFðZ ØØ Øó!
ðP ØØ Øó!
ðP !ØØØØó6òpLòIòò@'òRò.ò0ò.)ò*Uó
`ó'ò.	)òó2'ó2ó6ð8 ØØØØó-ò^Lò/òó.ó*ó>ó>ðD ØØØ $Øó.ò`Fò"Fðaf¨#ð af¸Cð afÀCó afòF-òò4òòò/ò/ò/òò$KòKòKòJò =ò=ò òTò=ó<ó$ò2+ð^ ØØØØó,ð>ó)òòðó,ó$,ó,ò*ò)òò"ò"ò
"ò	ò
 òó1ò<ó(ó8(ò:ó(ó:(ò<ó(ó:*ò<Lò6=ò$=ò$=ò$ò)ò	,ò	,ò	/ò	<ò	=ò	=ò	=ò<ò<ò	<ò	 òòòòö>r"   r   )#r°  rT   Úloggingrž  r¨   r©  r´  Útypingr   r»  Úbs4r   r   r   Ú	atlassianr   Úatlassian.errorsr   r	   r
   r   r   r   r   r   Úatlassian.rest_clientr   ÚsysÚversion_infor   Útyping_extensionsÚ	getLoggerrº  rg   r   r  r"   r!   ú<module>rÉ     sx   ðã 	Û Û Û 	Û 	Û Û Ý ã Ý Ý !Ý å ÷	÷ 	ó 	õ 3Û 
à×Ñ�vÒÞå)à€g×Ñ˜Ó!€ôm?>Ð!õ m?>r"   