
                            d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlm	Z	 ddl
mZ d	 Zd
 Zd Zd Ze	j                    e	j"                  e	j$                  j&                         G d de	j(                                      Z e	j"                  e	j$                  j,                         G d de             Z e	j"                  e	j$                  j0                         G d de             Zy)z#bigtable app profiles list command.    )absolute_import)division)unicode_literalsN)app_profiles)base)	argumentsc                 p    d| v rd| d   v r| d   d   S d| v rd| d   v rdj                  | d   d         S yy)z/Extracts the routing info from the app profile.singleClusterRouting	clusterIdmultiClusterRoutingUseAny
clusterIds,MULTI_CLUSTER_USE_ANY )joinapp_profiles    )lib/surface/bigtable/app_profiles/list.py!_TransformAppProfileToRoutingInfor      s_    +[!788-.{;;"k1{#>??XXk"=>|LMM"	    c                     d| v ryy)z1Extracts the isolation mode from the app profile.dataBoostIsolationReadOnlyDATA_BOOST_ISOLATION_READ_ONLYSTANDARD_ISOLATION r   s    r   #_TransformAppProfileToIsolationModer   (   s    ![0+	r   c                 4    d| v ryd| v rd| d   v r| d   d   S y)BExtracts the Data Boot compute billing owner from the app profile.r   r   standardIsolationpriorityPRIORITY_HIGHr   r   s    r   /_TransformAppProfileToStandardIsolationPriorityr"   /   s7    ![0[(
$78
8*+J77r   c                 *    d| v rd| d   v r| d   d   S y)r   r   computeBillingOwnerr   r   r   s    r   2_TransformAppProfileToDataBoostComputeBillingOwnerr%   <   s/     #k1
;/K#L
L345JKKr   c                   N    e Zd ZdZd ej
                  d      iZed        Zd Z	y)ListAppProfilesGAList Bigtable app profiles.EXAMPLESzw          To list all app profiles for an instance, run:

            $ {command} --instance=my-instance-id

          c                     t        j                  | d       | j                  j                  dt        i       | j                  j                  d       y )Nto list app profiles forroutingInfoz
          table(
            name.basename():sort=1,
            description:wrap,
            routingInfo():wrap:label=ROUTING,
            singleClusterRouting.allowTransactionalWrites.yesno("Yes"):label=TRANSACTIONAL_WRITES
          )
        )r   AddInstanceResourceArgdisplay_infoAddTransformsr   	AddFormatparsers    r   ArgszListAppProfilesGA.ArgsV   sM    $$V-GH
%%8'  !! # r   c                 t    |j                   j                  j                         }t        j                  |      S )zThis is what gets called when the user runs this command.

    Args:
      args: an argparse namespace. All the arguments that were provided to this
        command invocation.

    Returns:
      Some value that we want to have printed later.
    )CONCEPTSinstanceParser   List)selfargsinstance_refs      r   RunzListAppProfilesGA.Runi   s-     ==))//1L\**r   N)
__name__
__module____qualname____doc__textwrapdedentdetailed_helpstaticmethodr3   r<   r   r   r   r'   r'   G   s?     $ 
(//  -  $+r   r'   c                        e Zd ZdZed        Zy)ListAppProfilesBetar(   c                     t        j                  | d       | j                  j                  t        t
        t        t        d       | j                  j                  d       y Nr+   )r,   isolationModestandardIsolationPrioritydataBoostComputeBillingOwnera  
          table(
            name.basename():sort=1,
            description:wrap,
            routingInfo():wrap:label=ROUTING,
            singleClusterRouting.allowTransactionalWrites.yesno("Yes"):label=TRANSACTIONAL_WRITES,
            isolationMode():label=ISOLATION_MODE,
            standardIsolationPriority():label=STANDARD_ISOLATION_PRIORITY,
            dataBoostComputeBillingOwner():label=DATA_BOOST_COMPUTE_BILLING_OWNER
          )
        	r   r-   r.   r/   r   r   r"   r%   r0   r1   s    r   r3   zListAppProfilesBeta.Args{   U    $$V-GH
%%8<; ?	' 	 !! 
# 
r   Nr=   r>   r?   r@   rD   r3   r   r   r   rF   rF   w       # r   rF   c                        e Zd ZdZed        Zy)ListAppProfilesAlphar(   c                     t        j                  | d       | j                  j                  t        t
        t        t        d       | j                  j                  d       y rH   rL   r1   s    r   r3   zListAppProfilesAlpha.Args   rM   r   NrN   r   r   r   rQ   rQ      rO   r   rQ   )r@   
__future__r   r   r   rA   googlecloudsdk.api_lib.bigtabler   googlecloudsdk.callioper   #googlecloudsdk.command_lib.bigtabler   r   r   r"   r%   DefaultUniverseOnlyReleaseTracksReleaseTrackGAListCommandr'   BETArF   ALPHArQ   r   r   r   <module>r^      s    * &  '  8 ( 9	
 D%%(()++(( ++ * ++\ D%%**++  ,B D%%++,.  -r   