// Copyright 2019 Istio Authors. All Rights Reserved.
//
// 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.sample.myApa;

import "mixer/adapter/model/v1beta1/extensions.proto";
import "policy/v1beta1/type.proto";

option (istio.mixer.adapter.model.v1beta1.template_variety) = TEMPLATE_VARIETY_ATTRIBUTE_GENERATOR;

/* myapa template is ..
*/
message Template {
    int64 int64Primitive = 1;

    bool boolPrimitive = 2;

    double doublePrimitive = 3;

    string stringPrimitive = 4;

    map<string, int64> dimensionsFixedInt64ValueDType = 5;

    istio.policy.v1beta1.TimeStamp timeStamp = 6;

    istio.policy.v1beta1.Duration duration = 7;

    map<string, Resource3> res3_map = 8;

    istio.policy.v1beta1.IPAddress optionalIP = 9;

    istio.policy.v1beta1.EmailAddress email = 10;
}

message OutputTemplate {

    int64 int64Primitive = 1;

    bool boolPrimitive = 2;

    double doublePrimitive = 3;

    string stringPrimitive = 4;

    istio.policy.v1beta1.TimeStamp timeStamp = 6;

    istio.policy.v1beta1.Duration duration = 7;

    istio.policy.v1beta1.EmailAddress email = 10;

    istio.policy.v1beta1.IPAddress out_ip = 11;

    map<string, string> out_str_map = 12;
}


message Resource1 {
    string str = 1;
    Resource1 self_ref_res1 = 3;
    Resource2 resRef2 = 2;
}

message Resource2 {
    string str = 1;
    Resource3 res3 = 2;
    map<string, Resource3> res3_map = 3;
}

// resource3 comment
message Resource3 {

    int64 int64Primitive = 1;

    bool boolPrimitive = 2;

    double doublePrimitive = 3;

    string stringPrimitive = 4;

    map<string, int64> dimensionsFixedInt64ValueDType = 5;

    istio.policy.v1beta1.TimeStamp timeStamp = 6;

    istio.policy.v1beta1.Duration duration = 7;
}
