// Copyright 2025 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.support.v2beta;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/support/v2beta/actor.proto";
import "google/cloud/support/v2beta/content.proto";
import "google/protobuf/timestamp.proto";

option csharp_namespace = "Google.Cloud.Support.V2Beta";
option go_package = "cloud.google.com/go/support/apiv2beta/supportpb;supportpb";
option java_multiple_files = true;
option java_outer_classname = "EmailMessageProto";
option java_package = "com.google.cloud.support.v2beta";
option php_namespace = "Google\\Cloud\\Support\\V2beta";
option ruby_package = "Google::Cloud::Support::V2beta";

// An email associated with a support case.
message EmailMessage {
  option (google.api.resource) = {
    type: "cloudsupport.googleapis.com/EmailMessage"
    pattern: "projects/{project}/cases/{case}/emailMessages/{email_message}"
    pattern: "organizations/{organization}/cases/{case}/emailMessages/{email_message}"
    plural: "emailMessages"
    singular: "emailMessage"
  };

  // Identifier. Resource name for the email message.
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Output only. Time when this email message object was created.
  google.protobuf.Timestamp create_time = 2
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The user or Google Support agent that created this email
  // message. This is inferred from the headers on the email message.
  Actor actor = 3 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Subject of the email.
  string subject = 4 [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Email addresses the email was sent to.
  repeated string recipient_email_addresses = 5
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. Email addresses CCed on the email.
  repeated string cc_email_addresses = 6
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Output only. The full email message body. A best-effort attempt is made to
  // remove extraneous reply threads.
  TextContent body_content = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
}
