stampUpdateUser method

Future<TSignedRequest> stampUpdateUser({
  1. required TUpdateUserBody input,
})

Produce a SignedRequest from TUpdateUserBody by using the client's stamp function.

See also: UpdateUser.

Implementation

Future<TSignedRequest> stampUpdateUser({
  required TUpdateUserBody input,
}) async {
  final fullUrl = '${config.baseUrl}/public/v1/submit/update_user';
  final body = packActivityBody(
    bodyJson: input.toJson(),
    fallbackOrganizationId: input.organizationId ??
        config.organizationId ??
        (throw Exception(
            "Missing organization ID, please pass in a sub-organizationId or instantiate the client with one.")),
    activityType: 'ACTIVITY_TYPE_UPDATE_USER',
  );
  final bodyJson = jsonEncode(body);
  final stamp = await stamper.stamp(bodyJson);

  return TSignedRequest(
    body: bodyJson,
    stamp: stamp,
    url: fullUrl,
  );
}