// Copyright 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 foo;

import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "policy/v1beta1/type.proto";

message Empty {}

message Simple {

  bytes byts = 12;


  // complex types
  map<string, string> map_str_str = 18;
  map<string, other> map_str_msg = 19;
  map<int32, other> map_i32_msg = 20;
  map<string, myenum> map_str_enum = 21;
  map<int64, double> map_int64_double = 123;
  map<fixed32, myenum> map_fixed32_enum = 124;

  map<string, float> map_str_float = 125;
  map<string, uint64> map_str_uint64 = 126;
  map<string, uint32> map_str_uint32 = 132;
  map<string, fixed64> map_str_fixed64 = 133;
  map<string, bool> map_str_bool = 134;
  map<string, sfixed32> map_str_sfixed32 = 127;
  map<string, sfixed64> map_str_sfixed64 = 128;
  map<string, sint32> map_str_sint32 = 129;
  map<string, sint64> map_str_sint64 = 130;

  other oth = 11; //
  repeated other r_oth = 26;

  myenum enm = 13; //
  repeated myenum r_enm = 28;
  repeated myenum r_enm_unpacked = 281 [packed = false];

  double dbl = 2; //
  repeated double r_dbl = 23;
  repeated double r_dbl_unpacked = 24 [packed = false];

  float flt = 29; //
  repeated float r_flt = 30;
  repeated float r_flt_unpacked = 31 [packed = false];

  int64 i64 = 32; //
  repeated int64 r_i64 = 33;
  repeated int64 r_i64_unpacked = 34 [packed = false];

  int32 i32 = 35; //
  repeated int32 r_i32 = 36;
  repeated int32 r_i32_unpacked = 37 [packed = false];

  uint64 ui64 = 38; //
  repeated uint64 r_ui64 = 39;
  repeated uint64 r_ui64_unpacked = 40 [packed = false];

  uint32 ui32 = 41; //
  repeated uint32 r_ui32 = 42;
  repeated uint32 r_ui32_unpacked = 43 [packed = false];

  fixed64 f64 = 44; //
  repeated fixed64 r_f64 = 45;
  repeated fixed64 r_f64_unpacked = 46 [packed = false];

  sfixed64 sf64 = 47; //
  repeated sfixed64 r_sf64 = 48;
  repeated sfixed64 r_sf64_unpacked = 49 [packed = false];

  fixed32 f32 = 50; //
  repeated fixed32 r_f32 = 51;
  repeated fixed32 r_f32_unpacked = 52 [packed = false];

  sfixed32 sf32 = 53; //
  repeated sfixed32 r_sf32 = 54;
  repeated sfixed32 r_sf32_unpacked = 55 [packed = false];

  bool b = 4; //
  repeated bool r_b = 56;
  repeated bool r_b_unpacked = 57 [packed = false];

  string str = 1;
  repeated string r_str = 58;

  sint32 si32 = 59; //
  repeated sint32 r_si32 = 60;
  repeated sint32 r_si32_unpacked = 61 [packed = false];

  sint64 si64 = 62; //
  repeated sint64 r_si64 = 63;
  repeated sint64 r_si64_unpacked = 64 [packed = false];

  istio.policy.v1beta1.Value istio_value = 65;
  map<string, istio.policy.v1beta1.Value> map_str_istio_value = 66;

  istio.policy.v1beta1.IPAddress ipaddress_istio_value = 67;
  map<string, istio.policy.v1beta1.IPAddress> map_str_ipaddress_istio_value = 68;

  istio.policy.v1beta1.Duration duration_istio_value = 69;
  map<string, istio.policy.v1beta1.Duration> map_str_duration_istio_value = 70;

  istio.policy.v1beta1.TimeStamp timestamp_istio_value = 71;
  map<string, istio.policy.v1beta1.TimeStamp> map_str_timestamp_istio_value = 72;

  istio.policy.v1beta1.DNSName dnsname_istio_value = 73;
  map<string, istio.policy.v1beta1.DNSName> map_str_dnsname_istio_value = 74;

  istio.policy.v1beta1.EmailAddress emailaddress_istio_value = 75;
  map<string, istio.policy.v1beta1.EmailAddress> map_str_emailaddress_istio_value = 76;

  istio.policy.v1beta1.Uri uri_istio_value = 77;
  map<string, istio.policy.v1beta1.Uri> map_str_uri_istio_value = 78;

  google.protobuf.Duration google_protobuf_duration = 79;
  google.protobuf.Timestamp google_protobuf_timestamp = 80;
}

message other {
  enum innerenum {
    INNERONE = 0;
    INNERTWO = 1;
    INNERTHREE = 2;
  }

  message innerMsg {
    string str = 1;
    double dbl = 2;
    int64 i64 = 3;
  }

  string str = 1;
  double dbl = 2;
  int64 i64 = 3;
  bool b = 4;
  innerenum inenum = 5;
  innerMsg inmsg = 6;
}

enum myenum {
  ONE = 0;
  TWO = 1;
  THREE = 2;
}

message Outer {
  message Inner {
    string str = 1;
    double dbl = 2;
    int64 i64 = 3;
    bool b = 4;
  }
  Inner in = 1;
}
