
                         J    d 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 d Z	y)	z;Declarative Response Hooks for Cloud SCC's Source response.    )absolute_import)division)print_function)unicode_literals)
exceptionsc                 F   | D ]]  }|j                   r%|j                  j                  |j                         s'|j                  sA|j                  |j                  k(  s[|c S  t        j                  d|j                   |j                   z        |j                  z        )zReturns source that matches the user provided source_id or display_name.

  Args:
    response: Response object.
    args: Input arguments.

  Raises:
    Error if it's an invalid source or no matching source was found.
  zSource: %s not found.)sourcenameendswithsource_display_namedisplayNamecore_exceptionsError)responseargsr	   s      <lib/googlecloudsdk/command_lib/scc/sources/response_hooks.py!ExtractMatchingSourceFromResponser      s     f	--dkk:		!	!			t77	7m	 
 	kk-t{{M	N N373K3KM	N N    N)
__doc__
__future__r   r   r   r   googlecloudsdk.corer   r   r    r   r   <module>r      s     B &  % ' =Nr   