createRecord method
Create a single new repository record. Requires auth, implemented by PDS.
https://atprotodart.com/docs/lexicons/com/atproto/repo/createRecord
Implementation
Future<XRPCResponse<CreateRecordOutput>> createRecord({
String? repo,
required NSID collection,
String? rkey,
bool? validate,
required Map<String, dynamic> record,
String? swapCommit,
Map<String, String>? $unknown,
Map<String, String>? $headers,
PostClient? $client,
}) async =>
await _ctx.post<CreateRecordOutput>(
ns.comAtprotoRepoCreateRecord,
headers: $headers,
body: {
'repo': repo ?? _ctx.repo,
'collection': collection.toString(),
if (rkey != null) 'rkey': rkey,
if (validate != null) 'validate': validate,
'record': record,
if (swapCommit != null) 'swapCommit': swapCommit,
...?$unknown,
},
to: const CreateRecordOutputConverter().fromJson,
client: $client,
);