comAtprotoRepoApplyWrites function

Future<XRPCResponse<RepoApplyWritesOutput>> comAtprotoRepoApplyWrites({
  1. required String repo,
  2. bool? validate,
  3. required List<URepoApplyWritesWrites> writes,
  4. String? swapCommit,
  5. required ServiceContext $ctx,
  6. Map<String, String>? $headers,
  7. Map<String, String>? $unknown,
})

Apply a batch transaction of repository creates, updates, and deletes. Requires auth, implemented by PDS.

Implementation

Future<XRPCResponse<RepoApplyWritesOutput>> comAtprotoRepoApplyWrites({
  required String repo,
  bool? validate,
  required List<URepoApplyWritesWrites> writes,
  String? swapCommit,
  required ServiceContext $ctx,
  Map<String, String>? $headers,
  Map<String, String>? $unknown,
}) async => await $ctx.post(
  ns.comAtprotoRepoApplyWrites,
  headers: {'Content-type': 'application/json', ...?$headers},
  body: {
    ...?$unknown,
    'repo': repo,
    if (validate != null) 'validate': validate,
    'writes': writes.map((e) => e.toJson()).toList(),
    if (swapCommit != null) 'swapCommit': swapCommit,
  },
  to: const RepoApplyWritesOutputConverter().fromJson,
);