Skip to content

Commit 8f318cd

Browse files
committed
feat: fix kotlin documentation
1 parent 472e7c9 commit 8f318cd

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed
Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
import {{ sdk.namespace | caseDot }}.Client
22
import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }}
33

4-
val client = Client(context)
4+
suspend fun main() {
5+
val client = Client(context)
56
{% if method.security|length > 0 %}
6-
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
78
{% for node in method.security %}
89
{% for key,header in node|keys %}
9-
.set{{header | caseUcfirst}}("{{node[header]['x-appwrite']['demo']}}") // {{node[header].description}}
10+
.set{{header | caseUcfirst}}("{{node[header]['x-appwrite']['demo']}}") // {{node[header].description}}
1011
{% endfor %}{% endfor %}{% endif %}
1112

12-
val {{ service.name | caseCamel }}Service = {{ service.name | caseUcfirst }}(client)
13-
val response = {{ service.name | caseCamel }}Service.{{ method.name | caseCamel }}({% for parameter in method.parameters.all %}{% if parameter.required %}{% if not loop.first %}, {% endif %}{{ parameter | paramExample }}{% endif %}{% endfor %})
14-
val json = response.body?.string()
13+
val {{ service.name | caseCamel }} = {{ service.name | caseUcfirst }}(client)
14+
val response = {{ service.name | caseCamel }}.{{ method.name | caseCamel }}({% if method.parameters.all | length == 0 %}){% endif %}
15+
16+
{% for parameter in method.parameters.all %}
17+
{% if parameter.required %}
18+
{{parameter.name}} = {{ parameter | paramExample }}{% if not loop.last %},{% endif %}
19+
20+
{% endif %}
21+
{% if loop.last %}
22+
)
23+
{% endif %}
24+
{% endfor %}
25+
val json = response.body?.string()
26+
}

0 commit comments

Comments
 (0)