createRecord method

Future<XRPCResponse<StrongRef>> createRecord({
  1. required NSID collection,
  2. required Map<String, dynamic> record,
  3. String? rkey,
  4. bool? validate,
  5. String? swapRecordCid,
  6. String? swapCommitCid,
})

Implementation

Future<core.XRPCResponse<StrongRef>> createRecord({
  required core.NSID collection,
  required Map<String, dynamic> record,
  String? rkey,
  bool? validate,
  String? swapRecordCid,
  String? swapCommitCid,
}) async =>
    await _ctx.post(
      ns.comAtprotoRepoCreateRecord,
      body: {
        'repo': _ctx.session?.did,
        'collection': collection.toString(),
        'rkey': rkey,
        'record': record,
        'validate': validate,
        'swapRecord': swapRecordCid,
        'swapCommit': swapCommitCid
      },
      to: StrongRef.fromJson,
    );