Skip to content

Commit 1204829

Browse files
author
Wen Yu Ge
committed
Fix twig templates to add InputFile imports
1 parent e5949c5 commit 1204829

File tree

5 files changed

+14
-2
lines changed

5 files changed

+14
-2
lines changed

src/SDK/Language/Ruby.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ public function getParamExample(array $param)
281281
$output .= '{}';
282282
break;
283283
case self::TYPE_FILE:
284-
$output .= "InputFile.fromPath('dir/file.png')";
284+
$output .= "InputFile.from_path('dir/file.png')";
285285
break;
286286
}
287287
}
@@ -302,7 +302,7 @@ public function getParamExample(array $param)
302302
$output .= "'{$example}'";
303303
break;
304304
case self::TYPE_FILE:
305-
$output .= "InputFile.fromPath('dir/file.png')";
305+
$output .= "InputFile.from_path('dir/file.png')";
306306
break;
307307
}
308308
}

templates/kotlin/docs/java/example.md.twig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import {{ sdk.namespace | caseDot }}.Client
22
import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }}
3+
{% if method.type == "upload" %}
4+
import {{ sdk.namespace | caseDot }}.models.InputFile
5+
{% endif %}
36

47
public void main() {
58
Client client = Client(context)

templates/kotlin/docs/kotlin/example.md.twig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import {{ sdk.namespace | caseDot }}.Client
22
import {{ sdk.namespace | caseDot }}.services.{{ service.name | caseUcfirst }}
3+
{% if method.type == "upload" %}
4+
import {{ sdk.namespace | caseDot }}.models.InputFile
5+
{% endif %}
36

47
suspend fun main() {
58
val client = Client(context)

templates/python/docs/example.md.twig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
from {{ spec.title | caseSnake }}.client import Client
22
from {{ spec.title | caseSnake }}.services.{{ service.name | caseSnake }} import {{ service.name | caseUcfirst }}
3+
{% if method.type == "upload" %}
4+
from {{ spec.title | caseSnake }}.input_file import InputFile
5+
{% endif %}
36

47
client = Client()
58

templates/ruby/docs/example.md.twig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
require 'appwrite'
22

33
client = Appwrite::Client.new
4+
{% if method.type == "upload" %}
5+
InputFile = Appwrite::InputFile
6+
{% endif %}
47

58
client
69
.set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint

0 commit comments

Comments
 (0)