
                             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  ej                  ej                  j                         G d	 d
ej                               Zy)z%Command for listing Stacks resources.    )absolute_import)division)unicode_literals)base)graph)run_apps_operations)logc                       e Zd ZdZd Zd Zy)ExportGraphz$Export a graph for Stacks resources.c                     | j                         }t        j                  ||      5 }|j                         cddd       S # 1 sw Y   yxY w)a  Export a graph for Stacks resources.

    Args:
      args: ArgumentParser, used to reference the inputs provided by the user.

    Returns:
      dict with a single key that maps to a list of resources.
      This will be used by the integration_list_printer to format all
      the entries in the list.

      The reason this is not a list is because the printer will only recieve
      one entry at a time and cannot easily format all entries into a table.
    N)ReleaseTrackr   ConnectGetBindingData)selfargsrelease_trackclients       ,lib/surface/stacks/resources/export_graph.pyRunzExportGraph.Run   s<     %%'M		$	$T=	9V""$ 
:	9	9s   AA
c                     ~|rZt        j                  |d      D ]@  }t        j                  j	                  |       t        j                  j	                  d       B yy)zThis method is called to print the result of the Run() method.

    Args:
      args: all the arguments that were provided to this command invocation.
      bindings: The binding data returned from Run().
    ResourcesGraph
N)r   GenerateBindingGraphr	   outwrite)r   r   bindingslines       r   DisplayzExportGraph.Display2   sH     	,,X7GH$dd I     N)__name__
__module____qualname____doc__r   r    r   r   r   r      s    ,%&r   r   N)r#   
__future__r   r   r   googlecloudsdk.callioper   +googlecloudsdk.command_lib.run.integrationsr   r   googlecloudsdk.corer	   ReleaseTracksr   ALPHAListCommandr   r$   r   r   <module>r,      sY    , &  ' ( = K # D%%++,!$"" ! -!r   