@@ -139,23 +139,26 @@ public function getKeywords(): array
139
139
public function getIdentifierOverrides (): array
140
140
{
141
141
return [
142
- 'Jwt ' => 'JWT '
142
+ 'Jwt ' => 'JWT ' ,
143
+ 'Domain ' => 'XDomain ' ,
143
144
];
144
145
}
145
146
146
147
/**
147
- * @param $type
148
+ * @param array $parameter
148
149
* @return string
149
150
*/
150
151
public function getTypeName (array $ parameter ): string
151
152
{
152
153
switch ($ parameter ['type ' ]) {
153
154
case self ::TYPE_INTEGER :
154
- return 'int ' ;
155
+ return 'long ' ;
156
+ case self ::TYPE_NUMBER :
157
+ return 'double ' ;
155
158
case self ::TYPE_STRING :
156
159
return 'string ' ;
157
160
case self ::TYPE_FILE :
158
- return 'FileInfo ' ;
161
+ return 'InputFile ' ;
159
162
case self ::TYPE_BOOLEAN :
160
163
return 'bool ' ;
161
164
case self ::TYPE_ARRAY :
@@ -233,7 +236,7 @@ public function getParamExample(array $param): string
233
236
if (empty ($ example ) && $ example !== 0 && $ example !== false ) {
234
237
switch ($ type ) {
235
238
case self ::TYPE_FILE :
236
- $ output .= 'new File ("./path-to-files/image.jpg") ' ;
239
+ $ output .= 'InputFile.FromPath ("./path-to-files/image.jpg") ' ;
237
240
break ;
238
241
case self ::TYPE_NUMBER :
239
242
case self ::TYPE_INTEGER :
@@ -249,7 +252,13 @@ public function getParamExample(array $param): string
249
252
$ output .= '[object] ' ;
250
253
break ;
251
254
case self ::TYPE_ARRAY :
252
- $ output .= '[List<object>] ' ;
255
+ if (\str_starts_with ($ example , '[ ' )) {
256
+ $ example = \substr ($ example , 1 );
257
+ }
258
+ if (\str_ends_with ($ example , '] ' )) {
259
+ $ example = \substr ($ example , 0 , -1 );
260
+ }
261
+ $ output .= 'new List< ' . $ this ->getTypeName ($ param ['array ' ]) . '> { ' . $ example . '} ' ;
253
262
break ;
254
263
}
255
264
} else {
@@ -283,23 +292,28 @@ public function getFiles(): array
283
292
return [
284
293
[
285
294
'scope ' => 'default ' ,
286
- 'destination ' => 'README.md ' ,
287
- 'template ' => 'dotnet/README.md .twig ' ,
295
+ 'destination ' => '.travis.yml ' ,
296
+ 'template ' => 'dotnet/.travis.yml .twig ' ,
288
297
],
289
298
[
290
299
'scope ' => 'default ' ,
291
300
'destination ' => 'CHANGELOG.md ' ,
292
301
'template ' => 'dotnet/CHANGELOG.md.twig ' ,
293
302
],
303
+ [
304
+ 'scope ' => 'copy ' ,
305
+ 'destination ' => '/icon.png ' ,
306
+ 'template ' => 'dotnet/icon.png ' ,
307
+ ],
294
308
[
295
309
'scope ' => 'default ' ,
296
310
'destination ' => 'LICENSE ' ,
297
311
'template ' => 'dotnet/LICENSE.twig ' ,
298
312
],
299
313
[
300
314
'scope ' => 'default ' ,
301
- 'destination ' => '.travis.yml ' ,
302
- 'template ' => 'dotnet/.travis.yml .twig ' ,
315
+ 'destination ' => 'README.md ' ,
316
+ 'template ' => 'dotnet/README.md .twig ' ,
303
317
],
304
318
[
305
319
'scope ' => 'method ' ,
@@ -308,53 +322,78 @@ public function getFiles(): array
308
322
],
309
323
[
310
324
'scope ' => 'default ' ,
311
- 'destination ' => '/src/Appwrite .sln ' ,
325
+ 'destination ' => '/src/{{ spec.title | caseUcfirst }} .sln ' ,
312
326
'template ' => 'dotnet/src/Appwrite.sln ' ,
313
327
],
314
- [
315
- 'scope ' => 'copy ' ,
316
- 'destination ' => '/icon.png ' ,
317
- 'template ' => 'dotnet/icon.png ' ,
318
- ],
319
328
[
320
329
'scope ' => 'default ' ,
321
- 'destination ' => '/src/Appwrite/Appwrite .csproj ' ,
330
+ 'destination ' => '/src/{{ spec.title | caseUcfirst }}/{{ spec.title | caseUcfirst }} .csproj ' ,
322
331
'template ' => 'dotnet/src/Appwrite/Appwrite.csproj.twig ' ,
323
332
],
324
333
[
325
334
'scope ' => 'default ' ,
326
- 'destination ' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite /Client.cs ' ,
335
+ 'destination ' => '/src/ {{ spec.title | caseUcfirst }}/Client.cs ' ,
327
336
'template ' => 'dotnet/src/Appwrite/Client.cs.twig ' ,
328
337
],
329
338
[
330
339
'scope ' => 'default ' ,
331
- 'destination ' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite/Helpers/ExtensionMethods .cs ' ,
332
- 'template ' => 'dotnet/src/Appwrite/Helpers/ExtensionMethods .cs ' ,
340
+ 'destination ' => '/src/ {{ spec.title | caseUcfirst }}/{{ spec.title | caseUcfirst }}Exception .cs ' ,
341
+ 'template ' => 'dotnet/src/Appwrite/Exception .cs.twig ' ,
333
342
],
334
343
[
335
344
'scope ' => 'default ' ,
336
- 'destination ' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite/Models/OrderType.cs ' ,
345
+ 'destination ' => '/src/{{ spec.title | caseUcfirst }}/ID.cs ' ,
346
+ 'template ' => 'dotnet/src/Appwrite/ID.cs.twig ' ,
347
+ ],
348
+ [
349
+ 'scope ' => 'default ' ,
350
+ 'destination ' => '/src/{{ spec.title | caseUcfirst }}/Permission.cs ' ,
351
+ 'template ' => 'dotnet/src/Appwrite/Permission.cs.twig ' ,
352
+ ],
353
+ [
354
+ 'scope ' => 'default ' ,
355
+ 'destination ' => '/src/{{ spec.title | caseUcfirst }}/Query.cs ' ,
356
+ 'template ' => 'dotnet/src/Appwrite/Query.cs.twig ' ,
357
+ ],
358
+ [
359
+ 'scope ' => 'default ' ,
360
+ 'destination ' => '/src/{{ spec.title | caseUcfirst }}/Role.cs ' ,
361
+ 'template ' => 'dotnet/src/Appwrite/Role.cs.twig ' ,
362
+ ],
363
+ [
364
+ 'scope ' => 'default ' ,
365
+ 'destination ' => '/src/{{ spec.title | caseUcfirst }}/Extensions/Extensions.cs ' ,
366
+ 'template ' => 'dotnet/src/Appwrite/Extensions/Extensions.cs.twig ' ,
367
+ ],
368
+ [
369
+ 'scope ' => 'default ' ,
370
+ 'destination ' => '/src/{{ spec.title | caseUcfirst }}/Models/OrderType.cs ' ,
337
371
'template ' => 'dotnet/src/Appwrite/Models/OrderType.cs.twig ' ,
338
372
],
339
373
[
340
374
'scope ' => 'default ' ,
341
- 'destination ' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite/ Models/Rule .cs ' ,
342
- 'template ' => 'dotnet/src/Appwrite/Models/Rule .cs.twig ' ,
375
+ 'destination ' => '/src/ {{ spec.title | caseUcfirst }}/Models/UploadProgress .cs ' ,
376
+ 'template ' => 'dotnet/src/Appwrite/Models/UploadProgress .cs.twig ' ,
343
377
],
344
378
[
345
379
'scope ' => 'default ' ,
346
- 'destination ' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite/ Models/Exception .cs ' ,
347
- 'template ' => 'dotnet/src/Appwrite/Models/Exception .cs.twig ' ,
380
+ 'destination ' => '/src/ {{ spec.title | caseUcfirst }}/Models/InputFile .cs ' ,
381
+ 'template ' => 'dotnet/src/Appwrite/Models/InputFile .cs.twig ' ,
348
382
],
349
383
[
350
384
'scope ' => 'default ' ,
351
- 'destination ' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite /Services/Service.cs ' ,
385
+ 'destination ' => '/src/ {{ spec.title | caseUcfirst }}/Services/Service.cs ' ,
352
386
'template ' => 'dotnet/src/Appwrite/Services/Service.cs.twig ' ,
353
387
],
354
388
[
355
389
'scope ' => 'service ' ,
356
- 'destination ' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite /Services/{{service.name | caseUcfirst}}.cs ' ,
390
+ 'destination ' => '/src/ {{ spec.title | caseUcfirst }}/Services/{{service.name | caseUcfirst}}.cs ' ,
357
391
'template ' => 'dotnet/src/Appwrite/Services/ServiceTemplate.cs.twig ' ,
392
+ ],
393
+ [
394
+ 'scope ' => 'definition ' ,
395
+ 'destination ' => '/src/{{ spec.title | caseUcfirst }}/Models/{{ definition.name | caseUcfirst | overrideIdentifier }}.cs ' ,
396
+ 'template ' => 'dotnet/src/Appwrite/Models/Model.cs.twig ' ,
358
397
]
359
398
];
360
399
}
0 commit comments