associateSecurityKey method

Future<AssociateSecurityKeyResponse> associateSecurityKey({
  1. required String instanceId,
  2. required String key,
  3. String? clientToken,
})

This API is in preview release for Connect Customer and is subject to change.

Associates a security key to the instance.

May throw InternalServiceException. May throw InvalidParameterException. May throw InvalidRequestException. May throw ResourceConflictException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException.

Parameter instanceId : The identifier of the Connect Customer instance. You can find the instance ID in the Amazon Resource Name (ARN) of the instance.

Parameter key : A valid security key in PEM format as a String.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see Making retries safe with idempotent APIs.

Implementation

Future<AssociateSecurityKeyResponse> associateSecurityKey({
  required String instanceId,
  required String key,
  String? clientToken,
}) async {
  final $payload = <String, dynamic>{
    'Key': key,
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/instance/${Uri.encodeComponent(instanceId)}/security-key',
    exceptionFnMap: _exceptionFns,
  );
  return AssociateSecurityKeyResponse.fromJson(response);
}