@@ -165,4 +165,49 @@ class {{ service.name | caseUcfirst }} : Service {
165
165
{%~ endif %}
166
166
{%~ endif %}
167
167
}
168
+
169
+ {%~ if method .responseModel | hasGenericType(spec ) %}
170
+ /**
171
+ * {{ method .title }}
172
+ *
173
+ * {{ method .description | raw | replace({" \n" : " " , " \r" : " " }) }}
174
+ *
175
+ {%~ for parameter in method .parameters .all %}
176
+ * @param {{ parameter .name | caseCamel }} {{ parameter .description | raw }}
177
+ {%~ endfor %}
178
+ {%~ if method .type != " webAuth" %}
179
+ * @return [{{ method | returnType(spec , sdk .namespace | caseDot ) | raw }}]
180
+ {%~ endif %}
181
+ */
182
+ {%~ if method .parameters .all | reduce((carry , param ) => carry or not param .required ) %}
183
+ @JvmOverloads
184
+ {%~ endif %}
185
+ @Throws({{ spec .title | caseUcfirst }}Exception::class)
186
+ suspend fun {{ method .name | caseCamel }}(
187
+ {%~ if method .type == " webAuth" %}
188
+ activity: ComponentActivity,
189
+ {%~ endif %}
190
+ {%~ for parameter in method .parameters .all %}
191
+ {{ parameter .name | caseCamel }}: {{ parameter | typeName }}{%~ if not parameter .required %}? = null{% endif %},
192
+ {%~ endfor %}
193
+ {%~ if ' multipart/form-data' in method .consumes %}
194
+ onProgress: ((UploadProgress) -> Unit)? = null
195
+ {%~ endif %}
196
+ ) = {{ method .name | caseCamel }}(
197
+ {%~ if method .type == " webAuth" %}
198
+ activity,
199
+ {%~ endif %}
200
+ {%~ for parameter in method .parameters .all %}
201
+ {{ parameter .name | caseCamel }},
202
+ {%~ endfor %}
203
+ {%~ if method .responseModel | hasGenericType(spec ) %}
204
+ nestedType = (typeOf<Map <String , Any >>().classifier!! as KClass<Map <String , Any >>).java,
205
+ {%~ endif %}
206
+ {%~ if ' multipart/form-data' in method .consumes %}
207
+ onProgress = onProgress
208
+ {%~ endif %}
209
+ )
210
+ {%~ endif %}
211
+
212
+ {%~ endfor %}
168
213
}
0 commit comments