
    H                     4   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
iZ e	j                  e	j                  j                  e	j                  j                   e	j                  j"                         G d de	j$                               Zy)z/recommender API insights Mark Accepted command.    )absolute_import)division)unicode_literals)insight)arg_parsers)base)flagsEXAMPLESz
        To mark an insight as ACCEPTED:

          $ {command} abcd-1234 --project=project-id --location=global --insight-type=google.compute.firewall.Insight --etag=abc123
        c                   *    e Zd ZdZeZed        Zd Zy)MarkAcceptedzMark an insight's state as ACCEPTED.

     Mark an insight's state as ACCEPTED. Can be applied to insights in ACTIVE
     or ACCEPTED state. The following are currently supported: project,
     billing_account, folder, and organization.
  c                 N   t        j                  |        | j                  dt        d       | j                  dddd       | j                  d	d
dd       | j                  dddd       | j                  dt	        j
                  d      i ddt        j                         y)zArgs is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go on
        the command line after this command.
    INSIGHTz+Insight id which will be marked as accepted)typehelpz
--locationLOCATIONTLocation)metavarrequiredr   z--insight-typeINSIGHT_TYPEzInsight Type of the insightsz--etagetagzEtag of a insight)r   r   r   z--state-metadata   )
min_lengthzXState metadata for recommendation, in format of --state-metadata=key1=value1,key2=value2z	KEY=VALUE)r   defaultr   r   actionN)r	   AddParentFlagsToParseradd_argumentstrr   ArgDictStoreOnceAction)parsers    1lib/surface/recommender/insights/mark_accepted.pyArgszMarkAccepted.Args0   s     
  (
:  
 j4j  J
+	  -
 46I  K
  A.g**  ,    c                     t        j                  | j                               }t        j                  |      }|j                  ||j                  |j                        S )zRun 'gcloud recommender insights mark-accepted'.

    Args:
      args: argparse.Namespace, The arguments that this command was invoked
        with.

    Returns:
      The result insights after being marked as accepted
    )r   CreateClientReleaseTrackr	   GetInsightNamer   state_metadatar   )selfargsclientnames       r!   RunzMarkAccepted.RunO   sL     !!$"3"3"56F%DtT%8%8$))DDr#   N)	__name__
__module____qualname____doc__DETAILED_HELPdetailed_helpstaticmethodr"   r-    r#   r!   r   r   $   s&      -, ,<Er#   r   N)r1   
__future__r   r   r   "googlecloudsdk.api_lib.recommenderr   googlecloudsdk.callioper   r   &googlecloudsdk.command_lib.recommenderr	   r2   ReleaseTracksr&   ALPHABETAGACommandr   r5   r#   r!   <module>r?      s    6 &  ' 6 / ( 8 	 D%%++T->->-C-C%%((*5E4<< 5E*5Er#   