// GENERATED CODE -- DO NOT EDIT!

// Original file comments:
//
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements.  See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You 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.
//
//
'use strict';
var grpc = require('@grpc/grpc-js');
var event_Event_pb = require('../event/Event_pb.js');
var common_Common_pb = require('../common/Common_pb.js');

function serialize_skywalking_v3_Commands(arg) {
  if (!(arg instanceof common_Common_pb.Commands)) {
    throw new Error('Expected argument of type skywalking.v3.Commands');
  }
  return Buffer.from(arg.serializeBinary());
}

function deserialize_skywalking_v3_Commands(buffer_arg) {
  return common_Common_pb.Commands.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_skywalking_v3_Event(arg) {
  if (!(arg instanceof event_Event_pb.Event)) {
    throw new Error('Expected argument of type skywalking.v3.Event');
  }
  return Buffer.from(arg.serializeBinary());
}

function deserialize_skywalking_v3_Event(buffer_arg) {
  return event_Event_pb.Event.deserializeBinary(new Uint8Array(buffer_arg));
}


var EventServiceService = exports.EventServiceService = {
  // When reporting an event, you typically call the collect function twice, one for starting of the event and the other one for ending of the event, with the same UUID.
// There are also cases where you have both start time and end time already, for example, when exporting events from a 3rd-party system,
// the start time and end time are already known so that you can call the collect function only once.
collect: {
    path: '/skywalking.v3.EventService/collect',
    requestStream: true,
    responseStream: false,
    requestType: event_Event_pb.Event,
    responseType: common_Common_pb.Commands,
    requestSerialize: serialize_skywalking_v3_Event,
    requestDeserialize: deserialize_skywalking_v3_Event,
    responseSerialize: serialize_skywalking_v3_Commands,
    responseDeserialize: deserialize_skywalking_v3_Commands,
  },
};

exports.EventServiceClient = grpc.makeGenericClientConstructor(EventServiceService, 'EventService');
