
                         |    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	\5      r " S
 S\5      rg)z7Useful commands for interacting with the Cloud SCC API.    )	Generator)
list_pager)apis)util)log)$securitycentermanagement_v1_messagesc                      \ rS rSrSrS rS\S\R                  4S jr	S\R                  4S jrS\S\S	\R                  S
\R                  R                  S\S\R                  4S jrS\S\S	\R                  S
\R                  R                  S\S\R                  4S jrS\S\4S jrS\S\S\S\\R                  S\R(                  4   4S jrS\S\S\S\\R                  S\R,                  4   4S jrSrg)SHACustomModuleClient   zQClient for SHA custom module interaction with the Security Center Management API.c                 P    [         R                  " SS5      R                  U l        g Nsecuritycentermanagementv1)r   GetClientInstance7projects_locations_securityHealthAnalyticsCustomModules_clientselfs    4lib/googlecloudsdk/api_lib/scc/manage/sha/clients.py__init__SHACustomModuleClient.__init__   s$     ))"D== 	L    namereturnc                 `    [         R                  " US9nU R                  R                  U5      $ )zGet a SHA custom module.r   )messagesWSecuritycentermanagementProjectsLocationsSecurityHealthAnalyticsCustomModulesGetRequestr   Getr   r   reqs      r   r   SHACustomModuleClient.Get#   s.     
j
jC <<C  r   c                     [         R                  " X#S9n[         R                  " UUS9nU R                  R	                  U5      $ )zSimulate a SHA custom module.)customConfigresource)parent2simulateSecurityHealthAnalyticsCustomModuleRequest)r   2SimulateSecurityHealthAnalyticsCustomModuleRequest\SecuritycentermanagementProjectsLocationsSecurityHealthAnalyticsCustomModulesSimulateRequestr   Simulate)r   r&   custom_configr%   sim_reqr!   s         r   r*   SHACustomModuleClient.Simulate+   sF    
 II"G 
o
o;BC <<  %%r   validate_onlyr+   enablement_stateupdate_maskc                 :   [         R                  " UUUS9n[         R                  " UU[        R                  " U5      US9nU R
                  R                  U5      nU(       a!  [        R                  R                  S5        U$ [        R                  " U5        U$ )zUpdate a SHA custom module.)r$   enablementStater   )#securityHealthAnalyticsCustomModuler   
updateMaskvalidateOnlyRequest is valid.)r   #SecurityHealthAnalyticsCustomModuleYSecuritycentermanagementProjectsLocationsSecurityHealthAnalyticsCustomModulesPatchRequestscc_utilCleanUpUserMaskInputr   Patchr   statusPrintUpdatedResource)	r   r   r.   r+   r/   r0   'security_health_analytics_custom_moduler!   responses	            r   UpdateSHACustomModuleClient.Update9   s     	44&,	
 , 
l
l,S00="	C ||!!#&H	jj*+oOr   r&   display_namec                    [         R                  " UUUS9n[         R                  " UUUS9nU R                  R	                  U5      nU(       a!  [
        R                  R                  S5        U$ [
        R                  " U5        U$ )zCreate an SHA custom module.)r$   r2   displayName)r3   r&   r5   r6   )	r   r7   ZSecuritycentermanagementProjectsLocationsSecurityHealthAnalyticsCustomModulesCreateRequestr   Creater   r<   r=   CreatedResource)	r   r&   r.   r+   r/   rC   r?   r!   r@   s	            r   rG   SHACustomModuleClient.CreateX   s     	44&,$	
 , 
m
m,S"C
 ||""3'H	jj*+o%Or   c                     [         R                  " XS9nU R                  R                  U5      nU(       a!  [        R
                  R                  S5        U$ [        R                  " U5        U$ )zDelete a SHA custom module.)r   r5   r6   )r   ZSecuritycentermanagementProjectsLocationsSecurityHealthAnalyticsCustomModulesDeleteRequestr   Deleter   r<   r=   DeletedResource)r   r   r.   r!   r@   s        r   rL   SHACustomModuleClient.Deletev   s[     
m
mC ||""3'H	jj*+oOr   	page_sizelimitNc           	      p    [         R                  " XS9n[        R                  " U R                  UUSUSS9$ )z(List the details of a SHA custom module.pageSizer&   $securityHealthAnalyticsCustomModulesrS   requestrP   field
batch_sizebatch_size_attribute)r   XSecuritycentermanagementProjectsLocationsSecurityHealthAnalyticsCustomModulesListRequestr   YieldFromListr   r   rO   r&   rP   r!   s        r   ListSHACustomModuleClient.List   sB     
k
kC ##4' r   c           
      r    [         R                  " XS9n[        R                  " U R                  SUUSUSS9$ )zCList the details of the resident and descendant SHA custom modules.rR   ListDescendantrT   rS   )methodrV   rP   rW   rX   rY   )r   bSecuritycentermanagementProjectsLocationsSecurityHealthAnalyticsCustomModulesListDescendantRequestr   r[   r   r\   s        r   r`   $SHACustomModuleClient.ListDescendant   sE     
u
uC ##4' r   r   )__name__
__module____qualname____firstlineno____doc__r   strr   r7   r   3SimulateSecurityHealthAnalyticsCustomModuleResponser*   boolCustomConfigEnablementStateValueValuesEnumrA   rG   rL   intr   0ListSecurityHealthAnalyticsCustomModulesResponser]   :ListDescendantSecurityHealthAnalyticsCustomModulesResponser`   __static_attributes__ r   r   r
   r
      s   Y>!c !hJJ !&CC&  **	
 !DDcc  33>  **	
 !DDcc  33< T $'0322
??A*$'0322
IIKr   r
   c                       \ rS rSrSrS rS\S\R                  4S jr	S\
S\S	\
S\\R                  S
\R                  4   4S jrSrg
)EffectiveSHACustomModuleClient   z[Client for SHA effective custom module interaction with the Security Center Management API.c                 P    [         R                  " SS5      R                  U l        g r   )r   r   @projects_locations_effectiveSecurityHealthAnalyticsCustomModulesr   r   s    r   r   'EffectiveSHACustomModuleClient.__init__   s"    ))"DFF 	Lr   r   r   c                 `    [         R                  " US9nU R                  R                  U5      $ )z"Get a SHA effective custom module.r   )r   `SecuritycentermanagementProjectsLocationsEffectiveSecurityHealthAnalyticsCustomModulesGetRequestr   r   r    s      r   r   "EffectiveSHACustomModuleClient.Get   s.     
s
sC <<C  r   rO   r&   rP   Nc           	      p    [         R                  " XS9n[        R                  " U R                  UUSUSS9$ )zMList the details of the resident and descendant SHA effective custom modules.rR   -effectiveSecurityHealthAnalyticsCustomModulesrS   rU   )r   aSecuritycentermanagementProjectsLocationsEffectiveSecurityHealthAnalyticsCustomModulesListRequestr   r[   r   r\   s        r   r]   #EffectiveSHACustomModuleClient.List   sB     
t
tC ##=' r   rd   )re   rf   rg   rh   ri   r   rj   r   ,EffectiveSecurityHealthAnalyticsCustomModuler   ro   r   9ListEffectiveSecurityHealthAnalyticsCustomModulesResponser]   rr   rs   r   r   ru   ru      sk    cG
!! MM!$'03;;
HHJr   ru   N)ri   typingr   apitools.base.pyr   googlecloudsdk.api_lib.utilr   googlecloudsdk.command_lib.sccr   r9   googlecloudsdk.corer   Agooglecloudsdk.generated_clients.apis.securitycentermanagement.v1r   r   objectr
   ru   rs   r   r   <module>r      s7    >  ' , ; # ~SF Sl$V $r   