
    
                         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dlmZ dd	lmZ  ej                  ej                   j"                         G d
 dej$                               Zy)z'List github enterprise configs command.    )absolute_import)division)unicode_literals)cloudbuild_util)base)flags)
properties)	resourcesc                   &    e Zd ZdZed        Zd Zy)	ListAlphaz@List all github enterprise configs in a Google Cloud project.
  c                 j    | j                   j                  d       t        j                  | dd       y)zRegister flags for this command.

    Args:
      parser: An argparse.ArgumentParser-like object. It is mocked out in order
        to capture some information, but behaves like an ArgumentParser.
    z
          table(
            name,
            createTime.date('%Y-%m-%dT%H:%M:%S%Oz', undefined='-'),
            host_url,
            app_id
          )
        F)hiddenrequiredN)display_info	AddFormatbuild_flagsAddRegionFlag)parsers    3lib/surface/builds/enterprise_config/github/list.pyArgszListAlpha.Args!   s1     !! #  fUUC    c                 2   t        j                         }t        j                         }t        j                  j
                  j                  j                  d      }t        j                  j                  j                  j                         }|j                  xs |xs t         j                  }t        j                  j                  d||      }|j                  j                  |j!                  |j#                         |            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.
    T)r   zcloudbuild.projects.locations)
collection
projectsIdlocationsId)parent	projectId)r   GetClientInstanceGetMessagesModuler	   VALUEScoreprojectGetbuildsregionDEFAULT_REGIONr
   REGISTRYCreate*projects_locations_githubEnterpriseConfigsList=CloudbuildProjectsLocationsGithubEnterpriseConfigsListRequestRelativeNameconfigs)	selfargsclientmessagesr   
regionproplocationparent_resourceghe_lists	            r   RunzListAlpha.Run4   s     ..0F002H##++///>F""))00446J{{JjJO,J,JH  ((//2 0 O @@EENN"//1 	O 	  'w 
 Or   N)__name__
__module____qualname____doc__staticmethodr   r6    r   r   r   r      s"     D D$r   r   N)r:   
__future__r   r   r   !googlecloudsdk.api_lib.cloudbuildr   googlecloudsdk.callioper   !googlecloudsdk.command_lib.buildsr   r   googlecloudsdk.corer	   r
   ReleaseTracksReleaseTrackALPHAListCommandr   r<   r   r   <module>rF      s\    . &  ' = ( B * ) D%%++,5   5 -5r   