@@ -16,6 +16,26 @@ public class GetCurrentWeatherArgs
1616 public global ::System . DateOnly Date { get ; set ; }
1717 }
1818
19+ public class SetValueArgs
20+ {
21+ public int Value { get ; set ; }
22+ }
23+
24+ public class GetValueArgs
25+ {
26+
27+ }
28+
29+ public class SetValueAsyncArgs
30+ {
31+ public int Value { get ; set ; }
32+ }
33+
34+ public class GetValueAsyncArgs
35+ {
36+
37+ }
38+
1939 public static global ::System . Collections . Generic . IReadOnlyDictionary < string , global ::System . Func < string , global ::System . Threading . CancellationToken , global ::System . Threading . Tasks . Task < string > > > AsCalls ( this IVariousTypesTools service )
2040 {
2141 return new global ::System . Collections . Generic . Dictionary < string , global ::System . Func < string , global ::System . Threading . CancellationToken , global ::System . Threading . Tasks . Task < string > > >
@@ -24,9 +44,27 @@ public class GetCurrentWeatherArgs
2444 {
2545 return global ::System . Threading . Tasks . Task . FromResult ( service . CallGetCurrentWeather ( json ) ) ;
2646 } ,
27-
28-
29-
47+
48+ [ "GetValue" ] = ( json , _ ) =>
49+ {
50+ return global ::System . Threading . Tasks . Task . FromResult ( service . CallGetValue ( json ) ) ;
51+ } ,
52+ [ "SetValue" ] = ( json , _ ) =>
53+ {
54+ service . CallSetValue ( json ) ;
55+
56+ return global ::System . Threading . Tasks . Task . FromResult ( string . Empty ) ;
57+ } ,
58+ [ "GetValueAsync" ] = async ( json , cancellationToken ) =>
59+ {
60+ return await service . CallGetValueAsync ( json , cancellationToken ) ;
61+ } ,
62+ [ "SetValueAsync" ] = async ( json , cancellationToken ) =>
63+ {
64+ await service . CallSetValueAsync ( json , cancellationToken ) ;
65+
66+ return string . Empty ;
67+ } ,
3068 } ;
3169 }
3270
@@ -43,6 +81,58 @@ public static VariousTypesToolsExtensions.GetCurrentWeatherArgs AsGetCurrentWeat
4381 throw new global ::System . InvalidOperationException ( "Could not deserialize JSON." ) ;
4482 }
4583
84+ public static VariousTypesToolsExtensions . SetValueArgs AsSetValueArgs (
85+ this IVariousTypesTools functions ,
86+ string json )
87+ {
88+ return
89+ global ::System . Text . Json . JsonSerializer . Deserialize < VariousTypesToolsExtensions . SetValueArgs > ( json , new global ::System . Text . Json . JsonSerializerOptions
90+ {
91+ PropertyNamingPolicy = global ::System . Text . Json . JsonNamingPolicy . CamelCase ,
92+ Converters = { { new global ::System . Text . Json . Serialization . JsonStringEnumConverter ( global ::System . Text . Json . JsonNamingPolicy . CamelCase ) } }
93+ } ) ??
94+ throw new global ::System . InvalidOperationException ( "Could not deserialize JSON." ) ;
95+ }
96+
97+ public static VariousTypesToolsExtensions . GetValueArgs AsGetValueArgs (
98+ this IVariousTypesTools functions ,
99+ string json )
100+ {
101+ return
102+ global ::System . Text . Json . JsonSerializer . Deserialize < VariousTypesToolsExtensions . GetValueArgs > ( json , new global ::System . Text . Json . JsonSerializerOptions
103+ {
104+ PropertyNamingPolicy = global ::System . Text . Json . JsonNamingPolicy . CamelCase ,
105+ Converters = { { new global ::System . Text . Json . Serialization . JsonStringEnumConverter ( global ::System . Text . Json . JsonNamingPolicy . CamelCase ) } }
106+ } ) ??
107+ throw new global ::System . InvalidOperationException ( "Could not deserialize JSON." ) ;
108+ }
109+
110+ public static VariousTypesToolsExtensions . SetValueAsyncArgs AsSetValueAsyncArgs (
111+ this IVariousTypesTools functions ,
112+ string json )
113+ {
114+ return
115+ global ::System . Text . Json . JsonSerializer . Deserialize < VariousTypesToolsExtensions . SetValueAsyncArgs > ( json , new global ::System . Text . Json . JsonSerializerOptions
116+ {
117+ PropertyNamingPolicy = global ::System . Text . Json . JsonNamingPolicy . CamelCase ,
118+ Converters = { { new global ::System . Text . Json . Serialization . JsonStringEnumConverter ( global ::System . Text . Json . JsonNamingPolicy . CamelCase ) } }
119+ } ) ??
120+ throw new global ::System . InvalidOperationException ( "Could not deserialize JSON." ) ;
121+ }
122+
123+ public static VariousTypesToolsExtensions . GetValueAsyncArgs AsGetValueAsyncArgs (
124+ this IVariousTypesTools functions ,
125+ string json )
126+ {
127+ return
128+ global ::System . Text . Json . JsonSerializer . Deserialize < VariousTypesToolsExtensions . GetValueAsyncArgs > ( json , new global ::System . Text . Json . JsonSerializerOptions
129+ {
130+ PropertyNamingPolicy = global ::System . Text . Json . JsonNamingPolicy . CamelCase ,
131+ Converters = { { new global ::System . Text . Json . Serialization . JsonStringEnumConverter ( global ::System . Text . Json . JsonNamingPolicy . CamelCase ) } }
132+ } ) ??
133+ throw new global ::System . InvalidOperationException ( "Could not deserialize JSON." ) ;
134+ }
135+
46136 public static string CallGetCurrentWeather ( this IVariousTypesTools functions , string json )
47137 {
48138 var args = functions . AsGetCurrentWeatherArgs ( json ) ;
@@ -55,11 +145,49 @@ public static string CallGetCurrentWeather(this IVariousTypesTools functions, st
55145 } ) ;
56146 }
57147
58-
148+ public static string CallGetValue ( this IVariousTypesTools functions , string json )
149+ {
150+ var args = functions . AsGetValueArgs ( json ) ;
151+ var jsonResult = functions . GetValue ( ) ;
152+
153+ return global ::System . Text . Json . JsonSerializer . Serialize ( jsonResult , new global ::System . Text . Json . JsonSerializerOptions
154+ {
155+ PropertyNamingPolicy = global ::System . Text . Json . JsonNamingPolicy . CamelCase ,
156+ Converters = { new global ::System . Text . Json . Serialization . JsonStringEnumConverter ( global ::System . Text . Json . JsonNamingPolicy . CamelCase ) } ,
157+ } ) ;
158+ }
159+
160+ public static void CallSetValue ( this IVariousTypesTools functions , string json )
161+ {
162+ var args = functions . AsSetValueArgs ( json ) ;
163+ functions . SetValue ( args . Value ) ;
164+ }
59165
60-
166+ public static async global ::System . Threading . Tasks . Task < string > CallGetValueAsync (
167+ this IVariousTypesTools functions ,
168+ string json ,
169+ global ::System . Threading . CancellationToken cancellationToken = default )
170+ {
171+ var args = functions . AsGetValueAsyncArgs ( json ) ;
172+ var jsonResult = await functions . GetValueAsync ( cancellationToken ) ;
61173
62-
174+ return global ::System . Text . Json . JsonSerializer . Serialize ( jsonResult , new global ::System . Text . Json . JsonSerializerOptions
175+ {
176+ PropertyNamingPolicy = global ::System . Text . Json . JsonNamingPolicy . CamelCase ,
177+ Converters = { new global ::System . Text . Json . Serialization . JsonStringEnumConverter ( global ::System . Text . Json . JsonNamingPolicy . CamelCase ) } ,
178+ } ) ;
179+ }
180+
181+ public static async global ::System . Threading . Tasks . Task < string > CallSetValueAsync (
182+ this IVariousTypesTools functions ,
183+ string json ,
184+ global ::System . Threading . CancellationToken cancellationToken = default )
185+ {
186+ var args = functions . AsSetValueAsyncArgs ( json ) ;
187+ await functions . SetValueAsync ( args . Value , cancellationToken ) ;
188+
189+ return string . Empty ;
190+ }
63191
64192 public static async global ::System . Threading . Tasks . Task < string > CallAsync (
65193 this IVariousTypesTools service ,
0 commit comments