comAtprotoSpaceAuthorizeSpaceSync function

Future<XRPCResponse<SpaceAuthorizeSpaceSyncOutput>> comAtprotoSpaceAuthorizeSpaceSync({
  1. required String space,
  2. required String credentialKey,
  3. String? delegationToken,
  4. String? clientAttestation,
  5. Notify? notify,
  6. required ServiceContext $ctx,
  7. String? $service,
  8. Map<String, String>? $headers,
  9. Map<String, String>? $unknown,
})

Authorize syncing a space, returning a new credential for reading data across it and the space's current revision, and optionally registering for notifications of updates to it. Depending on the space's policy, a delegation token and/or client attestation may be required. Implemented by the space host.

Implementation

Future<XRPCResponse<SpaceAuthorizeSpaceSyncOutput>>
comAtprotoSpaceAuthorizeSpaceSync({
  required String space,
  required String credentialKey,
  String? delegationToken,
  String? clientAttestation,
  Notify? notify,
  required ServiceContext $ctx,
  String? $service,
  Map<String, String>? $headers,
  Map<String, String>? $unknown,
}) async => await $ctx.post(
  ns.comAtprotoSpaceAuthorizeSpaceSync,
  service: $service,
  headers: {'Content-type': 'application/json', ...?$headers},
  body: {
    ...?$unknown,
    'space': space,
    'credentialKey': credentialKey,
    if (delegationToken != null) 'delegationToken': delegationToken,
    if (clientAttestation != null) 'clientAttestation': clientAttestation,
    if (notify != null) 'notify': const NotifyConverter().toJson(notify),
  },
  to: const SpaceAuthorizeSpaceSyncOutputConverter().fromJson,
);