- release_tracks: [ALPHA, BETA, GA]

  help_text:
    brief: Create a Cloud Security Command Center finding.
    description: Create a Cloud Security Command Center finding.
    examples: |
      Create an ACTIVE my-finding with category: XSS_SCRIPTING attached to example-project under organization 123456 and source 5678:

        $ {command} my-finding --organization=123456 --source=5678 --state=ACTIVE --category='XSS_SCRIPTING' --event-time=2023-01-11T07:00:06.861Z --resource-name='//cloudresourcemanager.googleapis.com/projects/example-project'

      Create an ACTIVE my-finding attached to example-project under project example-project and source 5678:

        $ {command} projects/example-project/sources/5678/findings/my-finding --state=ACTIVE --category='XSS_SCRIPTING' --event-time=2023-01-11T07:00:06.861Z --resource-name='//cloudresourcemanager.googleapis.com/projects/example-project'

      Create an ACTIVE my-finding attached to example-project under folder 456 and source 5678:

        $ {command} folders/456/sources/5678/findings/my-finding --state=ACTIVE --category='XSS_SCRIPTING' --event-time=2023-01-11T07:00:06.861Z --resource-name='//cloudresourcemanager.googleapis.com/projects/example-project'

  request:
    collection: securitycenter.organizations.sources.findings
    api_version: v1
    modify_request_hooks:
    - googlecloudsdk.command_lib.scc.findings.request_hooks:CreateFindingsReqHook

  arguments:
    additional_arguments_hook: googlecloudsdk.command_lib.scc.findings.resource_hooks:AppendFindingArg

    params:
    - !REF googlecloudsdk.command_lib.scc.findings.flags:external_uri
    - !REF googlecloudsdk.command_lib.scc.findings.flags:source_properties
    - !REF googlecloudsdk.command_lib.scc.findings.flags:state
    - arg_name: category
      required: true
      api_field: finding.category
      help_text: |
        Taxonomy group within findings from a given source. Example: XSS_SCRIPTING
    # TODO(b/265311814): Migrate to gcloud datetime types
    - arg_name: event-time
      required: true
      api_field: finding.eventTime
      help_text: |
        Time at which the issue is detected or the finding is created, in the following format: YYYY-MM-DDThh:mm:ss.ffffffZ. Example: 2023-01-11T07:00:06.861Z
    - arg_name: resource-name
      required: true
      api_field: finding.resourceName
      help_text: |
        Full resource name of the Google Cloud Platform resource this finding is for.
