
    "              
       L   S r SSKJr  SSKJr  SSKJr  SSKJr  SSKrSSKrSSKJ	r	  SSK
Jr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  \R2                  " SS\R4                  " S\R6                  " S5      SS9S9r\R2                  " SSSS9r\R2                  " SSSS9r\R2                  " SSS9r\R2                  " SSSS 9r \R2                  " S!S"S#\RB                  " 5       S$9r"\RF                  " S%S&/ S'QS(9r$\R2                  " S)S*S9r%S+ r&S, r'S- r(S. r)g)/z.Shared flags definitions for finding commands.    )absolute_import)division)print_function)unicode_literalsN)encoding)securitycenter_client)actions)arg_parsers)base)errors)resource_args)concept_parsers)
propertiesz--compare-durationan  
      When compare_duration is set, the result's "state_change" attribute is
      updated to indicate whether the finding had its state changed, the
      finding's state remained unchanged, or if the finding was added during
      the compare_duration period of time that precedes the read_time. This
      is the time between (read_time - compare_duration) and read_time. The
      state_change value is derived based on the presence and state of the
      finding at the two points in time. Intermediate state changes between
      the two times don't affect the result. For example, the results aren't
      affected if the finding is made inactive and then active again.
      Possible "state_change" values when compare_duration is specified:

      * 'CHANGED': indicates that the finding was present at the start of
        compare_duration, but changed its state at read_time.

      * 'UNCHANGED': indicates that the finding was present at the start of
        compare_duration and did not change state at read_time.

      * 'ADDED': indicates that the finding was not present at the start of
        compare_duration, but was present at read_time.

      * 'REMOVED': indicates that the finding was present at the start of
        compare_duration, but was not present at read_time.

      If compare_duration is not specified, then the only possible
      state_change is 'UNUSED', which will be the state_change set for all
      findings present at read_time. If this field is set then 'state_change'
      must be a specified field in 'group_by'. See $ gcloud topic datetimes
      for information on supported duration formats.z            The --compare-duration option is deprecated.
            For more information, [see the deprecation notice](https://cloud.google.com/security-command-center/docs/release-notes#April_15_2024)
            on the SCC release notes page.F)warnremoved)helpactionz--event-timea-  Time at which the event took place. For example, if the finding
  represents an open firewall it would capture the time the open firewall
  was detected. If event-time is not provided, it will default to UTC
  version of NOW. See `$ gcloud topic datetimes` for information on
  supported time formats.)r   requiredTz--external-urizURI that, if available, points to a web page outside of Cloud SCC (Security Command Center)
    where additional information about the finding can be found. This field is guaranteed to be
    either empty or a well formed URL.r   z--sourcez#Source id. Defaults to all sources.-)r   defaultz--source-propertiesaA  Source specific properties. These properties are managed by the
      source that writes the finding. The key names in the source_properties map
      must be between 1 and 255 characters, and must start with a letter and
      contain alphanumeric characters or underscores only. For example
      "key1=val1,key2=val2" z	KEY=VALUE)r   metavartypez--statez$State is one of: [ACTIVE, INACTIVE].)activeinactivezstate-unspecified)help_strchoicesfindingz@ID of the finding or fully qualified identifier for the finding.c            	          SSSSSSSS./S	.S
SSS.SSSS./SS.n [         R                  " SSSSSU S9/n[        R                  " U/ 5      $ )z&Create finding as positional resource.r   z-securitycenter.organizations.sources.findingsorganizationsIdorganizationz(Optional) If the full resource name isn't provided e.g. organizations/123, then provide the
              organization id which is the suffix of the organization. Example: organizations/123, the id is
              123.zDgooglecloudsdk.command_lib.scc.findings.flags:GetDefaultOrganizationzSet the organization property in configuration using `gcloud config set scc/organization`
                  if it is not specified in command line.)hookhint)parameter_nameattribute_namer   fallthroughs	sourcesIdsourcez(Optional) If the full resource name isn't provided e.g. organizations/123/sources/456, then
              provide the source id which is the suffix of the source.
              Example: organizations/123/sources/456, the id is 456.)r$   r%   r   	findingIda  Optional) If the full resource name isn't provided e.g.
              organizations/123/sources/456/findings/789, then provide the finding id which is the suffix of
              the finding. Example: organizations/123/sources/456/findings/789, the id is 789.false)name
collection
attributesdisable_auto_completersz8to be used for the SCC (Security Command Center) commandTF)verbr+   r   prefixes
positionalresource_data)r   GetResourcePresentationSpecr   ConceptParser)finding_spec_data	arg_specss     4lib/googlecloudsdk/command_lib/scc/findings/flags.pyCreateFindingArgr8      s     C !2 . a=   !, (H !, )b)8 ")? D //I)	) 
	&	&y"	55    c                  |   [         R                  " S5      n [         R                  " S5      n[        R                  R                  R
                  R                  5       nU R                  U5      (       d,  UR                  U5      (       d  [        R                  " S5      eU R                  U5      (       a  U$ SU-   $ )z+Prepend organizations/ to org if necessary.zorganizations/[0-9]+z[0-9]+z>Organization must match either organizations/[0-9]+ or [0-9]+.zorganizations/)
recompiler   VALUESsccr!   Getmatchr   InvalidSCCInputError)resource_pattern
id_patternr!   s      r7   GetDefaultOrganizationrD      s    ZZ 67zz(#*""&&33779,				-	-j6F6F7 7 
%
%H  L))	L	((r9   c                     [         R                  " 5       n[        R                  " XR                  R
                  5      $ )zAHook to capture "key1=val1,key2=val2" as SourceProperties object.)	sc_clientGetMessagesr   DictToMessageFindingSourcePropertiesValue)source_properties_dictmessagess     r7   ConvertSourcePropertiesrM      s2    ""$(			..DD
 r9   c                     U R                  SS9nUR                  SSS9  UR                  SSS9  UR                  SS	S9  U $ )
z"Adds a parent group to the parser.F)r   z--organizationz:The organization ID (e.g., 123) that contains the finding.r   z--folderz4The folder ID (e.g., 456) that contains the finding.z	--projectzAThe project ID (e.g., example-project) that contains the finding.)add_mutually_exclusive_groupadd_argument)parserparent_groups     r7   AddParentGrouprS      sk    44e4D,G  
 A   N   
-r9   )*__doc__
__future__r   r   r   r   r;   textwrapapitools.base.pyr   googlecloudsdk.api_lib.sccr   rF   googlecloudsdk.callioper	   r
   r   googlecloudsdk.command_lib.sccr   $googlecloudsdk.command_lib.util.argsr   (googlecloudsdk.command_lib.util.conceptsr   googlecloudsdk.corer   ArgumentDeprecationActiondedentCOMPARE_DURATION_FLAGEVENT_TIME_FLAG_NOT_REQUIREDEVENT_TIME_FLAG_REQUIREDEXTERNAL_URI_FLAGSOURCE_FLAGArgDictSOURCE_PROPERTIES_FLAGChoiceArgument
STATE_FLAGFINDING_FLAGr8   rD   rM   rS    r9   r7   <module>rl      sU    5 &  % ' 	  % I + / ( 1 > D *
8: $$__ . / ?' R  $}}

     ==

   MM
*  mm:C
 
 
 					    37
 }}	K-6`) r9   