You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

FunctionCallTemplateTests.TestFunctionCallTemplate.approved.txt 2.0 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //----------------------
  2. // <auto-generated>
  3. // This code was generated by a tool.
  4. // </auto-generated>
  5. //----------------------
  6. using System.Text.Json;
  7. using System.Text.Json.Serialization;
  8. using System.Threading.Tasks;
  9. using System;
  10. using AutoGen.Core;
  11. namespace AutoGen.SourceGenerator.Tests
  12. {
  13. public partial class FunctionExamples
  14. {
  15. private class AddAsyncSchema
  16. {
  17. [JsonPropertyName(@"a")]
  18. public System.Int32 a {get; set;}
  19. [JsonPropertyName(@"b")]
  20. public System.Int32 b {get; set;}
  21. }
  22. public System.Threading.Tasks.Task`1[System.String] AddAsyncWrapper(string arguments)
  23. {
  24. var schema = JsonSerializer.Deserialize<AddAsyncSchema>(
  25. arguments,
  26. new JsonSerializerOptions
  27. {
  28. PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
  29. });
  30. return AddAsync(schema.a, schema.b);
  31. }
  32. public FunctionContract AddAsyncFunctionContract
  33. {
  34. get => new FunctionContract
  35. {
  36. Name = @"AddAsync",
  37. Description = @"Add two numbers.",
  38. ReturnType = typeof(System.Threading.Tasks.Task`1[System.String]),
  39. Parameters = new global::AutoGen.Core.FunctionParameterContract[]
  40. {
  41. new FunctionParameterContract
  42. {
  43. Name = @"a",
  44. Description = @"The first number.",
  45. ParameterType = typeof(System.Int32),
  46. IsRequired = true,
  47. },
  48. new FunctionParameterContract
  49. {
  50. Name = @"b",
  51. Description = @"The second number.",
  52. ParameterType = typeof(System.Int32),
  53. IsRequired = true,
  54. },
  55. },
  56. };
  57. }
  58. }
  59. }