B ¨#a»ã@sÐddlZyddlmZeZWn ek r<ddlmZYnXddlmZm Z m Z m Z m Z m Z ddlmZddlmZe r’ddlmZddlmZejd krªdd lmZnGd d „d eƒZGd d„deeƒZdS)éN)ÚIterator)ÚDictÚAnyÚListÚCallableÚOptionalÚ TYPE_CHECKINGé)Ú Deserializer)ÚClientRawResponse)ÚClientResponse)ÚModel)ééé)ÚAsyncPagedMixinc@s eZdZdS)rN)Ú__name__Ú __module__Ú __qualname__©rrú4/tmp/pip-target-jgxl_w8r/lib/python/msrest/paging.pyr.srcsneZdZdZiZiZd‡fdd„ Zdd„Zedd„ƒZ e d d „ƒZ d d „Z d d„Z dd„Zdd„ZeZ‡ZS)ÚPagedaTA container for paged REST responses. :param ClientResponse response: server response object. :param callable command: Function to retrieve the next page of items. :param dict classes: A dictionary of class dependencies for deserialization. :param dict raw_headers: A dict of raw headers to add if "raw" is called Nc sFtt|ƒjf|Žd|_d|_| ¡t|ƒ|_||_d|_ ||_ dS)NÚr) ÚsuperrÚ__init__Ú next_linkÚ_current_page_iter_indexÚresetr Ú_derserializerÚ _get_nextÚ _responseÚ _raw_headers)ÚselfÚcommandÚclassesZ raw_headersÚkwargs)Ú __class__rrr=s zPaged.__init__cCs|S)zReturn 'self'.r)r"rrrÚ__iter__IszPaged.__iter__cCsiS)z8Required for parity to Model object for deserialization.r)ÚclsrrrÚ_get_subtype_mapOszPaged._get_subtype_mapcCs$t|j|jƒ}|jr | |j¡|S)zRGet current page as ClientRawResponse. :rtype: ClientRawResponse )r Ú current_pager r!Ú add_headers)r"Úrawrrrr,Ts z Paged.rawcCs| ¡||_| ¡S)zÂGet an arbitrary page. This resets the iterator and then fully consumes it to return the specific page **only**. :param str url: URL to arbitrary page results. )rrÚ advance_page)r"ÚurlrrrÚget`s z Paged.getcCsd|_g|_d|_dS)zReset iterator to first page.rrN)rr*r)r"rrrrmsz Paged.resetcCs:|jdkrtdƒ‚d|_| |j¡|_| ||j¡|jS)zòForce moving the cursor to the next azure call. This method is for advanced usage, iterator protocol is prefered. :raises: StopIteration if no further page :return: The current page list :rtype: list Nz End of pagingr)rÚ StopIterationrrr rr*)r"rrrr-ts zPaged.advance_pagecCsH|jr4|jt|jƒkr4|j|j}|jd7_|S| ¡| ¡SdS)zIterate through responses.r N)r*rÚlenr-Ú__next__)r"Úresponserrrr2…s  zPaged.__next__)N)rrrÚ__doc__Z _validationZ_attribute_maprr'Ú classmethodr)Úpropertyr,r/rr-r2ÚnextÚ __classcell__rr)r&rr1s     r)ÚsysÚcollections.abcrÚrangeÚxrangeÚ ImportErrorÚ collectionsÚtypingrrrrrrZ serializationr Zpipeliner Zuniversal_httpr r Ú version_infoZ async_pagingrÚobjectrrrrrÚs