
    
                         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  G d	 d
ej                        Zy)z!Command to get history of assets.    )absolute_import)division)unicode_literals)client_util)base)flags)common_argsc                   .    e Zd ZdZddiZed        Zd Zy)
GetHistoryz=Get the update history of assets that overlaps a time window.EXAMPLESa        To get the history of asset metadata for
      '//compute.googleapis.com/projects/test-project/zones/us-central1-f/instances/instance1'
      between '2018-10-02T15:01:23.045Z' and '2018-12-05T13:01:21.045Z', run:

        $ {command} --project='test-project' --asset-names='//compute.googleapis.com/projects/test-project/zones/us-central1-f/instances/instance1' --start-time='2018-10-02T15:01:23.045Z' --end-time='2018-12-05T13:01:21.045Z' --content-type='resource'

      To get the history of asset iam policy for
      '//cloudresourcemanager.googleapis.com/projects/10179387634'
      between '2018-10-02T15:01:23.045Z' and '2018-12-05T13:01:21.045Z', and
      project '10179387634' is in organization '1060499660910', run:

        $ {command} --organization='1060499660910' --asset-names='//cloudresourcemanager.googleapis.com/projects/10179387634' --start-time='2018-10-02T15:01:23.045Z' --end-time='2018-12-05T13:01:21.045Z' --content-type='iam-policy'
      c                 t   | j                  d      }t        j                  |d       t        j                  d      j                  |       t        j                  |        t        j                  | d       t        j                  |        t        j                  |        t        j                  |        y )NT)requiredz3The ID of the organization which is the root asset.z$The project which is the root asset.)help_text_to_prepend)add_mutually_exclusive_groupr   AddOrganizationArgsr	   ProjectArgumentAddToParserAddAssetNamesArgsAddContentTypeArgsAddRelationshipTypesArgsAddStartTimeArgsAddEndTimeArgs)parserparent_groups      lib/surface/asset/get_history.pyArgszGetHistory.Args0   s    666EL	KMCk,	F#	Vd3	""6*	6"	     c                 L    t        j                         }|j                  |      S )N)r   GetHistoryClientr   )selfargsclients      r   RunzGetHistory.Run>   s!    ))+FT""r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r#    r   r   r   r      s/    E 
-$ ! !#r   r   N)r'   
__future__r   r   r   googlecloudsdk.api_lib.assetr   googlecloudsdk.callioper    googlecloudsdk.command_lib.assetr   $googlecloudsdk.command_lib.util.argsr	   Commandr   r*   r   r   <module>r1      s/    ( &  ' 4 ( 2 <%# %#r   