Beispiel #1
0
def _call_pdm_method(self, method_name, **kwargs):
    pb2_params = PdmObject_pb2.PdmObject(class_keyword=method_name)
    for key, value in kwargs.items():
        pb2_params.parameters[snake_to_camel(key)] = self.__convert_to_grpc_value(value)
    request = PdmObject_pb2.PdmObjectMethodRequest(
        object=self._pb2_object, method=method_name, params=pb2_params)

    pb2_object = self._pdm_object_stub.CallPdmObjectMethod(request)

    child_class_definition = class_from_keyword(pb2_object.class_keyword)
    if child_class_definition is None:
        return None

    pdm_object = child_class_definition(pb2_object=pb2_object, channel=self.channel())
    return pdm_object
Beispiel #2
0
def _call_pdm_method(self, method_name, **kwargs):
    pb2_params = PdmObject_pb2.PdmObject(class_keyword=method_name)
    for key, value in kwargs.items():
        pb2_params.parameters[snake_to_camel(key)] = self.__convert_to_grpc_value(value)
    request = PdmObject_pb2.PdmObjectMethodRequest(object=self._pb2_object, method=method_name, params=pb2_params)
    return self._pdm_object_stub.CallPdmObjectMethod(request)