a Of>@sLddlmZmZddlmZddlmZddZddZdd Zd d Z d S) )dnsobject_storage)retry)Responsec Os@d}g}d}d}d} t} t|||dg|Ri|D]} | }t|jtjjs^t|jtjjrzd}|jj}| |jj q6t|jt jj rd} | |jj |jjr| |jjq6t|jtr| |jn | |jj q6|rt|j|j||d|j} n@| r(t|j|jt jj |t| d|j} nt|j|j||j} | S)ag Calls a list operation and automatically fetches more data from the service (automatically following pagination tokens) until the desired number of records is reached (or there are no more records left, if the total number of records is less than the desired number of records). Apart from the formally listed parameters for this function, any additional positional (``*list_func_args``) and keyword (``**list_func_kwargs``) arguments will be passed to the list operation. Results are eagerly loaded and the response returned by this function will contain all the data up to the desired number of records (or there are no more records left, whichever is first). If you wish to lazy load results, then use the version of this method which produces a generator: :py:func:`~oci.pagination.list_call_get_up_to_limit_generator` :param function list_func_ref: A reference to the list operation which we will call :param int record_limit: The maximum number of records to fetch. We may fetch less records than this if the total number of records is less than this value. If a record_limit is not provided then we will only fetch a single page of data :param int page_size: The number of records to retrieve per list operation call :return: A :class:`~oci.response.Response` whose data attribute contains all the records we retrieved. The other attributes of the :class:`~oci.response.Response` object will be sourced from the last response we received from calling the list operation on the service. :rtype: :class:`~oci.response.Response` NFresponseTitemsobjectsprefixes)set#list_call_get_up_to_limit_generator isinstancedatarmodelsRecordCollectionRRSet __class__extendrr ListObjectsr r updatelistrstatusheadersrequest) list_func_ref record_limit page_sizelist_func_argslist_func_kwargs call_resultaggregated_resultsis_dns_record_collectiondns_record_collection_classis_list_objects_responselist_objects_prefixesrfinal_responser'/sparta/input/_build_configuration/image_build+validate/lib/bmcenv/lib64/python3.9/site-packages/oci/pagination/pagination_utils.pylist_call_get_up_to_limit sN    r)c os\|s|std|dur||d<tjj|g|Ri|}|dkrJ|Vn^g}t|jtjjsnt|jtjj rx|jj }n t|jt jj r|jj }n|j}|D] }|VqdSd} |} d} | rX| dkrXt|| |d<tjj|g|Ri|} |dkr| Vn|g}t| jtjjs*t| jtjj r4| jj }n8t| jt jj rP| jj }nt| jtrd| jn| jj }|D] }|Vqpt| jtjjst| jtjj r| t| jj 8} nLt| jt jj r| t| jj 8} n(| t| jtrt| jn t| jj 8} t| jt jj r:| jjdur,| jj|d<| jjdu} q| jdurP| j|d<| j} qdS) a Calls a list operation and automatically fetches more data from the service (automatically following pagination tokens) until the desired number of records is reached (or there are no more records left, if the total number of records is less than the desired number of records). Apart from the formally listed parameters for this function, any additional positional (``*list_func_args``) and keyword (``**list_func_kwargs``) arguments will be passed to the list operation. This function produces a generator and lazily loads results. That is, service calls will only be made to fetch more data when needed as we iterate through results produced by the generator; this contrasts with the eagarily loaded :py:func:`~oci.pagination.list_call_get_up_to_limit` function, which makes all the required service calls when it is called. The generator also supports vending two types of objects - either the raw responses received from calling the list operation, or the individual model objects which are contained within the response's ``data`` attribute (which should be a list of model objects). :param function list_func_ref: A reference to the list operation which we will call :param int record_limit: The maximum number of records to fetch. We may fetch less records than this if the total number of records is less than this value. If a record_limit is not provided then we will only fetch a single page of data :param int page_size: The number of records to retrieve per list operation call :param str yield_mode: Either ``response`` or ``record``. This will control whether the generator returned by this function yields either :class:`~oci.response.Response` objects (if the value is ``response``), or whether it yields the individual model objects which are contained within the response's ``data`` attribute (which should be a list of model objects) :return: A generator that, depending on the ``yield_mode``, will yield either :class:`~oci.response.Response` objects or the individual model objects which are contained within the response's ``data`` attribute (which should be a list of model objects) z>You must provide one, or both, of a record_limit and page_sizeNlimitrTstartpage) ValueErrorrDEFAULT_RETRY_STRATEGYmake_retrying_callrrrrrrrrrr minrlennext_start_with next_page has_next_page) rrr yield_moderrsingle_call_resultitems_to_yielditemkeep_paginatingremaining_items_to_fetchr r'r'r(r PsX$    $   $(   r c Os<g}d}d}d}d}t}t|dg|Ri|D]} | }t|jtjjsZt|jtjjrvd}|jj}| |jj q2t|jt jj rd}| |jj |jjr||jjq2t|jtr| |jn | |jj q2|rt|j|j||d|j} n@|r$t|j|jt jj |t|d|j} nt|j|j||j} | S)a< Calls a list operation and automatically fetches more data from the service (automatically following pagination tokens) until the no more records are available. Apart from the formally listed parameters for this function, any additional positional (``*list_func_args``) and keyword (``**list_func_kwargs``) arguments will be passed to the list operation. Results are eagerly loaded and the response returned by this function will contain all the available data. If you wish to lazy load results, then use the version of this method which produces a generator: :py:func:`~oci.pagination.list_call_get_all_results_generator` :param function list_func_ref: A reference to the list operation which we will call :return: A :class:`~oci.response.Response` whose data attribute contains all the records we retrieved. The other attributes of the :class:`~oci.response.Response` object will be sourced from the last response we received from calling the list operation on the service. :rtype: :class:`~oci.response.Response` NFrTrr )r #list_call_get_all_results_generatorrrrrrrrrrrrr r rrrrrr) rrrr!r r"r#r$r%rr&r'r'r(list_call_get_all_resultssN   r=cosd}d}|rtjj|g|Ri|}|dkr6|Vnrg}t|jtjjsZt|jtjjrd|jj }n4t|jt jj r~|jj }nt|jt r|jn|jj }|D] }|Vqt|jt jj r|jjdur|jj|d<|jjdu}q|jdur|j|d<|j}qdS)a Calls a list operation and automatically fetches more data from the service (automatically following pagination tokens) until the no more records are available. Apart from the formally listed parameters for this function, any additional positional (``*list_func_args``) and keyword (``**list_func_kwargs``) arguments will be passed to the list operation. This function produces a generator and lazily loads results. That is, service calls will only be made to fetch more data when needed as we iterate through results produced by the generator; this contrasts with the eagarily loaded :py:func:`~oci.pagination.list_call_get_all_results` function, which makes all the required service calls when it is called. The generator also supports vending two types of objects - either the raw responses received from calling the list operation, or the individual model objects which are contained within the response's ``data`` attribute (which should be a list of model objects). :param function list_func_ref: A reference to the list operation which we will call :param str yield_mode: Either ``response`` or ``record``. This will control whether the generator returned by this function yields either :class:`~oci.response.Response` objects (if the value is ``response``), or whether it yields the individual model objects which are contained within the response's ``data`` attribute (which should be a list of model objects) :return: A generator that, depending on the ``yield_mode``, will yield either :class:`~oci.response.Response` objects or the individual model objects which are contained within the response's ``data`` attribute (which should be a list of model objects) TNrr,r-)rr/r0rrrrrrrrrr rr3r4r5)rr6rrr:r r8r9r'r'r(r<s*       r<N) rrrrrr)r r=r<r'r'r'r(s   Fd>