# Copyright (c) 2020, NVIDIA CORPORATION.  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.

# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc

from nvidia_clara.grpc import clara_pb2 as nvidia_dot_clara_dot_platform_dot_clara__pb2


class ClaraStub(object):
  # missing associated documentation comment in .proto file
  pass

  def __init__(self, channel):
    """Constructor.

    Args:
      channel: A grpc.Channel.
    """
    self.Stop = channel.unary_unary(
        '/nvidia.clara.platform.Clara/Stop',
        request_serializer=nvidia_dot_clara_dot_platform_dot_clara__pb2.ClaraStopRequest.SerializeToString,
        response_deserializer=nvidia_dot_clara_dot_platform_dot_clara__pb2.ClaraStopResponse.FromString,
        )
    self.Utilization = channel.unary_stream(
        '/nvidia.clara.platform.Clara/Utilization',
        request_serializer=nvidia_dot_clara_dot_platform_dot_clara__pb2.ClaraUtilizationRequest.SerializeToString,
        response_deserializer=nvidia_dot_clara_dot_platform_dot_clara__pb2.ClaraUtilizationResponse.FromString,
        )
    self.Version = channel.unary_unary(
        '/nvidia.clara.platform.Clara/Version',
        request_serializer=nvidia_dot_clara_dot_platform_dot_clara__pb2.ClaraVersionRequest.SerializeToString,
        response_deserializer=nvidia_dot_clara_dot_platform_dot_clara__pb2.ClaraVersionResponse.FromString,
        )


class ClaraServicer(object):
  # missing associated documentation comment in .proto file
  pass

  def Stop(self, request, context):
    """Requests the termination of Clara Platform Server and associated resource cleanup.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Utilization(self, request, context):
    """Requests utilization data for all Clara Platform managed GPUs.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')

  def Version(self, request, context):
    """Requests version information from Clara Platform Server.
    """
    context.set_code(grpc.StatusCode.UNIMPLEMENTED)
    context.set_details('Method not implemented!')
    raise NotImplementedError('Method not implemented!')


def add_ClaraServicer_to_server(servicer, server):
  rpc_method_handlers = {
      'Stop': grpc.unary_unary_rpc_method_handler(
          servicer.Stop,
          request_deserializer=nvidia_dot_clara_dot_platform_dot_clara__pb2.ClaraStopRequest.FromString,
          response_serializer=nvidia_dot_clara_dot_platform_dot_clara__pb2.ClaraStopResponse.SerializeToString,
      ),
      'Utilization': grpc.unary_stream_rpc_method_handler(
          servicer.Utilization,
          request_deserializer=nvidia_dot_clara_dot_platform_dot_clara__pb2.ClaraUtilizationRequest.FromString,
          response_serializer=nvidia_dot_clara_dot_platform_dot_clara__pb2.ClaraUtilizationResponse.SerializeToString,
      ),
      'Version': grpc.unary_unary_rpc_method_handler(
          servicer.Version,
          request_deserializer=nvidia_dot_clara_dot_platform_dot_clara__pb2.ClaraVersionRequest.FromString,
          response_serializer=nvidia_dot_clara_dot_platform_dot_clara__pb2.ClaraVersionResponse.SerializeToString,
      ),
  }
  generic_handler = grpc.method_handlers_generic_handler(
      'nvidia.clara.platform.Clara', rpc_method_handlers)
  server.add_generic_rpc_handlers((generic_handler,))
