@@ -21,10 +21,7 @@ class CelestFunctions {
2121}
2222
2323class CelestFunctionsGreeting {
24- Never _throwError ({
25- int ? code,
26- required Map <String , Object ?> body,
27- }) {
24+ Never _throwError ({int ? code, required Map <String , Object ?> body}) {
2825 final status = body['@status' ] as Map <String , Object ?>? ;
2926 final message = status? ['message' ] as String ? ;
3027 final details = status? ['details' ] as _$celest.JsonList ? ;
@@ -34,27 +31,28 @@ class CelestFunctionsGreeting {
3431 final errorDetails as Map <String , Object ?>,
3532 {
3633 '@type' : 'dart.core.StackTrace' ,
37- 'value' : final stackTraceValue as String
34+ 'value' : final stackTraceValue as String ,
3835 },
39- ...
36+ ...,
4037 ] =>
4138 (
4239 errorDetails['@type' ],
4340 errorDetails['value' ],
4441 StackTrace .fromString (stackTraceValue),
4542 ),
4643 [final errorDetails as Map <String , Object ?>, ...] => (
47- errorDetails['@type' ],
48- errorDetails['value' ],
49- StackTrace .empty,
50- ),
44+ errorDetails['@type' ],
45+ errorDetails['value' ],
46+ StackTrace .empty,
47+ ),
5148 };
5249
5350 switch (errorType) {
5451 case 'celest.core.v1.CloudException' :
5552 Error .throwWithStackTrace (
56- _$celest.Serializers .instance
57- .deserialize< _$celest.CloudException > (errorValue),
53+ _$celest.Serializers .instance.deserialize< _$celest.CloudException > (
54+ errorValue,
55+ ),
5856 stackTrace,
5957 );
6058 case 'celest.core.v1.CancelledException' :
@@ -65,8 +63,9 @@ class CelestFunctionsGreeting {
6563 );
6664 case 'celest.core.v1.UnknownError' :
6765 Error .throwWithStackTrace (
68- _$celest.Serializers .instance
69- .deserialize< _$celest.UnknownError > (errorValue),
66+ _$celest.Serializers .instance.deserialize< _$celest.UnknownError > (
67+ errorValue,
68+ ),
7069 stackTrace,
7170 );
7271 case 'celest.core.v1.BadRequestException' :
@@ -83,8 +82,9 @@ class CelestFunctionsGreeting {
8382 );
8483 case 'celest.core.v1.NotFoundException' :
8584 Error .throwWithStackTrace (
86- _$celest.Serializers .instance
87- .deserialize< _$celest.NotFoundException > (errorValue),
85+ _$celest.Serializers .instance.deserialize< _$celest.NotFoundException > (
86+ errorValue,
87+ ),
8888 stackTrace,
8989 );
9090 case 'celest.core.v1.AlreadyExistsException' :
@@ -113,8 +113,9 @@ class CelestFunctionsGreeting {
113113 );
114114 case 'celest.core.v1.AbortedException' :
115115 Error .throwWithStackTrace (
116- _$celest.Serializers .instance
117- .deserialize< _$celest.AbortedException > (errorValue),
116+ _$celest.Serializers .instance.deserialize< _$celest.AbortedException > (
117+ errorValue,
118+ ),
118119 stackTrace,
119120 );
120121 case 'celest.core.v1.OutOfRangeException' :
@@ -137,14 +138,16 @@ class CelestFunctionsGreeting {
137138 );
138139 case 'celest.core.v1.UnavailableError' :
139140 Error .throwWithStackTrace (
140- _$celest.Serializers .instance
141- .deserialize< _$celest.UnavailableError > (errorValue),
141+ _$celest.Serializers .instance.deserialize< _$celest.UnavailableError > (
142+ errorValue,
143+ ),
142144 stackTrace,
143145 );
144146 case 'celest.core.v1.DataLossError' :
145147 Error .throwWithStackTrace (
146- _$celest.Serializers .instance
147- .deserialize< _$celest.DataLossError > (errorValue),
148+ _$celest.Serializers .instance.deserialize< _$celest.DataLossError > (
149+ errorValue,
150+ ),
148151 stackTrace,
149152 );
150153 case 'celest.core.v1.DeadlineExceededError' :
@@ -191,14 +194,16 @@ class CelestFunctionsGreeting {
191194 );
192195 case 'dart.core.UnsupportedError' :
193196 Error .throwWithStackTrace (
194- _$celest.Serializers .instance
195- .deserialize <UnsupportedError >(errorValue),
197+ _$celest.Serializers .instance.deserialize <UnsupportedError >(
198+ errorValue,
199+ ),
196200 stackTrace,
197201 );
198202 case 'dart.core.UnimplementedError' :
199203 Error .throwWithStackTrace (
200- _$celest.Serializers .instance
201- .deserialize <UnimplementedError >(errorValue),
204+ _$celest.Serializers .instance.deserialize <UnimplementedError >(
205+ errorValue,
206+ ),
202207 stackTrace,
203208 );
204209 case 'dart.core.StateError' :
@@ -214,14 +219,16 @@ class CelestFunctionsGreeting {
214219 );
215220 case 'dart.core.OutOfMemoryError' :
216221 Error .throwWithStackTrace (
217- _$celest.Serializers .instance
218- .deserialize <OutOfMemoryError >(errorValue),
222+ _$celest.Serializers .instance.deserialize <OutOfMemoryError >(
223+ errorValue,
224+ ),
219225 stackTrace,
220226 );
221227 case 'dart.core.StackOverflowError' :
222228 Error .throwWithStackTrace (
223- _$celest.Serializers .instance
224- .deserialize <StackOverflowError >(errorValue),
229+ _$celest.Serializers .instance.deserialize <StackOverflowError >(
230+ errorValue,
231+ ),
225232 stackTrace,
226233 );
227234 case 'dart.core.Exception' :
@@ -231,8 +238,9 @@ class CelestFunctionsGreeting {
231238 );
232239 case 'dart.core.FormatException' :
233240 Error .throwWithStackTrace (
234- _$celest.Serializers .instance
235- .deserialize <FormatException >(errorValue),
241+ _$celest.Serializers .instance.deserialize <FormatException >(
242+ errorValue,
243+ ),
236244 stackTrace,
237245 );
238246 case 'dart.core.IntegerDivisionByZeroException' :
@@ -248,20 +256,23 @@ class CelestFunctionsGreeting {
248256 );
249257 case 'dart.async.TimeoutException' :
250258 Error .throwWithStackTrace (
251- _$celest.Serializers .instance
252- .deserialize <TimeoutException >(errorValue),
259+ _$celest.Serializers .instance.deserialize <TimeoutException >(
260+ errorValue,
261+ ),
253262 stackTrace,
254263 );
255264 case 'dart.convert.JsonUnsupportedObjectError' :
256265 Error .throwWithStackTrace (
257- _$celest.Serializers .instance
258- .deserialize <JsonUnsupportedObjectError >(errorValue),
266+ _$celest.Serializers .instance.deserialize <JsonUnsupportedObjectError >(
267+ errorValue,
268+ ),
259269 stackTrace,
260270 );
261271 case 'example.v1.BadNameException' :
262272 Error .throwWithStackTrace (
263- _$celest.Serializers .instance
264- .deserialize <BadNameException >(errorValue),
273+ _$celest.Serializers .instance.deserialize <BadNameException >(
274+ errorValue,
275+ ),
265276 stackTrace,
266277 );
267278 default :
@@ -277,19 +288,17 @@ class CelestFunctionsGreeting {
277288 }
278289
279290 /// Says hello to a [person] .
280- @_$celest.CloudFunction (
281- api: 'greeting' ,
282- function: 'sayHello' ,
283- )
291+ @_$celest.CloudFunction (api: 'greeting' , function: 'sayHello' )
284292 Future <String > sayHello ({required Person person}) async {
285293 final $response = await celest.httpClient.post (
286294 celest.baseUri.resolve ('/greeting/say-hello' ),
287295 headers: const {
288296 'Content-Type' : 'application/json' ,
289297 'Accept' : 'application/json' ,
290298 },
291- body: _$celest.JsonUtf8 .encode (
292- {r'person' : _$celest.Serializers .instance.serialize <Person >(person)}),
299+ body: _$celest.JsonUtf8 .encode ({
300+ r'person' : _$celest.Serializers .instance.serialize <Person >(person),
301+ }),
293302 );
294303 final $body = _$celest.JsonUtf8 .decode ($response.bodyBytes);
295304 if ($response.statusCode != 200 ) {
0 commit comments