comAtprotoRepoCreateRecord function

Future<XRPCResponse<RepoCreateRecordOutput>> comAtprotoRepoCreateRecord({
  1. required String repo,
  2. required String collection,
  3. String? rkey,
  4. bool? validate,
  5. required Map<String, dynamic> record,
  6. String? swapCommit,
  7. required ServiceContext $ctx,
  8. Map<String, String>? $headers,
  9. Map<String, String>? $unknown,
})

Create a single new repository record. Requires auth, implemented by PDS.

Implementation

Future<XRPCResponse<RepoCreateRecordOutput>> comAtprotoRepoCreateRecord({
  required String repo,
  required String collection,
  String? rkey,
  bool? validate,
  required Map<String, dynamic> record,
  String? swapCommit,
  required ServiceContext $ctx,
  Map<String, String>? $headers,
  Map<String, String>? $unknown,
}) async => await $ctx.post(
  ns.comAtprotoRepoCreateRecord,
  headers: {'Content-type': 'application/json', ...?$headers},
  body: {
    ...?$unknown,
    'repo': repo,
    'collection': collection,
    if (rkey != null) 'rkey': rkey,
    if (validate != null) 'validate': validate,
    'record': record,
    if (swapCommit != null) 'swapCommit': swapCommit,
  },
  to: const RepoCreateRecordOutputConverter().fromJson,
);