stampCreateReadOnlySession method
Produce a SignedRequest from TCreateReadOnlySessionBody by using the client's stamp function.
See also: CreateReadOnlySession.
Implementation
Future<TSignedRequest> stampCreateReadOnlySession({
required TCreateReadOnlySessionBody input,
}) async {
final fullUrl =
'${config.baseUrl}/public/v1/submit/create_read_only_session';
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_CREATE_READ_ONLY_SESSION',
);
final bodyJson = jsonEncode(body);
final stamp = await stamper.stamp(bodyJson);
return TSignedRequest(
body: bodyJson,
stamp: stamp,
url: fullUrl,
);
}