@@ -98,15 +98,15 @@ class {{ service.py_name }}Stub(betterproto2.ServiceStub):
9898 {% for method in service .methods %}
9999 async def {{ method.py_name }}(self
100100 {% - if not method .client_streaming -%}
101- , {{ method.py_input_message_param }} :
101+ , message :
102102 {% - if method .is_input_msg_empty -%}
103103 "{{ output_file.settings.typing_compiler.optional(method.py_input_message_type) }}" = None
104104 {% - else -%}
105105 "{{ method.py_input_message_type }}"
106106 {% - endif -%}
107107 {% - else -%}
108108 {# Client streaming: need a request iterator instead #}
109- , {{ method.py_input_message_param }}_iterator : "{{ output_file.settings.typing_compiler.union(output_file.settings.typing_compiler.async_iterable(method.py_input_message_type), output_file.settings.typing_compiler.iterable(method.py_input_message_type)) }}"
109+ , messages : "{{ output_file.settings.typing_compiler.union(output_file.settings.typing_compiler.async_iterable(method.py_input_message_type), output_file.settings.typing_compiler.iterable(method.py_input_message_type)) }}"
110110 {% - endif -%}
111111 ,
112112 *
@@ -128,7 +128,7 @@ class {{ service.py_name }}Stub(betterproto2.ServiceStub):
128128 {% if method .client_streaming %}
129129 async for response in self._stream_stream(
130130 "{{ method.route }}",
131- {{ method.py_input_message_param }}_iterator ,
131+ messages ,
132132 {{ method.py_input_message_type }},
133133 {{ method.py_output_message_type }},
134134 timeout=timeout,
@@ -138,13 +138,13 @@ class {{ service.py_name }}Stub(betterproto2.ServiceStub):
138138 yield response
139139 {% else %} {# i.e. not client streaming #}
140140 {% if method .is_input_msg_empty %}
141- if {{ method.py_input_message_param }} is None:
142- {{ method.py_input_message_param }} = {{ method.py_input_message_type }}()
141+ if message is None:
142+ message = {{ method.py_input_message_type }}()
143143
144144 {% endif %}
145145 async for response in self._unary_stream(
146146 "{{ method.route }}",
147- {{ method.py_input_message_param }} ,
147+ message ,
148148 {{ method.py_output_message_type }},
149149 timeout=timeout,
150150 deadline=deadline,
@@ -157,7 +157,7 @@ class {{ service.py_name }}Stub(betterproto2.ServiceStub):
157157 {% if method .client_streaming %}
158158 return await self._stream_unary(
159159 "{{ method.route }}",
160- {{ method.py_input_message_param }}_iterator ,
160+ messages ,
161161 {{ method.py_input_message_type }},
162162 {{ method.py_output_message_type }},
163163 timeout=timeout,
@@ -166,13 +166,13 @@ class {{ service.py_name }}Stub(betterproto2.ServiceStub):
166166 )
167167 {% else %} {# i.e. not client streaming #}
168168 {% if method .is_input_msg_empty %}
169- if {{ method.py_input_message_param }} is None:
170- {{ method.py_input_message_param }} = {{ method.py_input_message_type }}()
169+ if message is None:
170+ message = {{ method.py_input_message_type }}()
171171
172172 {% endif %}
173173 return await self._unary_unary(
174174 "{{ method.route }}",
175- {{ method.py_input_message_param }} ,
175+ message ,
176176 {{ method.py_output_message_type }},
177177 timeout=timeout,
178178 deadline=deadline,
@@ -199,10 +199,10 @@ class {{ service.py_name }}Base(ServiceBase):
199199 {% for method in service .methods %}
200200 async def {{ method.py_name }}(self
201201 {% - if not method .client_streaming -%}
202- , {{ method.py_input_message_param }} : "{{ method.py_input_message_type }}"
202+ , message : "{{ method.py_input_message_type }}"
203203 {% - else -%}
204204 {# Client streaming: need a request iterator instead #}
205- , {{ method.py_input_message_param }}_iterator : {{ output_file.settings.typing_compiler.async_iterator(method.py_input_message_type) }}
205+ , messages : {{ output_file.settings.typing_compiler.async_iterator(method.py_input_message_type) }}
206206 {% - endif -%}
207207 ) -> {% if method .server_streaming %} {{ output_file.settings.typing_compiler.async_iterator(method.py_output_message_type) }}{% else %} "{{ method.py_output_message_type }}"{% endif %} :
208208 {% if method .comment %}
0 commit comments