
    "                         S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  SSKJr  SSKJr  SSKJr  SS	KJr  SS
KJr  S rS rS rS rS rg)zFThis file provides the implementation of the `functions list` command.    )absolute_import)division)unicode_literals)
exceptions)
list_pager)util)log)
properties)	resourcesc                     U R                   (       a2  [        R                  " SSR                  U R                   5      -  5        [	        X5      $ )z@Response callback to log unreachable while generating functions.zThe following regions were fully or partially unreachable for query: %sThis could be due to permission setup. Additional informationcan be found in: https://cloud.google.com/functions/docs/troubleshootingz, )unreachabler	   warningjoingetattr)message	attributes     ;lib/googlecloudsdk/command_lib/functions/v1/list/command.py_GetFunctionsAndLogUnreachabler      sC    KK	B
 ))G''
(	) 
	$$    c              #      #    U  H;  n[         R                  R                  USU0SS9n[        XbX45       H  nUv   M	     M=     g7f)z-Yield the functions from the given locations.
projectsIdz!cloudfunctions.projects.locations)params
collectionN)r   REGISTRYParse_YieldFromLocation)	locationsprojectlimitmessagesclientlocationlocation_reffunctions           r   YieldFromLocationsr%   -   sQ     h%%++g&6 , L
 '|HMn N s   AAc           	   #   J  #    [         R                  " UR                  [        X5      USS[        S9n U H  nUv   M	     g! [
        R                   aJ  n[        R                  " U5      n[        R                  " [        R                  " U5      5         SnAgSnAff = f7f)z,Yield the functions from the given location.	functionspageSize)servicerequestr   fieldbatch_size_attributeget_field_funcN)r   YieldFromListprojects_locations_functions_BuildRequestr   api_exceptions	HttpErrorr   GetHttpErrorMessager   reraisebase_exceptionsHttpException)r#   r   r    r!   list_generatoritemerrormsgs           r   r   r   9   s     ++11L3%3.;j 		!	! ;

"
"5
)C44S9::;s/   1B#A B#B A BB#B  B#c                 <    UR                  U R                  5       S9$ )N)parent)3CloudfunctionsProjectsLocationsFunctionsListRequestRelativeName)r#   r    s     r   r0   r0   O   s'    		E	E&&( 
F 
 r   c                     [         R                  " 5       n[         R                  " 5       n[        R                  R
                  R                  R                  5       nU R                  n[        U R                  X4X!5      $ )zList Google Cloud Functions.)r   GetApiClientInstanceGetApiMessagesModuler
   VALUEScorer   	GetOrFailr   r%   regions)argsr!   r    r   r   s        r   RunrG   U   sZ    $$&&&&((""**446'
**%	DLL'(	KKr   N)__doc__
__future__r   r   r   apitools.base.pyr   r1   r   #googlecloudsdk.api_lib.functions.v1r   googlecloudsdk.callioper5   googlecloudsdk.corer	   r
   r   r   r%   r   r0   rG    r   r   <module>rO      sF    M &  ' 9 ' 4 A * # * )%	;,Lr   