Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
bosdyn-api / api / keepalive / keepalive_service_pb2_grpc.py
Size: Mime:
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from bosdyn.api.keepalive import keepalive_pb2 as bosdyn_dot_api_dot_keepalive_dot_keepalive__pb2


class KeepaliveServiceStub(object):
    """The Keepalive service allows users to specify what the system should do when one or more clients
    stop communicating with the robot. The actions, and when those actions happen, are specified in a
    Policy. Clients will periodically check in with the Keepalive service to prevent the actions from
    happening.

    This service is in BETA and may undergo changes in future releases.
    """

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

        Args:
            channel: A grpc.Channel.
        """
        self.ModifyPolicy = channel.unary_unary(
                '/bosdyn.api.keepalive.KeepaliveService/ModifyPolicy',
                request_serializer=bosdyn_dot_api_dot_keepalive_dot_keepalive__pb2.ModifyPolicyRequest.SerializeToString,
                response_deserializer=bosdyn_dot_api_dot_keepalive_dot_keepalive__pb2.ModifyPolicyResponse.FromString,
                )
        self.CheckIn = channel.unary_unary(
                '/bosdyn.api.keepalive.KeepaliveService/CheckIn',
                request_serializer=bosdyn_dot_api_dot_keepalive_dot_keepalive__pb2.CheckInRequest.SerializeToString,
                response_deserializer=bosdyn_dot_api_dot_keepalive_dot_keepalive__pb2.CheckInResponse.FromString,
                )
        self.GetStatus = channel.unary_unary(
                '/bosdyn.api.keepalive.KeepaliveService/GetStatus',
                request_serializer=bosdyn_dot_api_dot_keepalive_dot_keepalive__pb2.GetStatusRequest.SerializeToString,
                response_deserializer=bosdyn_dot_api_dot_keepalive_dot_keepalive__pb2.GetStatusResponse.FromString,
                )


class KeepaliveServiceServicer(object):
    """The Keepalive service allows users to specify what the system should do when one or more clients
    stop communicating with the robot. The actions, and when those actions happen, are specified in a
    Policy. Clients will periodically check in with the Keepalive service to prevent the actions from
    happening.

    This service is in BETA and may undergo changes in future releases.
    """

    def ModifyPolicy(self, request, context):
        """Add and/or remove policies of the session.
        Adding or removing only happens if all parts of the request are valid. For example, if the
        policy to be added is valid, but policies to be removed are not valid, no policy is added.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def CheckIn(self, request, context):
        """Refresh the timer on a specific policy.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def GetStatus(self, request, context):
        """Get the status of the current session.
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_KeepaliveServiceServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'ModifyPolicy': grpc.unary_unary_rpc_method_handler(
                    servicer.ModifyPolicy,
                    request_deserializer=bosdyn_dot_api_dot_keepalive_dot_keepalive__pb2.ModifyPolicyRequest.FromString,
                    response_serializer=bosdyn_dot_api_dot_keepalive_dot_keepalive__pb2.ModifyPolicyResponse.SerializeToString,
            ),
            'CheckIn': grpc.unary_unary_rpc_method_handler(
                    servicer.CheckIn,
                    request_deserializer=bosdyn_dot_api_dot_keepalive_dot_keepalive__pb2.CheckInRequest.FromString,
                    response_serializer=bosdyn_dot_api_dot_keepalive_dot_keepalive__pb2.CheckInResponse.SerializeToString,
            ),
            'GetStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.GetStatus,
                    request_deserializer=bosdyn_dot_api_dot_keepalive_dot_keepalive__pb2.GetStatusRequest.FromString,
                    response_serializer=bosdyn_dot_api_dot_keepalive_dot_keepalive__pb2.GetStatusResponse.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'bosdyn.api.keepalive.KeepaliveService', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class KeepaliveService(object):
    """The Keepalive service allows users to specify what the system should do when one or more clients
    stop communicating with the robot. The actions, and when those actions happen, are specified in a
    Policy. Clients will periodically check in with the Keepalive service to prevent the actions from
    happening.

    This service is in BETA and may undergo changes in future releases.
    """

    @staticmethod
    def ModifyPolicy(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/bosdyn.api.keepalive.KeepaliveService/ModifyPolicy',
            bosdyn_dot_api_dot_keepalive_dot_keepalive__pb2.ModifyPolicyRequest.SerializeToString,
            bosdyn_dot_api_dot_keepalive_dot_keepalive__pb2.ModifyPolicyResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def CheckIn(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/bosdyn.api.keepalive.KeepaliveService/CheckIn',
            bosdyn_dot_api_dot_keepalive_dot_keepalive__pb2.CheckInRequest.SerializeToString,
            bosdyn_dot_api_dot_keepalive_dot_keepalive__pb2.CheckInResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def GetStatus(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/bosdyn.api.keepalive.KeepaliveService/GetStatus',
            bosdyn_dot_api_dot_keepalive_dot_keepalive__pb2.GetStatusRequest.SerializeToString,
            bosdyn_dot_api_dot_keepalive_dot_keepalive__pb2.GetStatusResponse.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)