
    0	                     ~    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Z G d	 d
e
j                        Zy)zV2 Revision specific printer.    )k8s_object_printer_util)container_printer)printer_util)volume_printer)custom_printer_base)revisionr   c                   r    e Zd ZdZdej
                  fdZedej
                  dej                  fd       Z
y)RevisionPrinterzPrints the Run v2 Revision in a custom human-readable format.

  Format specific to Cloud Run revisions. Only available on Cloud Run
  commands that print worker revisions.
  recordc           	          t        j                  t        j                  |d      t	        j
                  |j                        d| j                  |      t        j                  |      g      }|S )zATransform a revision into the output structure of marker classes.T)is_child_resource )	cpLinesr   BuildHeaderk8s_util	GetLabelslabelsTransformSpecFormatReadyMessage)selfr   fmts      Blib/googlecloudsdk/command_lib/run/printers/v2/revision_printer.py	TransformzRevisionPrinter.Transform#   s]    
((  4@6==)6"''/ C J    returnc           	         d| j                   fg}|j                  dt        j                  | j                        fdt        j
                  | j                        fd| j                  rdndfdt        j                  | j                        fg       t        j                  t        j                  | j                        t        j                   |      g      S )NzService accountz
VPC accessCMEKzSession AffinityTrue Volumes)service_accountextendr   GetVpcNetwork
vpc_accessGetCMEKencryption_keysession_affinityr   
GetVolumesvolumesr   r   r   GetContainers
containersLabeled)r   r   s     r   r   zRevisionPrinter.TransformSpec.   s     &"8"89:F
MM	|11&2C2CDE	%%f&;&;<=	v'>'>VBG	N--fnn=>  88		(	():):	;RZZ=OP r   N)__name__
__module____qualname____doc__r   Revisionr   staticmethodr   r   r    r   r   r
   r
      sE    	h// 	 H-- "((  r   r
   N)r1   'googlecloudsdk.command_lib.run.printersr   r   *googlecloudsdk.command_lib.run.printers.v2r   r   r   googlecloudsdk.core.resourcer   r   ;googlecloudsdk.generated_clients.gapic_clients.run_v2.typesr   REVISION_PRINTER_FORMATCustomPrinterBaser
   r4   r   r   <module>r;      s6    $ W H C E B P % b** r   