syntax = "proto3";

package third_party.py.googlecloudsdk.command_lib.util.anthos.protos;

import "google/protobuf/timestamp.proto";

message OutputMessage {
  // Semantic version of the message format e.g. v1.0.0
  // Useful if message format changes before binary is updated.
  string version = 1;
  google.protobuf.Timestamp timestamp = 2;
  // Un-structured message content like status and general output messages
  string body = 3;
  // Structured resource/resource list content e.g. YAML or JSON serializable
  // content representing some resource or set of resources.
  string resource_body = 4;

  // Only present if the message is related to an error
  message ErrorDetail {
    // The exception or error being logged e.g. 'User Error' or
    // ValidationException
    string error = 1;
    //(Optional) Any stacktrace or additional error context
    string context = 2;
  }
  enum LogLevel {
    NOTSET = 0;
    DEBUG = 1;
    INFO = 2;
    WARN = 3;
    ERROR = 4;
    CRITICAL = 5;
  }

  // Logging level for this message
  // gcloud defaults to INFO (e.g. show INFO, WARN, ERROR and CRITICAL)
  LogLevel verbosity = 5;
  // (Optional) If this message is an error then this field should be included
  ErrorDetail error_detail = 6;
}
