
                            U d Z ddlZddlmZmZmZ ddlZej                  dk\  rddlm	Z	 nddlm
Z
  G d dee
      Z	 G d	 d
e	      ZdZ ej                  d       G d d             Zdee   deeef   fdZ edd       edd       edd       edd       edd       edd       ed d!       ed"d#       ed$d%       ed&d'       ed(d)       ed*d+      fZ ee      Zeeef   ed,<   y)-z Management API gcloud constants.    N)DictListOptional)      )StrEnum)Enumc                       e Zd Zy)r   N)__name__
__module____qualname__     6lib/googlecloudsdk/command_lib/scc/manage/constants.pyr   r       s    r   r   c                        e Zd ZdZdZdZdZdZy)CustomModuleType$securityHealthAnalyticsCustomModules!eventThreatDetectionCustomModules*effectiveEventThreatDetectionCustomModules-effectiveSecurityHealthAnalyticsCustomModulesbillingMetadataN)r   r   r   SHAETDEFFECTIVE_ETDEFFECTIVE_SHABILLING_METADATAr   r   r   r   r   (   s    .#+#>-A-&r   r   securityCenterServicesT)frozenc                   L    e Zd ZU dZeed<   dZee   ed<   defdZdd de	fdZ
y)	SecurityCenterServicez5Dataclass that reprsesents a Security Center Service.nameNabbreviationreturnc                 j    | j                   | j                   d| j                    dS | j                  S )Nz (can be abbreviated as ))r"   r!   )selfs    r   __str__zSecurityCenterService.__str__:   s7    $		{243D3D2EQGGYYr   otherc                     t        |t              rH| j                  |j                  k(  }| j                  |j                  k(  xr | j                  d u}|xs |S y)NF)
isinstancer    r!   r"   )r&   r(   is_same_nameis_same_abbreviations       r   __eq__zSecurityCenterService.__eq__@   s\    %./YY%**,l


u11
1 ,t+ 
 111r   )r   r   r   __doc__str__annotations__r"   r   r'   boolr-   r   r   r   r    r    3   s8    =) $,$s 
1 
d 
r   r    servicesr#   c                    t        t        |             D ]H  }t        |dz   t        |             D ]+  }| |   | |   k(  st        d| |    d| d| |    d| d	       J | D cg c]  }|j                  | }}| D ci c]  }|j                  | }}|D ci c]  }|j                  | }}i ||S c c}w c c}w c c}w )a  Maps a list of SecurityCenterService objects to an immutable dictionary.

  The dictionary will contain a mapping between each service name and service
  object as well as service abbreviation to service object if the service has
  an abbreviation.

  Args:
    services: list of service objects to add to the dictionary.

  Returns:
    an immutable dictionary mapping service names and abbreviations to services.

  Raises:
    KeyError: if there are duplicate entries for any service name or
    abbreviation.
     z(Duplicate entries in service inventory: z
 at index z and zK in service inventory. Both service names and abbreviations must be unique.)rangelenKeyErrorr"   r!   )r2   ijserviceabbreviated_servicesnames_to_servicesabbreviations_to_servicess          r   make_service_inventoryr>   M   s   & Xa1q5#h-(	!	#6x{m Ds%}Jqc 2??
 	
 )   &%')=)=)IgX   =EEHw||W,HE3G3GgG#3G   
<	;!:	;; Fs   $B66B6 B;C zsecurity-health-analyticssha)r"   zevent-threat-detectionetdzcontainer-threat-detectionctdzvm-threat-detectionvmtdzweb-security-scannerwsszvm-threat-detection-awszvmtd-awszcloud-run-threat-detectioncrtdz
vm-managervmmzec2-vulnerability-assessmentzec2-vazgce-vulnerability-assessmentzgce-vazazure-vulnerability-assessmentzazure-vaznotebook-security-scannernssSERVICE_INVENTORY)r.   dataclassestypingr   r   r   sysversion_infoenumr   r	   r/   r   SERVICE_RESOURCE_PLURAL_NAME	dataclassr    r>   SUPPORTED_SERVICESrG   r0   r   r   r   <module>rP      sY   '  ' ' w 	T 	'w '  8  d#  $2%<()%<	#$
$%%<P 5EJ2G6UK/fE0uE3*M6VL,U;&X &X (z 5EJ% * 7M7 4223 r   