
                         f   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SKJr  \	R&                  \	R(                  " \	R*                  R,                  \	R*                  R.                  5       " S S\	R0                  5      5       5       rSS jrg)z>Command to Create a Cloud Security Command Center mute config.    )absolute_import)division)print_function)unicode_literals)securitycenter_client)base)flags)util)log)
propertiesc                   :    \ rS rSrSrSSSS.r\S 5       rS rSr	g	)
Create    z-Create a Security Command Center mute config.a  
        To create a mute config ``test-mute-config'' given organization ``123''
        with a filter on category that equals to ``XSS_SCRIPTING'', run:

          $ {command} test-mute-config --organization=123
            --description="This is a test mute config"
            --filter="category=\"XSS_SCRIPTING\""

        To create a mute config ``test-mute-config'' given folder ``456'' with a
        filter on category that equals to ``XSS_SCRIPTING'', run:

          $ {command} test-mute-config --folder=456
            --description="This is a test mute config"
            --filter="category=\"XSS_SCRIPTING\""

        To create a mute config ``test-mute-config'' given project ``789'' with a
        filter on category that equals to ``XSS_SCRIPTING'', run:

          $ {command} test-mute-config --project=789
            --description="This is a test mute config"
            --filter="category=\"XSS_SCRIPTING\""

        To create a mute config ``test-mute-config'' given organization ``123'',
        `location=eu` with a filter on category that equals to ``XSS_SCRIPTING'',
        run:

          $ {command} test-mute-config --organization=123
            --description="This is a test mute config"
            --filter="category=\"XSS_SCRIPTING\"" --location=euz
      This command uses the Security Command Center API. For more information,
      see [Security Command Center API.](https://cloud.google.com/security-command-center/docs/reference/rest))DESCRIPTIONEXAMPLESzAPI REFERENCEc                 x   [         R                  R                  U 5        [         R                  " U 5        [         R                  R                  U 5        [         R
                  R                  U 5        [         R                  R                  U 5        [         R                  R                  U 5        [        R                  R                  U 5        [        R                  R                  U 5        U R                  R                  [        R                  R                  R                   R#                  5       5        g )N)r	   MUTE_CONFIG_FLAGAddToParserAddParentGroupDESCRIPTION_FLAGFILTER_FLAG	TYPE_FLAGEXPIRY_TIME_FLAG	scc_flagsAPI_VERSION_FLAGLOCATION_FLAGdisplay_info	AddFormatr   VALUEScoredefault_formatGet)parsers    %lib/surface/scc/muteconfigs/create.pyArgsCreate.ArgsI   s     
&&v.	 	&&v.	!!&)	OO'	&&v.**62''/
!!*"3"3"8"8"G"G"K"K"MN    c                 \   [         R                  " XR                  5      n[        R                  " U5      nUR                  5       n[        R                  " X5      n[        R                  " U5      nUS:X  a,  UR                  UR                  UR                  UUS9Ul        O+UR                  UR                  UR                  UUS9Ul        [        XU5      n[        R                   " U5      nUR"                  R%                  U5      n[&        R(                  R+                  S5        U$ )Nv2)filterdescriptiontype
expiryTimezCreated.)scc_utilGetVersionFromArgumentsmute_configr   GetMessages3SecuritycenterOrganizationsMuteConfigsCreateRequestr
   ValidateAndGetTypeValidateAndGetExpiryTime%GoogleCloudSecuritycenterV2MuteConfigr*   r+   %googleCloudSecuritycenterV2MuteConfig%GoogleCloudSecuritycenterV1MuteConfig%googleCloudSecuritycenterV1MuteConfig_GenerateMuteConfig	GetClientorganizations_muteConfigsr   r   statusPrint)	selfargsversionmessagesrequestmute_config_typeexpiry_timeclientresponses	            r$   Run
Create.RunV   s   ..t5E5EFG$009HJJLG..t=//5K$

8
8[[**#$	 9  3 
8
8[[**#$	 9  3 "$9G",,W5F//66w?HJJZ Or'    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr%   rG   __static_attributes__rI   r'   r$   r   r       s<     6 EE:r?"-H 
O 
Or'   r   c                    [         R                  " U 5      Ul        UR                  bG  US:X  a%  [         R                  " XR                  5      Ul        [         R                  " U 5      Ul        Og[        R                  " X5      U l        [         R                  " X5      n[         R                  " U5      Ul        [         R                  " X25      Ul        SU l        U$ )z+Updates parent and Generates a mute config.r)    )r
   ValidateAndGetParentparent ValidateAndGetRegionalizedParentValidateAndGetMuteConfigIdmuteConfigIdr.   ValidateAndGetLocationlocation(ValidateAndGetMuteConfigFullResourceName#GetMuteConfigIdFromFullResourceNameGetParentFromFullResourceNamer*   )r?   reqr@   r0   s       r$   r9   r9   w   s    ((.#*ZZ$88zzJcj66t<C33DBDM??K ??LC33KICJ$+	*r'   N)v1)rN   
__future__r   r   r   r   googlecloudsdk.api_lib.sccr   googlecloudsdk.callioper   googlecloudsdk.command_lib.sccr	   r   r
   r.   *googlecloudsdk.command_lib.scc.muteconfigsgooglecloudsdk.corer   r   DefaultUniverseOnlyReleaseTracksReleaseTrackGAALPHACreateCommandr   r9   rI   r'   r$   <module>rl      s    E &  % ' < ( = ; < ; # * D%%(($*;*;*A*ABRT R C Rjr'   