createApiKeys method

Future<TCreateApiKeysResponse> createApiKeys({
  1. required TCreateApiKeysBody input,
})

Add API keys to an existing user.

Sign the provided TCreateApiKeysBody with the client's stamp function and submit the request (POST /public/v1/submit/create_api_keys).

See also: stampCreateApiKeys.

Implementation

Future<TCreateApiKeysResponse> createApiKeys({
  required TCreateApiKeysBody input,
}) async {
  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_API_KEYS_V2',
  );
  return await request<Map<String, dynamic>, TCreateApiKeysResponse>(
      "/public/v1/submit/create_api_keys",
      body,
      (json) => TCreateApiKeysResponse.fromJson(
          transformActivityResponse(json, 'CreateApiKeys')));
}