// Copyright 2016 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.v1;

option go_package = "istio.io/api/mixer/v1";

import "gogoproto/gogo.proto";
import "mixer/v1/attributes.proto";

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

// Used to report telemetry after performing one or more actions.
message ReportRequest {
  // The attributes to use for this request.
  //
  // Each `Attributes` element represents the state of a single action. Multiple actions
  // can be provided in a single message in order to improve communication efficiency. The
  // client can accumulate a set of actions and send them all in one single message.
  //
  // Although each `Attributes` message is semantically treated as an independent
  // stand-alone entity unrelated to the other attributes within the message, this
  // message format leverages delta-encoding between attribute messages in order to
  // substantially reduce the request size and improve end-to-end efficiency. Each
  // individual set of attributes is used to modify the previous set. This eliminates
  // the need to redundantly send the same attributes multiple times over within
  // a single request.
  //
  // If a client is not sophisticated and doesn't want to use delta-encoding,
  // a degenerate case is to include all attributes in every individual message.
  repeated CompressedAttributes attributes = 1 [(gogoproto.nullable) = false];

  // The default message-level dictionary for all the attributes.
  // Individual attribute messages can have their own dictionaries, but if they don't
  // then this set of words, if it is provided, is used instead.
  //
  // This makes it possible to share the same dictionary for all attributes in this
  // request, which can substantially reduce the overall request size.
  repeated string default_words = 2;

  // The number of words in the global dictionary.
  // To detect global dictionary out of sync between client and server.
  uint32 global_word_count = 3;
}

// Used to carry responses to telemetry reports
message ReportResponse {
}
