// Copyright 2026 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.saasplatform.saasservicemgmt.logging.v1;

import "google/rpc/status.proto";

option csharp_namespace = "Google.Cloud.SaasPlatform.SaasServiceMgmt.Logging.V1";
option go_package = "cloud.google.com/go/saasplatform/saasservicemgmt/logging/apiv1/loggingpb;loggingpb";
option java_multiple_files = true;
option java_outer_classname = "RolloutLogProto";
option java_package = "com.google.cloud.saasplatform.saasservicemgmt.logging.v1";
option php_namespace = "Google\\Cloud\\SaasPlatform\\SaasServiceMgmt\\Logging\\V1";
option ruby_package = "Google::Cloud::SaasPlatform::SaasServiceMgmt::Logging::V1";

// Log message for Rollout events.
message RolloutLog {
  // Unique identifier of the root rollout.
  string root_rollout_id = 1;

  // Specified rollout type associated with this rollout.
  string rollout_kind = 2;

  // Strategy used for executing this rollout.
  string rollout_orchestration_strategy = 3;

  // The previous state of the rollout, e.g. RUNNING.
  RolloutState prev_state = 4;

  // The current running state of the rollout, e.g. PAUSED.
  RolloutState current_state = 5;

  // Brief description for the rollout event, e.g. “Waiting to start rollout.”
  string reason = 6;

  // A human readable string that specifies relevant information about the
  // rollout’s last transition,
  //  e.g. “Soaking for 2 hours.”
  string message = 7;

  // Associated status corresponding to the event this log describes,
  // corresponds to the status of the actionable error message.
  google.rpc.Status error = 8;
}

// The state of the rollout.
enum RolloutState {
  // Unspecified state.
  ROLLOUT_STATE_UNSPECIFIED = 0;

  // Rollout is in progress.
  RUNNING = 1;

  // Rollout has been paused.
  PAUSED = 2;

  // Rollout is being paused.
  PAUSING = 3;

  // Rollout is being resumed.
  RESUMING = 4;

  // Rollout has been cancelled.
  CANCELLED = 5;

  // Rollout has failed.
  FAILED = 6;

  // Rollout is waiting for some condition to be met before starting.
  WAITING = 7;

  // Rollout completed successfully.
  SUCCEEDED = 8;

  // Rollout is being canceled.
  CANCELLING = 9;
}
