comAtprotoRepoPutRecord function

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

Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS.

Implementation

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