
    d                        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dl	m
Z
 ddl	mZ  ej                  ej                  j                  ej                  j                         G d	 d
ej                                Zy)z(Command to simulate a SHA custom module.    )absolute_import)division)unicode_literals)clients)base)flags)parsingc                   &    e Zd ZdZed        Zd Zy)Simulatea  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                     t        j                  d      j                  |        t        j                  d      j                  |        t        j                  d      j                  |        y )NT)required)r   CreateParentFlagAddToParserCreateTestResourceFlagCreateCustomConfigFlag)parsers    5lib/surface/scc/manage/custom_modules/sha/simulate.pyArgszSimulate.ArgsH   sM    	D)55f=	  $/;;FC	  $/;;FC    c                     t        j                  |      }t        j                  |j                        }t        j                  |j
                        }t        j                         }|j                  |||      S )N)parentcustom_configresource)	r	   GetParentResourceNameFromArgsGetCustomConfigFromArgscustom_config_from_fileGetTestResourceFromArgsresource_from_filer   SHACustomModuleClientr   )selfargsr   r   r   clients         r   RunzSimulate.RunN   sn    2248F33$$M ..t/F/FGH**,F??]X   r   N)__name__
__module____qualname____doc__staticmethodr   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>r3      sf    / &  ' 9 ( 7 9 D%%(($*;*;*A*AB=t|| = C=r   