// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.securitycenter.v1;

import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";

option csharp_namespace = "Google.Cloud.SecurityCenter.V1";
option go_package = "cloud.google.com/go/securitycenter/apiv1/securitycenterpb;securitycenterpb";
option java_multiple_files = true;
option java_outer_classname = "ExternalSystemProto";
option java_package = "com.google.cloud.securitycenter.v1";
option php_namespace = "Google\\Cloud\\SecurityCenter\\V1";
option ruby_package = "Google::Cloud::SecurityCenter::V1";

// Representation of third party SIEM/SOAR fields within SCC.
message ExternalSystem {
  option (google.api.resource) = {
    type: "securitycenter.googleapis.com/ExternalSystem"
    pattern: "organizations/{organization}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}"
    pattern: "folders/{folder}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}"
    pattern: "projects/{project}/sources/{source}/findings/{finding}/externalSystems/{externalsystem}"
  };

  // Full resource name of the external system, for example:
  // "organizations/1234/sources/5678/findings/123456/externalSystems/jira",
  // "folders/1234/sources/5678/findings/123456/externalSystems/jira",
  // "projects/1234/sources/5678/findings/123456/externalSystems/jira"
  string name = 1;

  // References primary/secondary etc assignees in the external system.
  repeated string assignees = 2;

  // Identifier that's used to track the given finding in the external system.
  string external_uid = 3;

  // Most recent status of the corresponding finding's ticket/tracker in the
  // external system.
  string status = 4;

  // The most recent time when the corresponding finding's ticket/tracker was
  // updated in the external system.
  google.protobuf.Timestamp external_system_update_time = 5;
}
