// Copyright 2020 Dolthub, Inc.
//
// 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.

// WARNING: This file was is automatically generated. DO NOT EDIT BY HAND.


syntax = "proto3";

package dolt.services.eventsapi.v1alpha1;

option go_package = "github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi/v1alpha1;eventsapi";

import "dolt/services/eventsapi/v1alpha1/event_constants.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";

service ClientEventsService {
  rpc LogEvents(LogEventsRequest) returns (LogEventsResponse);
}

message ClientEventAttribute {
    dolt.services.eventsapi.v1alpha1.AttributeID id = 1;
    string value = 2;
}

message ClientEventMetric {
    oneof metric_oneof {
        google.protobuf.Duration duration = 1;
        int32 count = 2;
    }

    dolt.services.eventsapi.v1alpha1.MetricID metric_id = 100;
}

message ClientEvent {
    string id = 1;
    google.protobuf.Timestamp start_time = 2;
    google.protobuf.Timestamp end_time = 3;
    dolt.services.eventsapi.v1alpha1.ClientEventType type = 4;
    repeated ClientEventAttribute attributes = 5;
    repeated ClientEventMetric metrics = 6;
}

message LogEventsRequest {
    string machine_id = 1;
    string extra = 2;
    string version = 3;
    dolt.services.eventsapi.v1alpha1.Platform platform = 4;
    repeated ClientEvent events = 5;
    dolt.services.eventsapi.v1alpha1.AppID app = 6;
}

message LogEventsResponse {
}
