applyWrites method

Future<XRPCResponse<ApplyWritesOutput>> applyWrites({
  1. String? repo,
  2. bool? validate,
  3. required List<UApplyWritesWrite> writes,
  4. String? swapCommit,
  5. Map<String, String>? $unknown,
  6. Map<String, String>? $headers,
  7. PostClient? $client,
})

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

https://atprotodart.com/docs/lexicons/com/atproto/repo/applyWrites

Implementation

Future<XRPCResponse<ApplyWritesOutput>> applyWrites({
  String? repo,
  bool? validate,
  required List<UApplyWritesWrite> writes,
  String? swapCommit,
  Map<String, String>? $unknown,
  Map<String, String>? $headers,
  PostClient? $client,
}) async =>
    await _ctx.post<ApplyWritesOutput>(
      ns.comAtprotoRepoApplyWrites,
      headers: $headers,
      body: {
        'repo': repo ?? _ctx.repo,
        if (validate != null) 'validate': validate,
        'writes': writes.map((e) => e.toJson()).toList(),
        if (swapCommit != null) 'swapCommit': swapCommit,
        ...?$unknown,
      },
      to: const ApplyWritesOutputConverter().fromJson,
      client: $client,
    );