@@ -58,7 +58,7 @@ class {{ service.name | caseUcfirst }} : Service {
5858 .replace("{{ ' {' ~ parameter .name | caseCamel ~ ' }' }}", {{ parameter .name | caseCamel }})
5959 {%~ endfor %}
6060
61- val params = mutableMapOf<String , Any ?>(
61+ val apiParams = mutableMapOf<String , Any ?>(
6262 {%~ for parameter in method .parameters .query | merge(method .parameters .body ) %}
6363 "{{ parameter .name }}" to {{ parameter .name | caseCamel }},
6464 {%~ endfor %}
@@ -73,25 +73,25 @@ class {{ service.name | caseUcfirst }} : Service {
7373 {%~ endif %}
7474 )
7575 {%~ if method .type == ' webAuth' %}
76- val query = mutableListOf<String >()
77- params .forEach {
76+ val apiQuery = mutableListOf<String >()
77+ apiParams .forEach {
7878 when (it.value) {
7979 null -> {
8080 return@forEach
8181 }
8282 is List< *> -> {
83- query .add("${it.key}[]=${it.value.toString()}")
83+ apiQuery .add("${it.key}[]=${it.value.toString()}")
8484 }
8585 else -> {
86- query .add("${it.key}=${it.value.toString()}")
86+ apiQuery .add("${it.key}=${it.value.toString()}")
8787 }
8888 }
8989 }
9090
91- val url = Uri.parse("${client.endPoint}${apiPath}?${query .joinToString("& ")}")
91+ val apiUrl = Uri.parse("${client.endPoint}${apiPath}?${apiQuery .joinToString("& ")}")
9292 val callbackUrlScheme = "{{ spec .title | caseLower }}-callback-${client.config["project"]}"
9393
94- WebAuthComponent.authenticate(activity, url , callbackUrlScheme) {
94+ WebAuthComponent.authenticate(activity, apiUrl , callbackUrlScheme) {
9595 if (it.isFailure) {
9696 throw it.exceptionOrNull()!!
9797 }
@@ -119,11 +119,11 @@ class {{ service.name | caseUcfirst }} : Service {
119119 return client.call(
120120 "{{ method .method | caseUpper }}",
121121 apiPath,
122- params = params ,
122+ params = apiParams ,
123123 responseType = {{ method | returnType(spec , sdk .namespace | caseDot ) | raw }}::class.java
124124 )
125125 {%~ else %}
126- val headers = mutableMapOf(
126+ val apiHeaders = mutableMapOf(
127127 {%~ for key , header in method .headers %}
128128 "{{ key }}" to "{{ header }}",
129129 {%~ endfor %}
@@ -147,8 +147,8 @@ class {{ service.name | caseUcfirst }} : Service {
147147 {%~ endfor %}
148148 return client.chunkedUpload(
149149 apiPath,
150- headers ,
151- params ,
150+ apiHeaders ,
151+ apiParams ,
152152 responseType = {{ method | returnType(spec , sdk .namespace | caseDot ) | raw }}::class.java,
153153 {%~ if method .responseModel %}
154154 converter,
@@ -161,8 +161,8 @@ class {{ service.name | caseUcfirst }} : Service {
161161 return client.call(
162162 "{{ method .method | caseUpper }}",
163163 apiPath,
164- headers ,
165- params ,
164+ apiHeaders ,
165+ apiParams ,
166166 {%~ if method .responseModel | hasGenericType(spec ) %}
167167 responseType = classOf(),
168168 {%~ else %}
0 commit comments