diff --git a/python/descriptor.c b/python/descriptor.c index 2e4c44787c..be1a839ac2 100644 --- a/python/descriptor.c +++ b/python/descriptor.c @@ -1441,6 +1441,18 @@ static PyObject* PyUpb_MethodDescriptor_GetOutputType(PyObject* self, return PyUpb_Descriptor_Get(upb_MethodDef_OutputType(m)); } +static PyObject* PyUpb_MethodDescriptor_GetClientStreaming(PyObject* self, + void* closure) { + const upb_MethodDef* m = PyUpb_MethodDescriptor_GetDef(self); + return PyBool_FromLong(upb_MethodDef_ClientStreaming(m) ? 1 : 0); +} + +static PyObject* PyUpb_MethodDescriptor_GetServerStreaming(PyObject* self, + void* closure) { + const upb_MethodDef* m = PyUpb_MethodDescriptor_GetDef(self); + return PyBool_FromLong(upb_MethodDef_ServerStreaming(m) ? 1 : 0); +} + static PyObject* PyUpb_MethodDescriptor_GetOptions(PyObject* _self, PyObject* args) { PyUpb_DescriptorBase* self = (void*)_self; @@ -1467,6 +1479,10 @@ static PyGetSetDef PyUpb_MethodDescriptor_Getters[] = { NULL}, {"output_type", PyUpb_MethodDescriptor_GetOutputType, NULL, "Output type", NULL}, + {"client_streaming", PyUpb_MethodDescriptor_GetClientStreaming, NULL, + "Client streaming", NULL}, + {"server_streaming", PyUpb_MethodDescriptor_GetServerStreaming, NULL, + "Server streaming", NULL}, {NULL}}; static PyMethodDef PyUpb_MethodDescriptor_Methods[] = {