
                             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S.rSr " S S\	R                   5      rg)z!Searches the protected resources.    )absolute_import)division)unicode_literals)	inventory)arg_parsers)base)resource_args)
completersz}
         *{command}* returns a list of the resources a key is protecting
         within the specified organization.
       z
         To view the protected resources for the key `puppy` and organization
         number `1234` run:

           $ {command} --keyname=puppy --scope=1234
       )DESCRIPTIONEXAMPLESa  A list of resource types that this request searches for. If empty, it will
search all the [trackable resource types](https://cloud.google.com/kms/docs/view-key-usage#tracked-resource-types).

Regular expressions are also supported. For example:

  * ``compute.googleapis.com.*'' snapshots resources whose type
    starts with ``compute.googleapis.com''.
  * ``.*Image'' snapshots resources whose type ends with
    ``Image''.
  * ``.*Image.*'' snapshots resources whose type contains
    ``Image''.

See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
regular expression syntax. If the regular expression does not match any
supported resource type, an ``INVALID_ARGUMENT'' error will be returned.
c                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)SearchProtectedResources<   z*Searches the resources protected by a key.c                     [         R                  " U SS5        U R                  SS[        R                  SSS9  U R                  SS[
        R                  " 5       [        S	9  g )
NTz	--keynamez--scopeORGANIZATION_IDzOrganization ID.)metavar	completerrequiredhelpz--resource-typesRESOURCE_TYPES)r   typer   )r	   AddKmsKeyResourceArgForKMSadd_argumentr
   OrganizationCompleterr   ArgListRESOURCE_TYPE_HELP)parsers    7lib/surface/kms/inventory/search_protected_resources.pyArgsSearchProtectedResources.Args@   sf    ,,VT;G
!22  !    "	      c                     UR                   nUR                  nUR                  nU(       d  / n[        R                  " X2XAS9$ )N)scopekey_nameresource_typesargs)keynamer#   r%   r   r   )selfr&   r$   orgr%   s        r   RunSearchProtectedResources.RunP   s?    ||H
**C((Nn--^ r!    N)__name__
__module____qualname____firstlineno____doc__DETAILED_HELPdetailed_helpstaticmethodr   r*   __static_attributes__r,   r!   r   r   r   <   s!    2- r!   r   N)r1   
__future__r   r   r   #googlecloudsdk.api_lib.kmsinventoryr   googlecloudsdk.callioper   r   googlecloudsdk.command_lib.kmsr	   +googlecloudsdk.command_lib.resource_managerr
   r2   r   ListCommandr   r,   r!   r   <module>r<      sM    ( &  ' 9 / ( 8 B &t// r!   