// 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 service$mesh$probe_service$mesh_pb = require('../service-mesh-probe/service-mesh_pb.js');
var common_Common_pb = require('../common/Common_pb.js');

function serialize_skywalking_v3_MeshProbeDownstream(arg) {
  if (!(arg instanceof service$mesh$probe_service$mesh_pb.MeshProbeDownstream)) {
    throw new Error('Expected argument of type skywalking.v3.MeshProbeDownstream');
  }
  return Buffer.from(arg.serializeBinary());
}

function deserialize_skywalking_v3_MeshProbeDownstream(buffer_arg) {
  return service$mesh$probe_service$mesh_pb.MeshProbeDownstream.deserializeBinary(new Uint8Array(buffer_arg));
}

function serialize_skywalking_v3_ServiceMeshMetric(arg) {
  if (!(arg instanceof service$mesh$probe_service$mesh_pb.ServiceMeshMetric)) {
    throw new Error('Expected argument of type skywalking.v3.ServiceMeshMetric');
  }
  return Buffer.from(arg.serializeBinary());
}

function deserialize_skywalking_v3_ServiceMeshMetric(buffer_arg) {
  return service$mesh$probe_service$mesh_pb.ServiceMeshMetric.deserializeBinary(new Uint8Array(buffer_arg));
}


// Define metrics report service. The metrics format is typically representing the data model collected in the service mesh case.
var ServiceMeshMetricServiceService = exports.ServiceMeshMetricServiceService = {
  collect: {
    path: '/skywalking.v3.ServiceMeshMetricService/collect',
    requestStream: true,
    responseStream: false,
    requestType: service$mesh$probe_service$mesh_pb.ServiceMeshMetric,
    responseType: service$mesh$probe_service$mesh_pb.MeshProbeDownstream,
    requestSerialize: serialize_skywalking_v3_ServiceMeshMetric,
    requestDeserialize: deserialize_skywalking_v3_ServiceMeshMetric,
    responseSerialize: serialize_skywalking_v3_MeshProbeDownstream,
    responseDeserialize: deserialize_skywalking_v3_MeshProbeDownstream,
  },
};

exports.ServiceMeshMetricServiceClient = grpc.makeGenericClientConstructor(ServiceMeshMetricServiceService, 'ServiceMeshMetricService');
