getConfig method

Future<GetConfigResponse> getConfig({
  1. required String clientArn,
  2. required ClientVersion clientVersion,
  3. required List<String> hapgList,
})

This is documentation for AWS CloudHSM Classic. For more information, see AWS CloudHSM Classic FAQs, the AWS CloudHSM Classic User Guide, and the AWS CloudHSM Classic API Reference.

For information about the current version of AWS CloudHSM, see AWS CloudHSM, the AWS CloudHSM User Guide, and the AWS CloudHSM API Reference.

Gets the configuration files necessary to connect to all high availability partition groups the client is associated with.

May throw CloudHsmServiceException. May throw CloudHsmInternalException. May throw InvalidRequestException.

Parameter clientArn : The ARN of the client.

Parameter clientVersion : The client version.

Parameter hapgList : A list of ARNs that identify the high-availability partition groups that are associated with the client.

Implementation

Future<GetConfigResponse> getConfig({
  required String clientArn,
  required ClientVersion clientVersion,
  required List<String> hapgList,
}) async {
  ArgumentError.checkNotNull(clientArn, 'clientArn');
  ArgumentError.checkNotNull(clientVersion, 'clientVersion');
  ArgumentError.checkNotNull(hapgList, 'hapgList');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'CloudHsmFrontendService.GetConfig'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ClientArn': clientArn,
      'ClientVersion': clientVersion.toValue(),
      'HapgList': hapgList,
    },
  );

  return GetConfigResponse.fromJson(jsonResponse.body);
}