
    d                        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  \R                  " \R                  R                  \R                  R                  5       " S	 S
\R                   5      5       rg)z(Command to simulate a SHA custom module.    )absolute_import)division)unicode_literals)clients)base)flags)parsingc                   .    \ rS rSrSr\S 5       rS rSrg)Simulate   a_  Command to simulate a SHA custom module.

## EXAMPLES

To simulate a Security Health Analytics custom module with
ID `123456` for organization `123`, run:

  $ {command} 123456
  --organization=123
  --custom-config-from-file=custom_config.yaml
  --resource-from-file=test.yaml

To simulate a Security Health Analytics custom module with
ID `123456` for folder `456`, run:

  $ {command} 123456
  --folder=456
  --custom-config-from-file=custom_config.yaml
  --resource-from-file=test.yaml

To simulate a Security Health Analytics custom module with
ID `123456` for project `789`, run:

  $ {command} 123456
  --project=789
  --custom-config-from-file=custom_config.yaml
  --resource-from-file=test.yaml

You can also specify the parent more generally:

  $ {command} 123456
  --parent=organizations/123
  --custom-config-from-file=custom_config.yaml
  --resource-from-file=test.yaml

Or just specify the fully qualified module name:

  $ {command}
  organizations/123/locations/global/effectiveSecurityHealthAnalyticsCustomModules/123456
  --custom-config-from-file=custom_config.yaml
  --resource-from-file=test.yaml
c                     [         R                  " SS9R                  U 5        [         R                  " SS9R                  U 5        [         R                  " SS9R                  U 5        g )NT)required)r   CreateParentFlagAddToParserCreateTestResourceFlagCreateCustomConfigFlag)parsers    5lib/surface/scc/manage/custom_modules/sha/simulate.pyArgsSimulate.ArgsH   sM    	D)55f=	  $/;;FC	  $/;;FC    c                     [         R                  " U5      n[         R                  " UR                  5      n[         R                  " UR
                  5      n[        R                  " 5       nUR                  X#US9$ )N)parentcustom_configresource)	r	   GetParentResourceNameFromArgsGetCustomConfigFromArgscustom_config_from_fileGetTestResourceFromArgsresource_from_filer   SHACustomModuleClientr   )selfargsr   r   r   clients         r   RunSimulate.RunN   sl    2248F33$$M ..t/F/FGH**,F??X   r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r%   __static_attributes__r'   r   r   r   r      s#    )V D D
r   r   N)r,   
__future__r   r   r   %googlecloudsdk.api_lib.scc.manage.shar   googlecloudsdk.callioper   %googlecloudsdk.command_lib.scc.manager   r	   ReleaseTracksReleaseTrackGAALPHACommandr   r'   r   r   <module>r8      sd    / &  ' 9 ( 7 9 D%%(($*;*;*A*AB=t|| = C=r   