// Copyright 2018 Istio Authors
//
// 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 istio.mixer.adapter.model.v1beta1;

option go_package="istio.io/api/mixer/adapter/model/v1beta1";

import "gogoproto/gogo.proto";
import "google/protobuf/duration.proto";
import "google/rpc/status.proto";

option (gogoproto.goproto_getters_all) = false;
option (gogoproto.equal_all) = false;
option (gogoproto.gostring_all) = false;

// Expresses the result of a precondition check.
message CheckResult {
  // A status code of OK indicates preconditions were satisfied. Any other code indicates preconditions were not
  // satisfied and details describe why.
  google.rpc.Status status = 1 [(gogoproto.nullable) = false];
  // The amount of time for which this result can be considered valid.
  google.protobuf.Duration valid_duration = 2 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true];
  // The number of uses for which this result can be considered valid.
  int32 valid_use_count = 3;
}
