@@ -30,11 +30,13 @@ class RoutingClient {
30
30
String id,
31
31
String relationship,
32
32
List <Identifier > identifiers, {
33
+ Map <String , Object ?> meta = const {},
33
34
Map <String , String > headers = const {},
34
35
}) async {
35
36
final response = await send (
36
37
baseUri.relationship (type, id, relationship),
37
- Request .post (OutboundDataDocument .many (ToMany (identifiers)))
38
+ Request .post (
39
+ OutboundDataDocument .many (ToMany (identifiers)..meta.addAll (meta)))
38
40
..headers.addAll (headers));
39
41
return RelationshipUpdated .many (response.http, response.document);
40
42
}
@@ -84,11 +86,13 @@ class RoutingClient {
84
86
String id,
85
87
String relationship,
86
88
List <Identifier > identifiers, {
89
+ Map <String , Object ?> meta = const {},
87
90
Map <String , String > headers = const {},
88
91
}) async {
89
92
final response = await send (
90
93
baseUri.relationship (type, id, relationship),
91
- Request .delete (OutboundDataDocument .many (ToMany (identifiers)))
94
+ Request .delete (
95
+ OutboundDataDocument .many (ToMany (identifiers)..meta.addAll (meta)))
92
96
..headers.addAll (headers));
93
97
94
98
return RelationshipUpdated .many (response.http, response.document);
@@ -235,12 +239,16 @@ class RoutingClient {
235
239
response.http, response.document ?? (throw FormatException ()));
236
240
}
237
241
238
- Future <ResourceUpdated > updateResource (String type, String id,
239
- {Map <String , Object ?> attributes = const {},
240
- Map <String , Identifier > one = const {},
241
- Map <String , Iterable <Identifier >> many = const {},
242
- Map <String , Object ?> meta = const {},
243
- Map <String , String > headers = const {}}) async {
242
+ Future <ResourceUpdated > updateResource (
243
+ String type,
244
+ String id, {
245
+ Map <String , Object ?> attributes = const {},
246
+ Map <String , Identifier > one = const {},
247
+ Map <String , Iterable <Identifier >> many = const {},
248
+ Map <String , Object ?> meta = const {},
249
+ Map <String , Object ?> documentMeta = const {},
250
+ Map <String , String > headers = const {},
251
+ }) async {
244
252
final response = await send (
245
253
baseUri.resource (type, id),
246
254
Request .patch (OutboundDataDocument .resource (Resource (type, id)
@@ -249,7 +257,8 @@ class RoutingClient {
249
257
...one.map ((key, value) => MapEntry (key, ToOne (value))),
250
258
...many.map ((key, value) => MapEntry (key, ToMany (value))),
251
259
})
252
- ..meta.addAll (meta)))
260
+ ..meta.addAll (meta))
261
+ ..meta.addAll (documentMeta))
253
262
..headers.addAll (headers));
254
263
return ResourceUpdated (response.http, response.document);
255
264
}
@@ -262,6 +271,7 @@ class RoutingClient {
262
271
Map <String , Identifier > one = const {},
263
272
Map <String , Iterable <Identifier >> many = const {},
264
273
Map <String , Object ?> meta = const {},
274
+ Map <String , Object ?> documentMeta = const {},
265
275
Map <String , String > headers = const {},
266
276
}) async {
267
277
final response = await send (
@@ -272,7 +282,8 @@ class RoutingClient {
272
282
...one.map ((key, value) => MapEntry (key, ToOne (value))),
273
283
...many.map ((key, value) => MapEntry (key, ToMany (value))),
274
284
})
275
- ..meta.addAll (meta)))
285
+ ..meta.addAll (meta))
286
+ ..meta.addAll (documentMeta))
276
287
..headers.addAll (headers));
277
288
return ResourceUpdated (response.http, response.document);
278
289
}
@@ -282,11 +293,13 @@ class RoutingClient {
282
293
String id,
283
294
String relationship,
284
295
Identifier identifier, {
296
+ Map <String , Object ?> meta = const {},
285
297
Map <String , String > headers = const {},
286
298
}) async {
287
299
final response = await send (
288
300
baseUri.relationship (type, id, relationship),
289
- Request .patch (OutboundDataDocument .one (ToOne (identifier)))
301
+ Request .patch (
302
+ OutboundDataDocument .one (ToOne (identifier)..meta.addAll (meta)))
290
303
..headers.addAll (headers));
291
304
return RelationshipUpdated .one (response.http, response.document);
292
305
}
@@ -296,11 +309,13 @@ class RoutingClient {
296
309
String id,
297
310
String relationship,
298
311
Iterable <Identifier > identifiers, {
312
+ Map <String , Object ?> meta = const {},
299
313
Map <String , String > headers = const {},
300
314
}) async {
301
315
final response = await send (
302
316
baseUri.relationship (type, id, relationship),
303
- Request .patch (OutboundDataDocument .many (ToMany (identifiers)))
317
+ Request .patch (
318
+ OutboundDataDocument .many (ToMany (identifiers)..meta.addAll (meta)))
304
319
..headers.addAll (headers));
305
320
return RelationshipUpdated .many (response.http, response.document);
306
321
}
0 commit comments